• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Modifiers类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetAccessSortValue

		int GetAccessSortValue (Modifiers mods)
		{
			if ((mods & Modifiers.Private) != 0) return 0;
			if ((mods & Modifiers.Internal) != 0) return 1;
			if ((mods & Modifiers.Protected) != 0) return 2;
			if ((mods & Modifiers.Public) != 0) return 3;
			return 4;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:8,代码来源:MemberNodeBuilder.cs


示例17: KeyboardEventArgs

 /// <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 KeyboardEventArgs(TimeSpan time, Keys key, Modifiers modifiers, KeyboardState state)
     : base(time)
 {
     Character = KeyboardUtil.ToChar(key, modifiers);
     State = state;
     Modifiers = modifiers;
     Key = key;
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:13,代码来源:KeyboardEventArgs.cs


示例18: ReplaceModifiers

 public void ReplaceModifiers(AttributedNode node, Modifiers oldModifier, Modifiers newModifier)
 {
     if (ContainsModifier(node, oldModifier))
     {
         RemoveModifierFrom(node, oldModifier);
         AddModifierTo(node, newModifier);
     }
 }
开发者ID:sourcewarehouse,项目名称:janett,代码行数:8,代码来源:AstUtil.cs


示例19: CreateAutoPropertyDeclaration

 public static PropertyDeclaration CreateAutoPropertyDeclaration(string name, string type, Modifiers modifiers)
 {
     return new PropertyDeclaration(modifiers, new List<AttributeSection>(), name, new List<ParameterDeclarationExpression>())
     {
         TypeReference = CreateTypeReference(type),
         GetRegion = CreateAutoPropertyGetRegion(),
         SetRegion = CreateAutoPropertySetRegion()
     };
 }
开发者ID:Magicolo,项目名称:PseudoFramework,代码行数:9,代码来源:NRefactoryUtility.cs


示例20: GetModifier

 // This checks if the only key being held is the one we want using the Modifier helper.
 public bool GetModifier(Modifiers key)
 {
     switch (key)
     {
         case Modifiers.Control: return Modifier(Modifiers.Control) && !Modifier(Modifiers.Alt) && !Modifier(Modifiers.Shift);
         case Modifiers.Alt: return !Modifier(Modifiers.Control) && Modifier(Modifiers.Alt) && !Modifier(Modifiers.Shift);
         default: return !Modifier(Modifiers.Control) && !Modifier(Modifiers.Alt) && Modifier(Modifiers.Shift);
     }
 }
开发者ID:alexkirwan29,项目名称:Cubes-Of-Wrath,代码行数:10,代码来源:ShortcutKeys.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Module类代码示例发布时间:2022-05-24
下一篇:
C# ModifierType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap