mscorlib(4.0.0.0) API with additions
EventLogPermissionEntry.cs
3 
4 namespace System.Diagnostics
5 {
9  {
10  private string machineName;
11 
12  private EventLogPermissionAccess permissionAccess;
13 
16  public string MachineName => machineName;
17 
20  public EventLogPermissionAccess PermissionAccess => permissionAccess;
21 
26  public EventLogPermissionEntry(EventLogPermissionAccess permissionAccess, string machineName)
27  {
28  if (!SyntaxCheck.CheckMachineName(machineName))
29  {
30  throw new ArgumentException(SR.GetString("InvalidParameter", "MachineName", machineName));
31  }
32  this.permissionAccess = permissionAccess;
33  this.machineName = machineName;
34  }
35 
37  {
38  permissionAccess = (EventLogPermissionAccess)baseEntry.PermissionAccess;
39  machineName = baseEntry.PermissionAccessPath[0];
40  }
41 
42  internal ResourcePermissionBaseEntry GetBaseEntry()
43  {
44  return new ResourcePermissionBaseEntry((int)PermissionAccess, new string[1]
45  {
47  });
48  }
49  }
50 }
EventLogPermissionAccess PermissionAccess
Gets the permission access levels used in the permissions request.
EventLogPermissionEntry(EventLogPermissionAccess permissionAccess, string machineName)
Initializes a new instance of the T:System.Diagnostics.EventLogPermissionEntry class.
Definition: __Canon.cs:3
EventLogPermissionAccess
Defines access levels used by T:System.Diagnostics.EventLog permission classes.
int PermissionAccess
Gets an integer representation of the access level enumeration value.
string MachineName
Gets the name of the computer on which to read or write events.
The exception that is thrown when one of the arguments provided to a method is not valid.
static bool CheckMachineName(string value)
Checks the syntax of the machine name to confirm that it does not contain "\".
Definition: SyntaxCheck.cs:14
Defines the smallest unit of a code access security permission set.
Specifies that the class can be serialized.
Defines the smallest unit of a code access security permission that is set for an T:System....
string [] PermissionAccessPath
Gets an array of strings that identify the resource you are protecting.
Provides methods to verify the machine name and path conform to a specific syntax....
Definition: SyntaxCheck.cs:8