I am creating a generic Windows Form that accepts T and uses reflection with custom attributes to create labels and input controls at runtime.
Example:
class GenericForm<T>: Form where T : ICloneable<T> { }
Here is a link to the previous question for the form code: SO question .
This form can take the following entity class as an example:
class Vehicle: ICloneable<Vehicle> { public int Id { get; set; } public int Name { get; set; } public int Description { get; set; } }
As you could imagine, the magic behind the form will use reflection to determine data types, validation criteria, preferred control types to use, etc.
Instead of reinventing the wheel, I thought it would be worth asking about this if anyone knows about such frameworks. Needless to say, I'm looking for something simple, not a bulky structure.
generics reflection c # winforms
Raheel khan
source share