design mapping question

  • Thread starter Thread starter csharpula csharp
  • Start date Start date
C

csharpula csharp

Hello,

I would like to know what is the best solution for the following
situation :

I have a class which contains these boolean members:

HasSort1Property
HasSort2Property
HasSort3Property
......
....
etc..

In some other place I am calling a function with (SortType Sort2) for
example so I need some kind of mapping between the HasSort1Property
boolean and the Sort1. How can I do it?
I thought about an enum but it seems like complex solution and I am not
sure how. Can someone please help?

Thanks a lot!!
 
In this case, it would seem that you want to use Reflection in order to
get the parameter names and compare them to the members exposed by your
class. However, how you map is up to you, since it seems that they are not
perfect matches, and you will have to figure out how to resolve them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top