diff options
author | Andreas N <andreas@mono-cvs.ximian.com> | 2003-07-14 02:09:12 +0400 |
---|---|---|
committer | Andreas N <andreas@mono-cvs.ximian.com> | 2003-07-14 02:09:12 +0400 |
commit | 78dc7ab616ff9c86f63ba9eb79bccba9bad6d754 (patch) | |
tree | 9a5fe7b4ff9976378c0df1650441764c53945fb8 /mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs | |
parent | 5bc39e4713ae8656b8039516d71fb2ab66d258af (diff) |
2003-07-13 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* DiagnosticsConfigurationHandler.cs: Removed a never used variable
* EventLog.cs: Small update to prevent a warning
* EventLogPermission.cs: Implemented or implementation added
* EventLogPermissionAttribute.cs: Implemented or implementation added
* EventLogPermissionEntry.cs: Implemented or implementation added
* EventLogPermissionEntryCollection.cs: Implemented or implementation added
* EventLogTraceListener.cs: Implemented or implementation added
* PerformanceCounterManager.cs: Implemented or implementation added
* PerformanceCounterInstaller.cs: Made internal
* PerformanceCounterCategory.cs: Implemented few members
* PerformanceCounterPermission.cs: Implemented or implementation added
* PerformanceCounterPermissionAttribute.cs: Implemented or implementation added
* PerformanceCounterPermissionEntry.cs: Implemented or implementation added
* PerformanceCounterPermissionEntryCollection.cs: Implemented or implementation added
svn path=/trunk/mcs/; revision=16177
Diffstat (limited to 'mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs')
-rw-r--r-- | mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs b/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs index 17eb6ca9935..d6db335d9df 100644 --- a/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs +++ b/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs @@ -3,8 +3,10 @@ // // Authors: // Jonathan Pryor (jonpryor@vt.edu) +// Andreas Nahr (ClassDevelopment@A-SoftTech.com) // // (C) 2002 +// (C) 2003 Andreas Nahr // using System; @@ -12,36 +14,46 @@ using System.Diagnostics; using System.Security; using System.Security.Permissions; -namespace System.Diagnostics { +namespace System.Diagnostics +{ [AttributeUsage( AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Event)] [Serializable] - [MonoTODO("Just Stubbed Out")] - public class EventLogPermissionAttribute : CodeAccessSecurityAttribute { + public class EventLogPermissionAttribute : CodeAccessSecurityAttribute + { + private string machineName; + private EventLogPermissionAccess permissionAccess; public EventLogPermissionAttribute(SecurityAction action) : base(action) { + machineName = "."; + permissionAccess = EventLogPermissionAccess.Browse; + } + + // May throw ArgumentException if computer name is invalid + public string MachineName { + get {return machineName;} + set { + // TODO check machine name + machineName = value; + } + } + + public EventLogPermissionAccess PermissionAccess { + get {return permissionAccess;} + set {permissionAccess = value;} } -// // May throw ArgumentException if computer name is invalid -// public string MachineName { -// get {throw new NotImplementedException();} -// set {throw new NotImplementedException();} -// } -// -// public EventLogPermissionAccess PermissionAccess { -// get {throw new NotImplementedException();} -// set {throw new NotImplementedException();} -// } -// - [MonoTODO] public override IPermission CreatePermission() { - throw new NotImplementedException(); + if (base.Unrestricted) { + return new EventLogPermission (PermissionState.Unrestricted); + } + return new EventLogPermission (PermissionAccess, MachineName); } } } |