Click here to Skip to main content
15,914,452 members
Home / Discussions / C#
   

C#

 
AnswerDon't repost Pin
Keith Barrow30-Oct-10 10:23
professionalKeith Barrow30-Oct-10 10:23 
GeneralRe: Don't repost Pin
inayathussaintoori31-Oct-10 1:07
inayathussaintoori31-Oct-10 1:07 
GeneralRe: Don't repost Pin
Keith Barrow31-Oct-10 2:13
professionalKeith Barrow31-Oct-10 2:13 
AnswerRe: problem related to "Nural networks face detection algprithm" Pin
Keith Barrow31-Oct-10 2:21
professionalKeith Barrow31-Oct-10 2:21 
GeneralRe: problem related to "Nural networks face detection algprithm" Pin
inayathussaintoori1-Nov-10 11:43
inayathussaintoori1-Nov-10 11:43 
GeneralRe: problem related to "Nural networks face detection algprithm" Pin
Wes Aday2-Nov-10 4:17
professionalWes Aday2-Nov-10 4:17 
GeneralRe: problem related to "Nural networks face detection algprithm" Pin
Keith Barrow2-Nov-10 9:52
professionalKeith Barrow2-Nov-10 9:52 
QuestionAny ideas on how to do this? Pin
SledgeHammer0129-Oct-10 6:43
SledgeHammer0129-Oct-10 6:43 
I have a dialog where I need to return a result. The result can be either a "standard class defined value" (an enum) or a user defined value (an int).

So I end up with something like:

enum SomeEnum
{
Val1 = 1,
Val2 = 2,
Val3 = 4,
Custom = 8
}

public SomeEnum Result
{
get
{
...
}
}

public int UserResult
{
get
{
...
}
}


The idea here is that if Result is Custom, they call UserResult to get the custom value. I'm not really keen on that idea because they have to look at 2 properties.

I could cast Result to an int and return it that way, but that idea, I'm not really happy with either because they'll be using the built in values 75% of the time, so having the code littered with casts isn't that great.

I could return (or accept) both as object, but that'd be a lot of "if (Result is ...)" checks.

On the drive in to work, I thought about having the user derive an enum from the built in enum and extend it, but apperently C# doesn't allow that Smile | :) .

Any other ideas?
AnswerRe: Any ideas on how to do this? Pin
Ian Shlasko29-Oct-10 7:02
Ian Shlasko29-Oct-10 7:02 
GeneralRe: Any ideas on how to do this? Pin
SledgeHammer0129-Oct-10 7:32
SledgeHammer0129-Oct-10 7:32 
AnswerRe: Any ideas on how to do this? Pin
phil.o29-Oct-10 7:19
professionalphil.o29-Oct-10 7:19 
AnswerRe: Any ideas on how to do this? Pin
Luc Pattyn29-Oct-10 7:32
sitebuilderLuc Pattyn29-Oct-10 7:32 
GeneralRe: Any ideas on how to do this? Pin
SledgeHammer0129-Oct-10 7:39
SledgeHammer0129-Oct-10 7:39 
AnswerRe: Any ideas on how to do this? Pin
Not Active29-Oct-10 8:47
mentorNot Active29-Oct-10 8:47 
AnswerRe: Any ideas on how to do this? Pin
#realJSOP29-Oct-10 9:54
professional#realJSOP29-Oct-10 9:54 
AnswerRe: Any ideas on how to do this? Pin
PIEBALDconsult29-Oct-10 15:56
mvePIEBALDconsult29-Oct-10 15:56 
QuestionJust A Thought - Interface = I, Abstract = A Pin
Jammer29-Oct-10 4:10
Jammer29-Oct-10 4:10 
AnswerRe: Just A Thought - Interface = I, Abstract = A Pin
J4amieC29-Oct-10 4:16
J4amieC29-Oct-10 4:16 
GeneralRe: Just A Thought - Interface = I, Abstract = A Pin
Ennis Ray Lynch, Jr.29-Oct-10 8:15
Ennis Ray Lynch, Jr.29-Oct-10 8:15 
AnswerRe: Just A Thought - Interface = I, Abstract = A Pin
_Erik_29-Oct-10 4:21
_Erik_29-Oct-10 4:21 
AnswerRe: Just A Thought - Interface = I, Abstract = A Pin
T M Gray29-Oct-10 10:39
T M Gray29-Oct-10 10:39 
GeneralRe: Just A Thought - Interface = I, Abstract = A Pin
Pete O'Hanlon29-Oct-10 11:04
mvePete O'Hanlon29-Oct-10 11:04 
AnswerRe: Just A Thought - Interface = I, Abstract = A Pin
PIEBALDconsult29-Oct-10 18:05
mvePIEBALDconsult29-Oct-10 18:05 
AnswerRe: Just A Thought - Interface = I, Abstract = A Pin
Abhinav S30-Oct-10 18:19
Abhinav S30-Oct-10 18:19 
GeneralRe: Just A Thought - Interface = I, Abstract = A Pin
thatraja1-Nov-10 21:18
professionalthatraja1-Nov-10 21:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.