How do i use a static class' property at design time

  • Thread starter Thread starter TS
  • Start date Start date
T

TS

i want to store my regular expressions in a static class with public
constants. I want to be able to pass a regular expression's id in a property
of a custom textbox so that in aspx page i could just set the expressionId
property and be done with it. i am trying to write as little code in code
behind as possible.

if this scenario, since i can't just use a singleproperty
"ClassName.PropertyName" since c# doesnt' have a stand alone Eval statement,
i could also have a property: regExClass that would default to a particular
one, which would be used to instantiate the class and then use the
expressionID property to access the correct property to set the reg ex.

does anyone have a better solution.

thanks
 
in your textbox make a enum property that sets the resource id. then the
designer will support it.

-- bruce (sqlwork.com)
 
Hi TS,

As bruce suggested, if you're using an enum, the designer should support it
and you can easily choose one from the all available enum values; later you
can use the enum value to determine which regular expression to use.

Please feel free to let us know if there's anything unclear or we've
misunderstood anything.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
i have created an enum as a property; of the textbox but I don't have
designer support for it.

also, what do you mean "sets the resource id"
 
Back
Top