mscorlib(4.0.0.0) API with additions
EventLogPermissionEntryCollection.cs
1 using System.Collections;
3 
4 namespace System.Diagnostics
5 {
9  {
10  private EventLogPermission owner;
11 
15  public EventLogPermissionEntry this[int index]
16  {
17  get
18  {
19  return (EventLogPermissionEntry)base.List[index];
20  }
21  set
22  {
23  base.List[index] = value;
24  }
25  }
26 
28  {
29  this.owner = owner;
30  for (int i = 0; i < entries.Length; i++)
31  {
32  base.InnerList.Add(new EventLogPermissionEntry(entries[i]));
33  }
34  }
35 
39  public int Add(EventLogPermissionEntry value)
40  {
41  return base.List.Add(value);
42  }
43 
48  public void AddRange(EventLogPermissionEntry[] value)
49  {
50  if (value == null)
51  {
52  throw new ArgumentNullException("value");
53  }
54  for (int i = 0; i < value.Length; i++)
55  {
56  Add(value[i]);
57  }
58  }
59 
65  {
66  if (value == null)
67  {
68  throw new ArgumentNullException("value");
69  }
70  int count = value.Count;
71  for (int i = 0; i < count; i++)
72  {
73  Add(value[i]);
74  }
75  }
76 
81  public bool Contains(EventLogPermissionEntry value)
82  {
83  return base.List.Contains(value);
84  }
85 
89  public void CopyTo(EventLogPermissionEntry[] array, int index)
90  {
91  base.List.CopyTo(array, index);
92  }
93 
97  public int IndexOf(EventLogPermissionEntry value)
98  {
99  return base.List.IndexOf(value);
100  }
101 
105  public void Insert(int index, EventLogPermissionEntry value)
106  {
107  base.List.Insert(index, value);
108  }
109 
112  public void Remove(EventLogPermissionEntry value)
113  {
114  base.List.Remove(value);
115  }
116 
118  protected override void OnClear()
119  {
120  owner.Clear();
121  }
122 
126  protected override void OnInsert(int index, object value)
127  {
128  owner.AddPermissionAccess((EventLogPermissionEntry)value);
129  }
130 
134  protected override void OnRemove(int index, object value)
135  {
136  owner.RemovePermissionAccess((EventLogPermissionEntry)value);
137  }
138 
143  protected override void OnSet(int index, object oldValue, object newValue)
144  {
145  owner.RemovePermissionAccess((EventLogPermissionEntry)oldValue);
146  owner.AddPermissionAccess((EventLogPermissionEntry)newValue);
147  }
148  }
149 }
void Remove(EventLogPermissionEntry value)
Removes a specified permission entry from this collection.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
bool Contains(EventLogPermissionEntry value)
Determines whether this collection contains a specified T:System.Diagnostics.EventLogPermissionEntry.
Provides the abstract base class for a strongly typed collection.
int IndexOf(EventLogPermissionEntry value)
Determines the index of a specified permission entry in this collection.
Definition: __Canon.cs:3
void AddRange(EventLogPermissionEntryCollection value)
Appends a set of specified permission entries to this collection.
void Insert(int index, EventLogPermissionEntry value)
Inserts a permission entry into this collection at a specified index.
override void OnRemove(int index, object value)
Performs additional custom processes when removing a new permission entry from the collection.
int Add(EventLogPermissionEntry value)
Adds a specified T:System.Diagnostics.EventLogPermissionEntry to this collection.
override void OnClear()
Performs additional custom processes after clearing the contents of the collection.
override void OnInsert(int index, object value)
Performs additional custom processes before a new permission entry is inserted into the collection.
Controls code access permissions for event logging.
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....
Contains a strongly typed collection of T:System.Diagnostics.EventLogPermissionEntry objects.
void AddRange(EventLogPermissionEntry[] value)
Appends a set of specified permission entries to this collection.
override void OnSet(int index, object oldValue, object newValue)
Performs additional custom processes before setting a value in the collection.
void CopyTo(EventLogPermissionEntry[] array, int index)
Copies the permission entries from this collection to an array, starting at a particular index of the...