Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
GeneralAdding a Class Library Pin
gmhanna28-Sep-03 8:32
gmhanna28-Sep-03 8:32 
GeneralRe: Adding a Class Library Pin
Daniel M. Edwards28-Sep-03 9:27
Daniel M. Edwards28-Sep-03 9:27 
GeneralRe: Adding a Class Library Pin
gmhanna28-Sep-03 10:08
gmhanna28-Sep-03 10:08 
GeneralRe: Adding a Class Library Pin
Tomas Petricek28-Sep-03 10:27
Tomas Petricek28-Sep-03 10:27 
QuestionHow to get the color of a Pixel? Pin
Leon van Wyk28-Sep-03 4:28
professionalLeon van Wyk28-Sep-03 4:28 
AnswerRe: How to get the color of a Pixel? Pin
Anonymous28-Sep-03 18:49
Anonymous28-Sep-03 18:49 
GeneralStructures and Unions Pin
gmhanna28-Sep-03 3:59
gmhanna28-Sep-03 3:59 
GeneralRe: Structures and Unions Pin
Bo Hunter28-Sep-03 7:46
Bo Hunter28-Sep-03 7:46 
Here is a C style union in Csharp.
Out of the best Book I have read so far for .Net.
Essential .Net Volume 1.

[StructLayout( LayoutKind.Explicit )]
public struct Number
{
	private enum NumType
	{
		Double,
		Int64
	}

	[FieldOffset( 0 )]
	double dblValue;
	[FieldOffset( 0 )]
	long lngValue;
        [FieldOffset( 8 )]
	NumType type;

        public void Set( double value )
	{
		type = NumType.Double;
		dblValue = value;
	}
	public void Set( long value )
	{
		type = NumType.Int64;
		lngValue = value;
	}

	public double GetDouble()
	{
		if ( type == NumType.Double )
		{
			return dblValue;
		}
		return (double)lngValue;
	}
	public long GetLong()
	{
		if ( type == NumType.Int64 )
		{
			return lngValue;
		}
		return (long)dblValue;
	}
}


Thank You
Bo Hunter
GeneralRe: Structures and Unions Pin
jparsons28-Sep-03 15:38
jparsons28-Sep-03 15:38 
QuestionHow to implement "card view" similar to the Contact of Outlook Pin
Member 18476327-Sep-03 21:29
Member 18476327-Sep-03 21:29 
AnswerRe: How to implement "card view" similar to the Contact of Outlook Pin
Anonymous28-Sep-03 18:56
Anonymous28-Sep-03 18:56 
GeneralAbt C# message handlers Pin
Priyesh27-Sep-03 20:15
Priyesh27-Sep-03 20:15 
GeneralRe: Abt C# message handlers Pin
leppie28-Sep-03 1:08
leppie28-Sep-03 1:08 
GeneralRe: Abt C# message handlers Pin
Anonymous28-Sep-03 5:29
Anonymous28-Sep-03 5:29 
Generallinkbuttons and web spiders Pin
Member 52585827-Sep-03 19:19
Member 52585827-Sep-03 19:19 
GeneralRe: linkbuttons and web spiders Pin
leppie28-Sep-03 0:51
leppie28-Sep-03 0:51 
QuestionQuestion abount Socket Communication? Pin
JiangHaiLong27-Sep-03 19:12
JiangHaiLong27-Sep-03 19:12 
AnswerRe: Question abount Socket Communication? Pin
Corinna John29-Sep-03 2:33
Corinna John29-Sep-03 2:33 
QuestionHOW Can Run The SQLAGENT WITH Programe? Pin
meetweb27-Sep-03 15:23
meetweb27-Sep-03 15:23 
GeneralStrings in C# Pin
gmhanna27-Sep-03 15:15
gmhanna27-Sep-03 15:15 
GeneralRe: Strings in C# Pin
gmhanna27-Sep-03 15:18
gmhanna27-Sep-03 15:18 
GeneralRe: Strings in C# Pin
J. Dunlap27-Sep-03 15:48
J. Dunlap27-Sep-03 15:48 
GeneralRe: Strings in C# Pin
Daniel M. Edwards27-Sep-03 18:50
Daniel M. Edwards27-Sep-03 18:50 
GeneralRe: Strings in C# Pin
Bo Hunter28-Sep-03 7:32
Bo Hunter28-Sep-03 7:32 
GeneralRe: Strings in C# Pin
Daniel M. Edwards28-Sep-03 8:23
Daniel M. Edwards28-Sep-03 8:23 

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.