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


C# Modifiers类代码示例

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


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

示例1: Hotkey

 public Hotkey(Keys key, Modifiers modifiers, HotkeyHandler handler)
 {
     Key = key;
     Modifiers = modifiers;
     Handler = handler;
     Id = GetHashCode();
 }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:7,代码来源:Hotkey.cs

示例2: DoControlGroup

        public void DoControlGroup(World world, int group, Modifiers mods)
        {
            if (mods.HasModifier(Modifiers.Ctrl))
            {
                if (actors.Count == 0)
                    return;

                controlGroups[group].Clear();

                for (var i = 0; i < 10; i++)	/* all control groups */
                    controlGroups[i].RemoveAll(a => actors.Contains(a));

                controlGroups[group].AddRange(actors);
                return;
            }

            if (mods.HasModifier(Modifiers.Alt))
            {
                Game.viewport.Center(controlGroups[group]);
                return;
            }

            Combine(world, controlGroups[group],
                mods.HasModifier(Modifiers.Shift), false);
        }
开发者ID:comradpara,项目名称:OpenRA,代码行数:25,代码来源:Selection.cs

示例3: CheckName

 public string CheckName(SemanticModel ctx, string name, AffectedEntity entity, Modifiers accessibilty = Modifiers.Private, bool isStatic = false)
 {
     foreach (var rule in Rules)
     {
         if (!rule.AffectedEntity.HasFlag(entity))
         {
             continue;
         }
         if (!rule.VisibilityMask.HasFlag(accessibilty))
         {
             continue;
         }
         if (isStatic && !rule.IncludeStaticEntities || !isStatic && !rule.IncludeInstanceMembers)
         {
             continue;
         }
         if (!rule.IsValid(name))
         {
             IList<string> suggestedNames;
             rule.GetErrorMessage(ctx, name, out suggestedNames);
             if (suggestedNames.Any())
                 return suggestedNames[0];
         }
     }
     return name;
 }
开发者ID:alecor191,项目名称:RefactoringEssentials,代码行数:26,代码来源:NamingConventionService.cs

示例4: ConstructorDeclaration

 public ConstructorDeclaration(string name, Modifiers modifier,
     List<ParameterDeclarationExpression> parameters,
     ConstructorInitializer constructorInitializer,
     List<AttributeSection> attributes)
     : base(modifier, attributes, name, parameters)
 {
 }
开发者ID:almazik,项目名称:ILSpy,代码行数:7,代码来源:TypeLevel.cs

示例5: CheckName

			void CheckName(TypeDeclaration node, AffectedEntity entity, Identifier identifier, Modifiers accessibilty)
			{
				TypeResolveResult resolveResult = ctx.Resolve(node) as TypeResolveResult;
				if (resolveResult == null)
					return;
				var type = resolveResult.Type;
				if (type.DirectBaseTypes.Any(t => t.FullName == "System.Attribute")) {
					if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomAttributes, identifier, accessibilty)) {
						return;
					}
				} else if (type.DirectBaseTypes.Any(t => t.FullName == "System.EventArgs")) {
					if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomEventArgs, identifier, accessibilty)) {
						return;
					}
				} else if (type.DirectBaseTypes.Any(t => t.FullName == "System.Exception")) {
					if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomExceptions, identifier, accessibilty)) {
						return;
					}
				}

				var typeDef = type.GetDefinition();
				if (typeDef != null && typeDef.Attributes.Any(attr => attr.AttributeType.FullName == "NUnit.Framework.TestFixtureAttribute")) {
					if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.TestType, identifier, accessibilty)) {
						return;
					}
				}

				CheckNamedResolveResult(resolveResult, node, entity, identifier, accessibilty);
			}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:29,代码来源:InconsistentNamingIssue.cs

