W
Wing Siu
Dear All
I would like to develop a generic class sorting function.
Currently, when I need sort a collection of user class, for example: Person,
Exhibition, Country
I need implement a comparer class for each user class, for example:
PersonComparer, ExhibitionComparer, CountryComparer
Is that any solution that allow me sort different class by using the same
comparer and use different attribute of the user class?
for exhibition
For my idea something like follow
void VisualComparer(Collection items, TypeOf class, string sortProperty)
When I call this function
VisualComparer(Persons, typeOf(Person), "name");
Then this function will basic on Person.Name property to perform sorting
Thanks
I would like to develop a generic class sorting function.
Currently, when I need sort a collection of user class, for example: Person,
Exhibition, Country
I need implement a comparer class for each user class, for example:
PersonComparer, ExhibitionComparer, CountryComparer
Is that any solution that allow me sort different class by using the same
comparer and use different attribute of the user class?
for exhibition
For my idea something like follow
void VisualComparer(Collection items, TypeOf class, string sortProperty)
When I call this function
VisualComparer(Persons, typeOf(Person), "name");
Then this function will basic on Person.Name property to perform sorting
Thanks