Suppose I want to develop a custom, purely graphic control that will be used in both WinForms and ASP.NET. The control will, based on some property settings and related rules, make an image.
Obviously, I could just duplicate the code from the WinForms version to the ASP.NET version, but this will mean that if an error is detected or the rule changes, I have two versions for updating.
I could write a main class with various properties and rules, and the WinForms and ASP.NET control classes would have a property pointing to this main class, for example:
public class MyControlCore {
This will work, but in the property grid, I get a CoreControl property containing the configuration properties. Is there a way for the property grid to display MyControlCore properties instead of the CoreControl property with additional properties?
I thought I could do this with TypeDescriptionProvider and its related classes, but I'm not sure how to do it, and if that would give me the results I got. I understand that this will only help me in the designer, but it is wonderful.
source share