Click here to Skip to main content
15,907,225 members
Home / Discussions / C#
   

C#

 
AnswerRe: time Pin
Christian Graus31-Aug-08 13:04
protectorChristian Graus31-Aug-08 13:04 
GeneralRe: time Pin
Harvey Saayman31-Aug-08 20:45
Harvey Saayman31-Aug-08 20:45 
GeneralRe: time Pin
Roger Alsing31-Aug-08 22:00
Roger Alsing31-Aug-08 22:00 
GeneralRe: time Pin
Mark Churchill31-Aug-08 22:09
Mark Churchill31-Aug-08 22:09 
GeneralRe: time Pin
Kevin Marois2-Sep-08 7:23
professionalKevin Marois2-Sep-08 7:23 
AnswerGet out of programming... Pin
leckey31-Aug-08 15:34
leckey31-Aug-08 15:34 
QuestionMDI Form Menu problem in C# windows application Pin
fqn31-Aug-08 9:26
fqn31-Aug-08 9:26 
AnswerRe: MDI Form Menu problem in C# windows application Pin
Wendelius31-Aug-08 9:38
mentorWendelius31-Aug-08 9:38 
QuestionSplitting a list into seperate threads. Pin
Buckleyindahouse31-Aug-08 9:08
Buckleyindahouse31-Aug-08 9:08 
QuestionRe: Splitting a list into seperate threads. Pin
Mark Salsbery31-Aug-08 9:49
Mark Salsbery31-Aug-08 9:49 
AnswerRe: Splitting a list into seperate threads. Pin
Buckleyindahouse31-Aug-08 17:58
Buckleyindahouse31-Aug-08 17:58 
AnswerRe: Splitting a list into seperate threads. Pin
Guffa31-Aug-08 10:30
Guffa31-Aug-08 10:30 
QuestionMDI App, MenuStrip and Icon Pin
paas31-Aug-08 6:25
paas31-Aug-08 6:25 
AnswerRe: MDI App, MenuStrip and Icon Pin
paas1-Sep-08 4:39
paas1-Sep-08 4:39 
QuestionRefresh DataGridView on BindingSource revert Pin
AndrusM31-Aug-08 6:21
AndrusM31-Aug-08 6:21 
QuestionCalling an embedded unmanaged dll Pin
jamie55031-Aug-08 2:33
jamie55031-Aug-08 2:33 
QuestionGeneric Printer class Pin
Silvyster31-Aug-08 1:47
Silvyster31-Aug-08 1:47 
QuestionProblem referencing class library in a web service Pin
dlarkin7731-Aug-08 0:54
dlarkin7731-Aug-08 0:54 
AnswerRe: Problem referencing class library in a web service Pin
#realJSOP31-Aug-08 1:11
professional#realJSOP31-Aug-08 1:11 
GeneralRe: Problem referencing class library in a web service Pin
dlarkin7731-Aug-08 2:07
dlarkin7731-Aug-08 2:07 
GeneralRe: Problem referencing class library in a web service Pin
#realJSOP31-Aug-08 2:20
professional#realJSOP31-Aug-08 2:20 
As to your problem, the only thing I can think of is that you may have to convert the enum to an int, return the int to the calling application, and let the calling app convert it back to a Product enum. Here's a function I use to go back to an enum from an integer value. It ensures that enum "value" exists within the specified enum type, thereby never returning an invalid enum value.


//--------------------------------------------------------------------------------
/// <summary>
/// Casts the specified integer to an appropriate enumerated value of the specified 
/// enum type. If all else fails, the enum will be returned as the specified default 
/// ordinal.
/// </summary>
/// <param name="value">The integer value representing an enumeration element
/// <param name="deafaultValue">The default enum value to be used if the specified 
/// "value" does not exist in the enumeration definition
/// <returns>The appropriate enum of the specified enum type</returns>
public static T IntToEnum<t>(int value, T defaultValue)
{
	T enumValue = (Enum.IsDefined(typeof(T), value)) ? (T)(object)value : defaultValue;
	return enumValue;
}
</t>


The formatting thing is a site bug.


"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." - Jason Jystad, 10/26/2001


GeneralRe: Problem referencing class library in a web service Pin
dlarkin7731-Aug-08 3:02
dlarkin7731-Aug-08 3:02 
GeneralRe: Problem referencing class library in a web service Pin
#realJSOP31-Aug-08 3:33
professional#realJSOP31-Aug-08 3:33 
GeneralRe: Problem referencing class library in a web service Pin
dlarkin7731-Aug-08 3:37
dlarkin7731-Aug-08 3:37 
AnswerRe: Problem referencing class library in a web service Pin
Wendelius31-Aug-08 7:02
mentorWendelius31-Aug-08 7:02 

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.