System.Security.AccessControl.Privilege.Enable C# (CSharp) Method

Enable() public method

public Enable ( ) : void
return void
        public void Enable()
        {
            this.ToggleState(true);
        }

Usage Example

Beispiel #1
0
        public static void RunWithPrivilege(string privilege, bool enabled, PrivilegedHelper helper)
        {
            if (helper == null)
            {
                throw new ArgumentNullException("helper");
            }
            Contract.EndContractBlock();

            Privilege p = new Privilege(privilege);

            try
            {
                if (enabled)
                {
                    p.Enable();
                }
                else
                {
                    p.Disable();
                }

                helper();
            }
            finally
            {
                p.Revert();
            }
        }
All Usage Examples Of System.Security.AccessControl.Privilege::Enable