public void SetSystemAclProtection(bool isProtected, bool preserveInheritance) { if (!isProtected) { flags &= ~ControlFlags.SystemAclProtected; return; } flags |= ControlFlags.SystemAclProtected; if (!preserveInheritance && SystemAcl != null) { SystemAcl.RemoveInheritedAces(); } }
public void SetSystemAclProtection(bool isProtected, bool preserveInheritance) { if (!isProtected) { RemoveControlFlags(ControlFlags.SystemAclProtected); } else { if (!preserveInheritance && SystemAcl != null) { SystemAcl.RemoveInheritedAces(); } AddControlFlags(ControlFlags.SystemAclProtected); } }