G
garyusenet
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-
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-