EventLogPermission.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Services / Monitoring / system / Diagnosticts / EventLogPermission.cs / 1 / EventLogPermission.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Diagnostics { 
    using System; 
    using System.Security.Permissions;
 
    /// 
    ///    [To be supplied.]
    /// 
    [ 
    Serializable()
    ] 
    public sealed class EventLogPermission : ResourcePermissionBase { 
        private EventLogPermissionEntryCollection innerCollection;
 
        /// 
        ///    [To be supplied.]
        /// 
        public EventLogPermission() { 
            SetNames();
        } 
 
        /// 
        ///    [To be supplied.] 
        /// 
        public EventLogPermission(PermissionState state)
        : base(state) {
            SetNames(); 
        }
 
        ///  
        ///    [To be supplied.]
        ///  
        public EventLogPermission(EventLogPermissionAccess permissionAccess, string machineName) {
            SetNames();
            this.AddPermissionAccess(new EventLogPermissionEntry(permissionAccess, machineName));
        } 

        ///  
        ///    [To be supplied.] 
        /// 
        public EventLogPermission(EventLogPermissionEntry[] permissionAccessEntries) { 
            if (permissionAccessEntries == null)
                throw new ArgumentNullException("permissionAccessEntries");

            SetNames(); 
            for (int index = 0; index < permissionAccessEntries.Length; ++index)
                this.AddPermissionAccess(permissionAccessEntries[index]); 
        } 

        ///  
        ///    [To be supplied.]
        /// 
        public EventLogPermissionEntryCollection PermissionEntries {
            get { 
                if (this.innerCollection == null)
                    this.innerCollection = new EventLogPermissionEntryCollection(this, base.GetPermissionEntries()); 
 
                return this.innerCollection;
            } 
        }

        ///
        internal void AddPermissionAccess(EventLogPermissionEntry entry) { 
            base.AddPermissionAccess(entry.GetBaseEntry());
        } 
 
        ///
        internal new void Clear() { 
            base.Clear();
        }

        /// 
        internal void RemovePermissionAccess(EventLogPermissionEntry entry) {
            base.RemovePermissionAccess(entry.GetBaseEntry()); 
        } 

        private void SetNames() { 
            this.PermissionAccessType = typeof(EventLogPermissionAccess);
            this.TagNames = new string[]{"Machine"};
        }
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Diagnostics { 
    using System; 
    using System.Security.Permissions;
 
    /// 
    ///    [To be supplied.]
    /// 
    [ 
    Serializable()
    ] 
    public sealed class EventLogPermission : ResourcePermissionBase { 
        private EventLogPermissionEntryCollection innerCollection;
 
        /// 
        ///    [To be supplied.]
        /// 
        public EventLogPermission() { 
            SetNames();
        } 
 
        /// 
        ///    [To be supplied.] 
        /// 
        public EventLogPermission(PermissionState state)
        : base(state) {
            SetNames(); 
        }
 
        ///  
        ///    [To be supplied.]
        ///  
        public EventLogPermission(EventLogPermissionAccess permissionAccess, string machineName) {
            SetNames();
            this.AddPermissionAccess(new EventLogPermissionEntry(permissionAccess, machineName));
        } 

        ///  
        ///    [To be supplied.] 
        /// 
        public EventLogPermission(EventLogPermissionEntry[] permissionAccessEntries) { 
            if (permissionAccessEntries == null)
                throw new ArgumentNullException("permissionAccessEntries");

            SetNames(); 
            for (int index = 0; index < permissionAccessEntries.Length; ++index)
                this.AddPermissionAccess(permissionAccessEntries[index]); 
        } 

        ///  
        ///    [To be supplied.]
        /// 
        public EventLogPermissionEntryCollection PermissionEntries {
            get { 
                if (this.innerCollection == null)
                    this.innerCollection = new EventLogPermissionEntryCollection(this, base.GetPermissionEntries()); 
 
                return this.innerCollection;
            } 
        }

        ///
        internal void AddPermissionAccess(EventLogPermissionEntry entry) { 
            base.AddPermissionAccess(entry.GetBaseEntry());
        } 
 
        ///
        internal new void Clear() { 
            base.Clear();
        }

        /// 
        internal void RemovePermissionAccess(EventLogPermissionEntry entry) {
            base.RemovePermissionAccess(entry.GetBaseEntry()); 
        } 

        private void SetNames() { 
            this.PermissionAccessType = typeof(EventLogPermissionAccess);
            this.TagNames = new string[]{"Machine"};
        }
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK