PerformanceCounterPermission.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Services / Monitoring / system / Diagnosticts / PerformanceCounterPermission.cs / 1 / PerformanceCounterPermission.cs

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

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

        ///  
        ///    [To be supplied.] 
        /// 
        public PerformanceCounterPermission(PerformanceCounterPermissionEntry[] 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 PerformanceCounterPermissionEntryCollection PermissionEntries {
            get { 
                if (this.innerCollection == null)
                    this.innerCollection = new PerformanceCounterPermissionEntryCollection(this, base.GetPermissionEntries()); 
 
                return this.innerCollection;
            } 
        }

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

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

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


                        

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