Type property handling?
-
I'm thinking ahead, and wonder if anyone knows how a Type property is handled by its designers/typeconverters (if any)? What I'm hoping is that the designers/typeconverters for a Type property will allow entering the String class name of the type, and translate that to an underlying type field, f_MyType:
protected internal Type f_MyType = null; // CAN WE INPUT THE String CLASS NAME TO THIS PROPERTY? public Type MyType { get { return f_MyType; } set { f_MyType = value; } }
TIA, mike
-
I'm thinking ahead, and wonder if anyone knows how a Type property is handled by its designers/typeconverters (if any)? What I'm hoping is that the designers/typeconverters for a Type property will allow entering the String class name of the type, and translate that to an underlying type field, f_MyType:
protected internal Type f_MyType = null; // CAN WE INPUT THE String CLASS NAME TO THIS PROPERTY? public Type MyType { get { return f_MyType; } set { f_MyType = value; } }
TIA, mike
Never tried it. I would suggest trying it real quick with a PropertyGrid. If it doesn't work, it shouldn't be too tough to write a custom type converter for that. I'm guessing it won't work, but shouldn't take much to test that.
Try code model generation tools at BoneSoft.com.
-
I'm thinking ahead, and wonder if anyone knows how a Type property is handled by its designers/typeconverters (if any)? What I'm hoping is that the designers/typeconverters for a Type property will allow entering the String class name of the type, and translate that to an underlying type field, f_MyType:
protected internal Type f_MyType = null; // CAN WE INPUT THE String CLASS NAME TO THIS PROPERTY? public Type MyType { get { return f_MyType; } set { f_MyType = value; } }
TIA, mike
Actually, I'd be tempted to write a type converter and maybe a UITypeEditor implementation that shows possible types to choose from.
Try code model generation tools at BoneSoft.com.