当前位置: 首页>>代码示例>>C#>>正文


C# ControlFlags类代码示例

本文整理汇总了C#中ControlFlags的典型用法代码示例。如果您正苦于以下问题:C# ControlFlags类的具体用法?C# ControlFlags怎么用?C# ControlFlags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ControlFlags类属于命名空间,在下文中一共展示了ControlFlags类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RawSecurityDescriptor

		public RawSecurityDescriptor (byte[] binaryForm, int offset)
		{
			if (binaryForm == null)
				throw new ArgumentNullException("binaryForm");
			
			if (offset < 0 || offset > binaryForm.Length - 0x14)
				throw new ArgumentOutOfRangeException("offset", offset, "Offset out of range");
			
			if (binaryForm[offset] != 1)
				throw new ArgumentException("Unrecognized Security Descriptor revision.", "binaryForm");
			
			resourcemgr_control = binaryForm[offset + 0x01];
			control_flags = (ControlFlags)ReadUShort(binaryForm, offset + 0x02);
			
			int ownerPos = ReadInt(binaryForm, offset + 0x04);
			int groupPos = ReadInt(binaryForm, offset + 0x08);
			int saclPos = ReadInt(binaryForm, offset + 0x0C);
			int daclPos = ReadInt(binaryForm, offset + 0x10);
			
			if (ownerPos != 0)
				owner_sid = new SecurityIdentifier(binaryForm, ownerPos);
			
			if (groupPos != 0)
				group_sid = new SecurityIdentifier(binaryForm, groupPos);
			
			if (saclPos != 0)
				system_acl = new RawAcl(binaryForm, saclPos);
			
			if (daclPos != 0)
				discretionary_acl = new RawAcl(binaryForm, daclPos);
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:31,代码来源:RawSecurityDescriptor.cs

示例2: RawSecurityDescriptor

		public RawSecurityDescriptor (ControlFlags flags,
					      SecurityIdentifier owner,
					      SecurityIdentifier group,
					      RawAcl systemAcl,
					      RawAcl discretionaryAcl)
		{
		}
开发者ID:runefs,项目名称:Marvin,代码行数:7,代码来源:RawSecurityDescriptor.cs

示例3: CommonSecurityDescriptor

		public CommonSecurityDescriptor (bool isContainer, bool isDS,
						 ControlFlags flags,
						 SecurityIdentifier owner,
						 SecurityIdentifier group,
						 SystemAcl systemAcl,
						 DiscretionaryAcl discretionaryAcl)
		{
			Init (isContainer, isDS, flags, owner, group, systemAcl, discretionaryAcl);
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:9,代码来源:CommonSecurityDescriptor.cs

示例4: CommonSecurityDescriptor

		public CommonSecurityDescriptor (bool isContainer, bool isDS,
						 ControlFlags flags,
						 SecurityIdentifier owner,
						 SecurityIdentifier group,
						 SystemAcl systemAcl,
						 DiscretionaryAcl discretionaryAcl)
		{
			this.isContainer = isContainer;
			this.isDS = isDS;
			this.flags = flags;
			this.owner = owner;
			this.group = group;
			this.systemAcl = systemAcl;
			this.discretionaryAcl = discretionaryAcl;
			
			throw new NotImplementedException ();
		}
开发者ID:runefs,项目名称:Marvin,代码行数:17,代码来源:CommonSecurityDescriptor.cs

示例5: AddControlFlags

        //
        // These two add/remove method must be called with great care (and thus it is internal)
        // The caller is responsible for keeping the SaclPresent and DaclPresent bits in sync
        // with the actual SACL and DACL.
        //

        internal void AddControlFlags(ControlFlags flags)
        {
            _rawSd.SetFlags(_rawSd.ControlFlags | flags);
        }
开发者ID:Corillian,项目名称:corefx,代码行数:10,代码来源:SecurityDescriptor.cs

示例6: UpdateControlFlags

 internal void UpdateControlFlags(ControlFlags flagsToUpdate, ControlFlags newFlags)
 {
     ControlFlags finalFlags = newFlags | (_rawSd.ControlFlags & (~flagsToUpdate));
     _rawSd.SetFlags(finalFlags);
 }
开发者ID:Corillian,项目名称:corefx,代码行数:5,代码来源:SecurityDescriptor.cs

示例7: UserHintJumpBlock

 public UserHintJumpBlock(BinaryReader binaryReader)
 {
     this.flags = (Flags)binaryReader.ReadInt16();
     this.geometryIndex = binaryReader.ReadShortBlockIndex1();
     this.forceJumpHeight = (ForceJumpHeight)binaryReader.ReadInt16();
     this.controlFlags = (ControlFlags)binaryReader.ReadInt16();
 }
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:7,代码来源:Scenario.cs

示例8: GetSddlForm

		internal override string GetSddlForm(ControlFlags sdFlags,
		                                     bool isDacl)
		{
			StringBuilder result = new StringBuilder();
			
			if(isDacl) {
				if((sdFlags & ControlFlags.DiscretionaryAclProtected) != 0)
					result.Append("P");
				if((sdFlags & ControlFlags.DiscretionaryAclAutoInheritRequired) != 0)
					result.Append("AR");
				if((sdFlags & ControlFlags.DiscretionaryAclAutoInherited) != 0)
					result.Append("AI");
			} else {
				if((sdFlags & ControlFlags.SystemAclProtected) != 0)
					result.Append("P");
				if((sdFlags & ControlFlags.SystemAclAutoInheritRequired) != 0)
					result.Append("AR");
				if((sdFlags & ControlFlags.SystemAclAutoInherited) != 0)
					result.Append("AI");
			}
			
			foreach(var ace in list)
			{
				result.Append(ace.GetSddlForm());
			}
			
			return result.ToString();
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:28,代码来源:RawAcl.cs

示例9: GetControlFlag

 private bool GetControlFlag(ControlFlags flag)
 {
     return (agentControls & (uint)flag) != 0;
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:4,代码来源:AgentManagerMovement.cs

示例10: CreateFromParts

        private void CreateFromParts(bool isContainer, bool isDS, ControlFlags flags, SecurityIdentifier owner, SecurityIdentifier group, SystemAcl systemAcl, DiscretionaryAcl discretionaryAcl)
        {
            if (systemAcl != null &&
                systemAcl.IsContainer != isContainer)
            {
                throw new ArgumentException(
                     isContainer ?
                        SR.AccessControl_MustSpecifyContainerAcl :
                        SR.AccessControl_MustSpecifyLeafObjectAcl,
nameof(systemAcl));
            }

            if (discretionaryAcl != null &&
                discretionaryAcl.IsContainer != isContainer)
            {
                throw new ArgumentException(
                     isContainer ?
                        SR.AccessControl_MustSpecifyContainerAcl :
                        SR.AccessControl_MustSpecifyLeafObjectAcl,
nameof(discretionaryAcl));
            }

            _isContainer = isContainer;

            if (systemAcl != null &&
                systemAcl.IsDS != isDS)
            {
                throw new ArgumentException(
                     isDS ?
                        SR.AccessControl_MustSpecifyDirectoryObjectAcl :
                        SR.AccessControl_MustSpecifyNonDirectoryObjectAcl,
nameof(systemAcl));
            }

            if (discretionaryAcl != null &&
                discretionaryAcl.IsDS != isDS)
            {
                throw new ArgumentException(
                    isDS ?
                        SR.AccessControl_MustSpecifyDirectoryObjectAcl :
                        SR.AccessControl_MustSpecifyNonDirectoryObjectAcl,
nameof(discretionaryAcl));
            }

            _isDS = isDS;

            _sacl = systemAcl;

            //
            // Replace null DACL with an allow-all for everyone DACL
            //

            if (discretionaryAcl == null)
            {
                //
                // to conform to native behavior, we will add allow everyone ace for DACL
                //

                discretionaryAcl = DiscretionaryAcl.CreateAllowEveryoneFullAccess(_isDS, _isContainer);
            }

            _dacl = discretionaryAcl;

            //
            // DACL is never null. So always set the flag bit on
            //

            ControlFlags actualFlags = flags | ControlFlags.DiscretionaryAclPresent;

            //
            // Keep SACL and the flag bit in sync.
            //

            if (systemAcl == null)
            {
                unchecked { actualFlags &= ~(ControlFlags.SystemAclPresent); }
            }
            else
            {
                actualFlags |= (ControlFlags.SystemAclPresent);
            }

            _rawSd = new RawSecurityDescriptor(actualFlags, owner, group, systemAcl == null ? null : systemAcl.RawAcl, discretionaryAcl.RawAcl);
        }
开发者ID:Corillian,项目名称:corefx,代码行数:84,代码来源:SecurityDescriptor.cs

示例11: RawSecurityDescriptor

        //
        // Creates a security descriptor explicitly
        //

        public RawSecurityDescriptor(ControlFlags flags, SecurityIdentifier owner, SecurityIdentifier group, RawAcl systemAcl, RawAcl discretionaryAcl)
            : base()
        {
            CreateFromParts(flags, owner, group, systemAcl, discretionaryAcl);
        }
开发者ID:Corillian,项目名称:corefx,代码行数:9,代码来源:SecurityDescriptor.cs

示例12: SetDiscretionaryAclProtection

		public void SetDiscretionaryAclProtection (bool isProtected,
							   bool preserveInheritance)
		{
			DiscretionaryAcl.IsAefa = false;
			
			if (!isProtected) {
				flags &= ~ControlFlags.DiscretionaryAclProtected;
				return;
			}
			
			flags |= ControlFlags.DiscretionaryAclProtected;
			if (!preserveInheritance)
				DiscretionaryAcl.RemoveInheritedAces ();
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:14,代码来源:CommonSecurityDescriptor.cs

示例13: SetControlFlag

	// Set a control flag.
	private void SetControlFlag(ControlFlags mask, bool value)
			{
				if(value)
				{
					flags |= mask;
				}
				else
				{
					flags &= ~mask;
				}
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:12,代码来源:Control.cs

示例14: SetFlags

		public void SetFlags (ControlFlags flags)
		{
			control_flags = flags | ControlFlags.SelfRelative;
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:4,代码来源:RawSecurityDescriptor.cs

示例15: RemoveControlFlags

 internal void RemoveControlFlags(ControlFlags flags)
 {
     unchecked
     {
         _rawSd.SetFlags(_rawSd.ControlFlags & ~flags);
     }
 }
开发者ID:Corillian,项目名称:corefx,代码行数:7,代码来源:SecurityDescriptor.cs


注:本文中的ControlFlags类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。