Click here to Skip to main content
15,891,473 members
Home / Discussions / C#
   

C#

 
GeneralRe: urgent help needed, event handler Pin
mtrx2-Jun-03 3:41
mtrx2-Jun-03 3:41 
GeneralRe: urgent help needed, event handler Pin
shaunAustin3-Jun-03 1:25
shaunAustin3-Jun-03 1:25 
GeneralCustom Control Events Pin
Tym!1-Jun-03 12:05
Tym!1-Jun-03 12:05 
GeneralSome Progress, Sound good? Pin
Tym!1-Jun-03 13:23
Tym!1-Jun-03 13:23 
QuestionGDI+, How to stop antialias? Pin
FruitBatInShades31-May-03 23:51
FruitBatInShades31-May-03 23:51 
AnswerRe: GDI+, How to stop antialias? Pin
leppie1-Jun-03 0:07
leppie1-Jun-03 0:07 
GeneralRe: GDI+, How to stop antialias? Pin
FruitBatInShades1-Jun-03 0:44
FruitBatInShades1-Jun-03 0:44 
QuestionHow to extend System.Int32? Pin
ralfoide31-May-03 15:58
ralfoide31-May-03 15:58 
Hi!
I'd like to create an "id" class, i.e. a class which could hold any positive non-null integer, yet somehow semantically generated ids would be > 0, but 0 and -1 would have special meanings.
Basically something like that:
public class MyId: System.Int32
{
public const int kServer = 0;
public const int kBroadcast = -1;
}

Unfortunately that is not possible since System.Int32 is a struct and thus equivalent to a sealed class: I can't derive it.

Can anyone suggest another approach to this?

Maybe the class could just not derive from Int32 and just contain an Int32, generated to be unique from the constructor.

Thanks in advance, all ideas welcome.

R/
AnswerRe: How to extend System.Int32? Pin
Eric Gunnerson (msft)31-May-03 16:35
Eric Gunnerson (msft)31-May-03 16:35 
GeneralRe: How to extend System.Int32? Pin
ralfoide1-Jun-03 17:13
ralfoide1-Jun-03 17:13 
GeneralRe: How to extend System.Int32? Pin
ralfoide1-Jun-03 17:42
ralfoide1-Jun-03 17:42 
GeneralRe: How to extend System.Int32? Pin
leppie2-Jun-03 8:00
leppie2-Jun-03 8:00 
GeneralRe: How to extend System.Int32? Pin
Eric Gunnerson (msft)3-Jun-03 9:47
Eric Gunnerson (msft)3-Jun-03 9:47 
AnswerRe: How to extend System.Int32? Pin
leppie1-Jun-03 0:39
leppie1-Jun-03 0:39 
GeneralRe: How to extend System.Int32? Pin
David Stone2-Jun-03 9:50
sitebuilderDavid Stone2-Jun-03 9:50 
GeneralSetting Form's size problems Pin
Acidis31-May-03 11:38
Acidis31-May-03 11:38 
GeneralRe: Setting Form's size problems Pin
J. Dunlap31-May-03 11:42
J. Dunlap31-May-03 11:42 
GeneralRe: Setting Form's size problems Pin
Acidis31-May-03 11:47
Acidis31-May-03 11:47 
GeneralRe: Setting Form's size problems Pin
James T. Johnson31-May-03 18:06
James T. Johnson31-May-03 18:06 
GeneralRe: Setting Form's size problems Pin
Acidis31-May-03 19:36
Acidis31-May-03 19:36 
GeneralRe: Setting Form's size problems Pin
James T. Johnson31-May-03 19:59
James T. Johnson31-May-03 19:59 
GeneralMenue by Marc Clifton Pin
Frenchi31-May-03 9:46
Frenchi31-May-03 9:46 
GeneralRe: Menue by Marc Clifton Pin
Marc Clifton31-May-03 15:33
mvaMarc Clifton31-May-03 15:33 
GeneralRe: Menue by Marc Clifton Pin
Frenchi1-Jun-03 5:12
Frenchi1-Jun-03 5:12 
Questionto byte[] conversion? Pin
stonee7431-May-03 3:38
stonee7431-May-03 3:38 

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.