mscorlib(4.0.0.0) API with additions
PrivilegeNotHeldException.cs
3 
5 {
9  {
10  private readonly string _privilegeName;
11 
14  public string PrivilegeName => _privilegeName;
15 
18  : base(Environment.GetResourceString("PrivilegeNotHeld_Default"))
19  {
20  }
21 
24  public PrivilegeNotHeldException(string privilege)
25  : base(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("PrivilegeNotHeld_Named"), privilege))
26  {
27  _privilegeName = privilege;
28  }
29 
33  public PrivilegeNotHeldException(string privilege, Exception inner)
34  : base(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("PrivilegeNotHeld_Named"), privilege), inner)
35  {
36  _privilegeName = privilege;
37  }
38 
40  : base(info, context)
41  {
42  _privilegeName = info.GetString("PrivilegeName");
43  }
44 
48  [SecurityCritical]
49  public override void GetObjectData(SerializationInfo info, StreamingContext context)
50  {
51  if (info == null)
52  {
53  throw new ArgumentNullException("info");
54  }
55  base.GetObjectData(info, context);
56  info.AddValue("PrivilegeName", _privilegeName, typeof(string));
57  }
58  }
59 }
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
PrivilegeNotHeldException(string privilege)
Initializes a new instance of the T:System.Security.AccessControl.PrivilegeNotHeldException class by ...
Definition: __Canon.cs:3
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
string PrivilegeName
Gets the name of the privilege that is not enabled.
PrivilegeNotHeldException()
Initializes a new instance of the T:System.Security.AccessControl.PrivilegeNotHeldException class.
PrivilegeNotHeldException(string privilege, Exception inner)
Initializes a new instance of the T:System.Security.AccessControl.PrivilegeNotHeldException class by ...
override void GetObjectData(SerializationInfo info, StreamingContext context)
Sets the info parameter with information about the exception.
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
Allows an object to control its own serialization and deserialization.
Definition: ISerializable.cs:8
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Definition: Exception.cs:22
Specifies that the class can be serialized.
Compare strings using culture-sensitive sort rules and the current culture.
The exception that is thrown when the operating system denies access because of an I/O error or a spe...
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
The exception that is thrown when a method in the N:System.Security.AccessControl namespace attempts ...