473,406 Members | 2,336 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,406 software developers and data experts.

Property and Enum

Hello,

How do I make a class's property to accept only pre-defined values as
it would be an enum?

Or maybe the enum can be exposed as a property?

Thanks,

Miguel

Nov 27 '06 #1
1 1035
public class Users
{
private UserStatus _status;
public UserStatus Status { get {return _status;} set {_status =
value;} }

}

public Enum UserStatus
{
Unknown = 0,
Pending = 1,
Banned = 2,
Ok 3,
}

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"shapper" <md*****@gmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
Hello,

How do I make a class's property to accept only pre-defined values as
it would be an enum?

Or maybe the enum can be exposed as a property?

Thanks,

Miguel
Nov 27 '06 #2

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

Similar topics

2
by: Russell Mangel | last post by:
I am trying to create a property which returns an enum. The following class does not work, can someone fix it? I am using VS2003 C++ public __gc class Drive { public: Drive(){} __property...
2
by: Russell Mangel | last post by:
I am trying to create a property which returns an enum. The following class does not work, can someone fix it? I am using VS2003 C++ public __gc class Drive { public: Drive(){} __property...
5
by: Alex Stevens | last post by:
Hi All, In the absence of any predefined standards, I was wondering how to name and implement my enum in a class. My dilema is: When I (for example) have an integer property in my class...
16
by: David Gacek | last post by:
Anyone know how to ... make a user control property that shows up in the property pages and allows one to select a value from a set of values ? like a combobox for example ?
3
by: Arnold Schrijver | last post by:
I wrote a program that draws items to the screen and maintains a set of Offset values. There was a bug in the code, because objects were positioned wrongly. While debugging I found some peculiar...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.