TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ken Shen
NA
5
1.6k
Conditional Attribute question
Apr 20 2012 7:12 PM
I want to make attribute of some fields conditional, as below:
enum AttrType
{
Type1,
Type2
}
public class Shape
{
[MyAttribute(AttrType.Type1)]
mArea;
}
public class Circle:Shape
{
[Make it AttrType.Type2]
mArea;
[Make it AttrType.Type1]
mRadius;
}
If it is base class A, and mRadius is not defined, I want mArea has AttrType.Type1. If it is in derived class B, and mRadius is defined, I want mArea has AttrType.Type2 and mRadius has AttrType.Type1
How to make it work?
Thanks,
Reply
Answers (
5
)
Consuming webservice
Delegates