473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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

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
Jul 2 '07 #1
4 1220
in your textbox make a enum property that sets the resource id. then the
designer will support it.

-- bruce (sqlwork.com)

TS wrote:
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

Jul 2 '07 #2
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 (wa****@online.microsoft.com, 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.

Jul 3 '07 #3
TS
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"

"bruce barker" <no****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
in your textbox make a enum property that sets the resource id. then the
designer will support it.

-- bruce (sqlwork.com)

TS wrote:
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

Jul 3 '07 #4
TS
OK, it works now, maybe it just needed to be run once

"TS" <ma**********@nospam.nospamwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
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"

"bruce barker" <no****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
in your textbox make a enum property that sets the resource id. then the
designer will support it.

-- bruce (sqlwork.com)

TS wrote:
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
>
>


Jul 3 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Chris Capel | last post by:
What is the rationale behind the decision not to allow abstract static class members? It doesn't seem like it's a logically contradictory concept, or that the implementation would be difficult or...
12
by: Sergey Klementiev | last post by:
Why it's impossible to have a static indexer in C#?
3
by: Erik Harris | last post by:
I apologize if this is a stupid question - I'm relatively new to OOP. I have a property that must exist in a class in order to be used by another class. The property, however, does not change with...
5
by: Ren? Paw Christensen | last post by:
Hi. Considering the following code, I want this call: Something.Method(); To return "Something". public class BaseClass { public static string Method() {
3
by: Kirk Marple | last post by:
Just want to see if this is 'by design' or a bug... I have a common List<T> defined in a base class, and the base class has a static property to expose this list. I wanted the derived class to...
3
by: bauscharln | last post by:
hoi, I just wanted to add a static method to my interface, but that's not allowed! Is there a reason for this??? (Yes, I could make an abstract base class, but that's not what I want, since I...
9
by: Laban | last post by:
Hi, I find myself using static methods more than I probably should, so I am looking for some advice on a better approach. For example, I am writing an app that involves quite a bit of database...
9
by: David A. Osborn | last post by:
I have a set of classes that each have an enumeration in them, and based on dynamic input I need to access a different enumeration. For example Three classes Class_A, Class_B, and Class_C that...
11
by: Kevin Prichard | last post by:
Hi all, I've recently been following the object-oriented techiques discussed here and have been testing them for use in a web application. There is problem that I'd like to discuss with you...
10
by: John A Grandy | last post by:
Say I have Class1 which contains static Class2 var1 = new Class2(); Is Class2 constructor code only executed if var1 is referenced in the code-execution path ? Or is Class2 constructor code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.