Is Class Synonymous with Type?



I'm using an example piece of code: -
namespace Wintellect.Interop.Sound{
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;

sealed class Sound{
public static void MessageBeep(BeepTypes type){
if(!MessageBeep((UInt32) type)){
Int32 err = Marshal.GetLastWin32Error();
throw new Win32Exception(err);
}
}

[DllImport("User32.dll", SetLastError=true)]
static extern Boolean MessageBeep(UInt32 beepType);

private Sound(){}
}

enum BeepTypes{
Simple = -1,
Ok = 0x00000000,
IconHand = 0x00000010,
IconQuestion = 0x00000020,
IconExclamation = 0x00000030,
IconAsterisk = 0x00000040
}
}


In the right up one part of explanation states. "Starting from the top,
you will notice that an entire type named Sound is devoted to
MessageBeep. If I need to add support for playing waves using the
Windows API function PlaySound, I could reuse the Sound type. However,
I am not offended by a type that exposes a single public static method.
"

Now i thought a type was a classifcation of variable, and a Class was a
blueprint for a real world thing. Can you tell me am i confusing two
meanings of type here?

or does type simply mean the same thing as class?

Thanks,

Gary-

.



Relevant Pages

  • Re: Is Class Synonymous with Type?
    ... public static void MessageBeep{ ... Int32 err = Marshal.GetLastWin32Error; ... enum BeepTypes{ ... you will notice that an entire type named Sound is devoted to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: PlaySound does nt always play the sound file
    ... you've tested on and whether this only fails with your sound or with every ... I use the below code to play a wave file continously on a windows ... public extern static int WCE_PlaySound(string szSound, IntPtr hMod, int ... public static void StopPlaySound ...
    (microsoft.public.dotnet.framework.compactframework)

Loading