示例6: DestructorDeclarationNode

 public DestructorDeclarationNode(Token token,
                                  ParseNodeList attributes,
                                  Modifiers modifiers,
                                  AtomicNameNode name,
                                  BlockStatementNode body)
     : base(ParseNodeType.DestructorDeclaration, token, attributes, modifiers, /* return type */ null, name, new ParseNodeList(), body) {
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:7,代码来源:DestructorDeclarationNode.cs

示例7: DoControlGroup

        public void DoControlGroup(World world, WorldRenderer worldRenderer, int group, Modifiers mods, int MultiTapCount)
        {
            var addModifier = Platform.CurrentPlatform == PlatformType.OSX ? Modifiers.Meta : Modifiers.Ctrl;
            if (mods.HasModifier(addModifier))
            {
                if (actors.Count == 0)
                    return;

                if (!mods.HasModifier(Modifiers.Shift))
                    controlGroups[group].Clear();

                for (var i = 0; i < 10; i++)	/* all control groups */
                    controlGroups[i].RemoveAll(a => actors.Contains(a));

                controlGroups[group].AddRange(actors.Where(a => a.Owner == world.LocalPlayer));
                return;
            }

            var groupActors = controlGroups[group].Where(a => !a.IsDead() && !world.FogObscures(a));

            if (mods.HasModifier(Modifiers.Alt) || MultiTapCount >= 2)
            {
                worldRenderer.Viewport.Center(groupActors);
                return;
            }

            Combine(world, groupActors, mods.HasModifier(Modifiers.Shift), false);
        }
开发者ID:RunCraze,项目名称:OpenRA,代码行数:28,代码来源:Selection.cs

示例8: DoControlGroup

        public void DoControlGroup(World world, int group, Modifiers mods, int MultiTapCount)
        {
            var addModifier = Platform.CurrentPlatform == PlatformType.OSX ? Modifiers.Meta : Modifiers.Ctrl;
            if (mods.HasModifier(addModifier))
            {
                if (actors.Count == 0)
                    return;

                if (!mods.HasModifier(Modifiers.Shift))
                    controlGroups[group].Clear();

                for (var i = 0; i < 10; i++)	/* all control groups */
                    controlGroups[i].RemoveAll(a => actors.Contains(a));

                controlGroups[group].AddRange(actors);
                return;
            }

            if (mods.HasModifier(Modifiers.Alt) || MultiTapCount >= 2)
            {
                Game.viewport.Center(controlGroups[group]);
                return;
            }

            Combine(world, controlGroups[group],
                mods.HasModifier(Modifiers.Shift), false);
        }
开发者ID:nevelis,项目名称:OpenRA,代码行数:27,代码来源:Selection.cs

示例9: Check

 //        public void Add(Modifiers m)
 //        {
 //            Add(m.cur, m.Location);
 //        }
 public void Check(Modifiers allowed)
 {
     Modifiers wrong = cur & ~allowed;
     if (wrong != Modifiers.None) {
     //				parser.Error("modifier(s) " + wrong + " not allowed here");
     }
 }
开发者ID:richardschneider,项目名称:ILSpy,代码行数:11,代码来源:ModifierList.cs

示例10: ConstantFieldDeclarationNode

 public ConstantFieldDeclarationNode(Token token,
                                     ParseNodeList attributes,
                                     Modifiers modifiers,
                                     ParseNode type,
                                     ParseNodeList initializers)
     : base(ParseNodeType.ConstFieldDeclaration, token, attributes, modifiers, type, initializers, false) {
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:7,代码来源:ConstantFieldDeclarationNode.cs

示例11: CharacterEventArgs

 /// <summary>
 /// Creates a new KeyboardEventArgs, given a time for the event, the key that was pressed, and
 /// the modifiers that were applied at the time of the press, as well as the keyboard state at 
 /// the time the event occurred.
 /// </summary>
 public CharacterEventArgs(TimeSpan time, char character, Modifiers modifiers, KeyboardState state)
     : base(time)
 {
     Character = character;
     State = state;
     Modifiers = modifiers;
 }
开发者ID:yadiate,项目名称:MonoGameGui,代码行数:12,代码来源:CharacterEventArgs.cs

示例12: ConvMemberAttributes

		// FIXME: map all modifiers correctly
		static MemberAttributes ConvMemberAttributes(Modifiers modifier)
		{
			MemberAttributes attr = (MemberAttributes)0;
			
			if ((modifier & Modifiers.Abstract) != 0)
				attr |=  MemberAttributes.Abstract;
			if ((modifier & Modifiers.Const) != 0)
				attr |=  MemberAttributes.Const;
			if ((modifier & Modifiers.Sealed) != 0)
				attr |=  MemberAttributes.Final;
			if ((modifier & Modifiers.New) != 0)
				attr |=  MemberAttributes.New;
			if ((modifier & Modifiers.Virtual) != 0)
				attr |=  MemberAttributes.Overloaded;
			if ((modifier & Modifiers.Override) != 0)
				attr |=  MemberAttributes.Override;
			if ((modifier & Modifiers.Static) != 0)
				attr |=  MemberAttributes.Static;
			
			if ((modifier & Modifiers.Private) != 0)
				attr |=  MemberAttributes.Private;
			else if ((modifier & Modifiers.Public) != 0)
				attr |=  MemberAttributes.Public;
			else if ((modifier & Modifiers.Internal) != 0 && (modifier & Modifiers.Protected) != 0)
				attr |=  MemberAttributes.FamilyOrAssembly;
			else if ((modifier & Modifiers.Internal) != 0)
				attr |=  MemberAttributes.Assembly;
			else if ((modifier & Modifiers.Protected) != 0)
				attr |=  MemberAttributes.Family;
			
			return attr;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:33,代码来源:CodeDOMOutputVisitor.cs

示例13: VariableDeclarationNode

 public VariableDeclarationNode(Token token,
                                ParseNodeList attributes,
                                Modifiers modifiers,
                                ParseNode type,
                                ParseNodeList initializers,
                                bool isFixed)
     : this(ParseNodeType.VariableDeclaration, token, attributes, modifiers, type, initializers, isFixed) {
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:8,代码来源:VariableDeclarationNode.cs

示例14: CompilerGeneratedContainer

		protected CompilerGeneratedContainer (TypeContainer parent, MemberName name, Modifiers mod, MemberKind kind)
			: base (parent, name, null, kind)
		{
			Debug.Assert ((mod & Modifiers.AccessibilityMask) != 0);

			ModFlags = mod | Modifiers.COMPILER_GENERATED | Modifiers.SEALED;
			spec = new TypeSpec (Kind, null, this, null, ModFlags);
		}
开发者ID:furesoft,项目名称:NRefactory,代码行数:8,代码来源:anonymous.cs

示例15: GlobalHotKey

 public GlobalHotKey(IntPtr handle, Key keys, Modifiers modifiers, Action handler)
 {
     this.handle = handle;
     this.key = keys;
     this.modifiers = modifiers;
     this.handler = handler;
     this.id = (int)keys ^ (int)modifiers;
 }
开发者ID:Hemlock,项目名称:Pix,代码行数:8,代码来源:GlobalHotKey.cs


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