Click here to Skip to main content
15,921,577 members
Home / Discussions / C#
   

C#

 
QuestionAny ideas on how to do this? Pin
SledgeHammer0129-Oct-10 6:43
SledgeHammer0129-Oct-10 6:43 
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 
C#
public SomeEnum GetResult(int x)
{
    return IntToEnum(x, SomeValue.Val1);
}

public int GetResult(SomeEnum x)
{
    return (int)x;
}

public static T IntToEnum<T>(int value, T defaultValue)
{
    T enumValue = (Enum.IsDefined(typeof(T), value)) ? (T)(object)value : defaultValue;    
    return enumValue;
}

.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

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 PinPopular
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 
QuestionSending parameters to an appilcation if it is open. Pin
TheFoZ29-Oct-10 2:53
TheFoZ29-Oct-10 2:53 
QuestionKeys and Disabling Pin
SRJ9229-Oct-10 2:11
SRJ9229-Oct-10 2:11 
AnswerRe: Keys and Disabling Pin
OriginalGriff29-Oct-10 2:18
mveOriginalGriff29-Oct-10 2:18 
AnswerRe: Keys and Disabling Pin
Sherylee29-Oct-10 2:30
Sherylee29-Oct-10 2:30 
AnswerRe: Keys and Disabling Pin
Ian Shlasko29-Oct-10 3:21
Ian Shlasko29-Oct-10 3:21 
AnswerRe: Keys and Disabling Pin
SRJ9229-Oct-10 4:55
SRJ9229-Oct-10 4:55 
QuestionCrystal Report Formating Pin
Nikhil Bhivgade28-Oct-10 23:39
professionalNikhil Bhivgade28-Oct-10 23:39 

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.