mscorlib(4.0.0.0) API with additions
SystemSound.cs
3 using System.Security;
5 
6 namespace System.Media
7 {
9  [HostProtection(SecurityAction.LinkDemand, UI = true)]
10  public class SystemSound
11  {
12  private class SafeNativeMethods
13  {
14  private SafeNativeMethods()
15  {
16  }
17 
18  [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
19  internal static extern bool MessageBeep(int type);
20  }
21 
22  private int soundType;
23 
24  internal SystemSound(int soundType)
25  {
26  this.soundType = soundType;
27  }
28 
30  public void Play()
31  {
32  IntSecurity.UnmanagedCode.Assert();
33  try
34  {
35  SafeNativeMethods.MessageBeep(soundType);
36  }
37  finally
38  {
40  }
41  }
42  }
43 }
Definition: __Canon.cs:3
void Play()
Plays the system sound type.
Definition: SystemSound.cs:30
Represents a system sound type.
Definition: SystemSound.cs:10
SecurityAction
Specifies the security actions that can be performed using declarative security.
Defines the underlying structure of all code access permissions.
CharSet
Dictates which character set marshaled strings should use.
Definition: CharSet.cs:7
static void RevertAssert()
Causes any previous M:System.Security.CodeAccessPermission.Assert for the current frame to be removed...