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

C# ModifierEnum类代码示例

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

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



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

示例1: DefaultField

 public DefaultField(IReturnType type, string name, ModifierEnum m, DomRegion region, IClass declaringType)
     : base(declaringType, name)
 {
     this.ReturnType = type;
     this.Region = region;
     this.Modifiers = m;
 }
开发者ID:SergeTruth,项目名称:OxyChart,代码行数:7,代码来源:DefaultField.cs


示例2: GetAccessSortValue

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


示例3: ConvertModifier

		ModifierEnum ConvertModifier(AST.Modifiers m, ModifierEnum defaultVisibility)
		{
			ModifierEnum r = (ModifierEnum)m;
			if ((r & ModifierEnum.VisibilityMask) == ModifierEnum.None)
				return r | defaultVisibility;
			else
				return r;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:NRefactoryASTConvertVisitor.cs


示例4: DefaultMethod

 public DefaultMethod(string name, IReturnType type, ModifierEnum m, DomRegion region, DomRegion bodyRegion, IClass declaringType)
     : base(declaringType, name)
 {
     this.ReturnType = type;
     this.Region     = region;
     this.BodyRegion = bodyRegion;
     Modifiers = m;
 }
开发者ID:SergeTruth,项目名称:OxyChart,代码行数:8,代码来源:DefaultMethod.cs


示例5: DefaultEvent

		public DefaultEvent(string name, IReturnType type, ModifierEnum m, DomRegion region, DomRegion bodyRegion, IClass declaringType) : base(declaringType, name)
		{
			this.ReturnType = type;
			this.Region     = region;
			this.BodyRegion = bodyRegion;
			Modifiers       = (ModifierEnum)m;
			if (Modifiers == ModifierEnum.None) {
				Modifiers = ModifierEnum.Private;
			}
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:10,代码来源:DefaultEvent.cs


示例6: GetModifierOffset

		static int GetModifierOffset(ModifierEnum modifier)
		{
			if ((modifier & ModifierEnum.Public) == ModifierEnum.Public) {
				return 0;
			}
			if ((modifier & ModifierEnum.Protected) == ModifierEnum.Protected) {
				return protectedModifierOffset;
			}
			if ((modifier & ModifierEnum.Internal) == ModifierEnum.Internal) {
				return internalModifierOffset;
			}
			return privateModifierOffset;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:13,代码来源:ClassBrowserIconService.cs


示例7: ConvertVisibilityBack

		public static AST.TypeMemberModifiers ConvertVisibilityBack(ModifierEnum modifier)
		{
			AST.TypeMemberModifiers r = AST.TypeMemberModifiers.None;
			if ((modifier & ModifierEnum.Public) == ModifierEnum.Public)
				r |= AST.TypeMemberModifiers.Public;
			if ((modifier & ModifierEnum.Protected) == ModifierEnum.Protected)
				r |= AST.TypeMemberModifiers.Protected;
			if ((modifier & ModifierEnum.Internal) == ModifierEnum.Internal)
				r |= AST.TypeMemberModifiers.Internal;
			if ((modifier & ModifierEnum.Private) == ModifierEnum.Private)
				r |= AST.TypeMemberModifiers.Private;
			return r;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:13,代码来源:ConvertVisitor.cs


示例8: ConvertAccessibility

		string ConvertAccessibility(ModifierEnum modifier)
		{
			if (ShowAccessibility) {
				if (ModifierIsSet(modifier, ModifierEnum.Public)) {
					return "public ";
				} else if (ModifierIsSet(modifier, ModifierEnum.Private)) {
					return "private ";
				} else if (ModifierIsSet(modifier, ModifierEnum.ProtectedAndInternal)) {
					return "protected internal ";
				} else if (ModifierIsSet(modifier, ModifierEnum.Internal)) {
					return "internal ";
				} else if (ModifierIsSet(modifier, ModifierEnum.Protected)) {
					return "protected ";
				}
			}
			
			return string.Empty;
		}
开发者ID:pusp,项目名称:o2platform,代码行数:18,代码来源:CSharpAmbience.cs


示例9: DefineConstructor

        /// <summary>
        /// Defines and returns a constructor for the given type
        /// </summary>
        /// <param name="container"></param>
        /// <param name="modifier"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public static CodeConstructor DefineConstructor(CodeTypeDeclaration container,
            ModifierEnum modifier, params ParameterInfo[] parameters)
        {
            CodeConstructor ctor = new CodeConstructor();
            ctor.Attributes = (ctor.Attributes & ~MemberAttributes.AccessMask) | (MemberAttributes)modifier;

            if (parameters != null)
            {
                foreach (ParameterInfo parameter in parameters)
                {
                    CodeParameterDeclarationExpression codeParameter = new CodeParameterDeclarationExpression(
                        parameter.ParameterType, parameter.Name);
                    ctor.Parameters.Add(codeParameter);
                }
            }

            container.Members.Add(ctor);
            return ctor;
        }
开发者ID:areiter,项目名称:InMemoryFuzzing,代码行数:26,代码来源:CodeHelpers.cs


示例10: Convert

		public override string Convert(ModifierEnum modifier)
		{
			StringBuilder builder = new StringBuilder();
			if (ShowAccessibility) {
				if ((modifier & ModifierEnum.Public) == ModifierEnum.Public) {
					builder.Append("Public");
				} else if ((modifier & ModifierEnum.Private) == ModifierEnum.Private) {
					builder.Append("Private");
				} else if ((modifier & (ModifierEnum.Protected | ModifierEnum.Internal)) == (ModifierEnum.Protected | ModifierEnum.Internal)) {
					builder.Append("Protected Friend");
				} else if ((modifier & ModifierEnum.Internal) == ModifierEnum.Internal) {
					builder.Append("Friend");
				} else if ((modifier & ModifierEnum.Protected) == ModifierEnum.Protected) {
					builder.Append("Protected");
				}
				builder.Append(' ');
			}
			return builder.ToString();
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:19,代码来源:VBNetAmbience.cs


示例11: Convert

		public override string Convert(ModifierEnum modifier, ConversionFlags conversionFlags)
		{
			if (ShowAccessibility(conversionFlags)) {
				if (ModifierIsSet(modifier, ModifierEnum.Public)) {
					return "public ";
				} else if (ModifierIsSet(modifier, ModifierEnum.Private)) {
					return "private ";
				} else if (ModifierIsSet(modifier, ModifierEnum.ProtectedAndInternal)) {
					return "protected internal ";
				} else if (ModifierIsSet(modifier, ModifierEnum.ProtectedOrInternal)) {
					return "internal protected ";
				} else if (ModifierIsSet(modifier, ModifierEnum.Internal)) {
					return "internal ";
				} else if (ModifierIsSet(modifier, ModifierEnum.Protected)) {
					return "protected ";
				}
			}
			
			return string.Empty;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:20,代码来源:NemerleAmbience.cs


示例12: DefineAccessor

        /// <summary>
        /// Defines an accessor (get/set)
        /// </summary>
        /// <param name="container"></param>
        /// <param name="modifier"></param>
        /// <param name="typeInfo"></param>
        /// <param name="hasGet"></param>
        /// <param name="hasSet"></param>
        /// <param name="memberVariableName"></param>
        /// <returns></returns>
        public static CodeMemberProperty DefineAccessor(CodeTypeDeclaration container,
            ModifierEnum modifier, ParameterInfo typeInfo, bool hasGet, bool hasSet, string memberVariableName)
        {
            CodeMemberProperty property = DefineProperty(container, modifier, typeInfo, hasGet, hasSet);

            if (hasGet)
            {
                property.GetStatements.Add(new CodeMethodReturnStatement(
                    new CodeFieldReferenceExpression(
                        new CodeThisReferenceExpression(), memberVariableName
                    )
                )
                );
            }

            if (hasSet)
            {
                property.SetStatements.Add(new CodeAssignStatement(
                    new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), memberVariableName),
                    new CodePropertySetValueReferenceExpression()));
            }

            return property;
        }
开发者ID:areiter,项目名称:InMemoryFuzzing,代码行数:34,代码来源:CodeHelpers.cs


示例13: Convert

 public abstract string Convert(ModifierEnum modifier);
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:1,代码来源:AbstractAmbience.cs


示例14: Constructor

		public Constructor(ModifierEnum m, IReturnType returnType, IClass declaringType)
			: base((m & ModifierEnum.Static) != 0 ? "#cctor" : "#ctor",
			       returnType, m, DomRegion.Empty, DomRegion.Empty, declaringType)
		{
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:5,代码来源:DefaultMethod.cs


示例15: Convert

		public string Convert(ModifierEnum modifier)
		{
			return String.Empty;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:4,代码来源:MockAmbience.cs


示例16: ModifierIsSet

		bool ModifierIsSet(ModifierEnum modifier, ModifierEnum query)
		{
			return (modifier & query) == query;
		}
开发者ID:pusp,项目名称:o2platform,代码行数:4,代码来源:CSharpAmbience.cs


示例17: CodeGetterOrSetterFunction

		public CodeGetterOrSetterFunction(IProperty property, ModifierEnum modifier)
			: base(property)
		{
			this.modifier = modifier;
		}
开发者ID:rbrunhuber,项目名称:SharpDevelop,代码行数:5,代码来源:CodeGetterOrSetterFunction.cs


示例18: DefaultClass

		public DefaultClass(ICompilationUnit compilationUnit, ClassType classType, ModifierEnum modifiers, DomRegion region, IClass declaringType) : base(declaringType)
		{
			if (compilationUnit == null)
				throw new ArgumentNullException("compilationUnit");
			this.compilationUnit = compilationUnit;
			this.region = region;
			this.classType = classType;
			Modifiers = modifiers;
			this.UsingScope = compilationUnit.UsingScope;
		}
开发者ID:XQuantumForceX,项目名称:Reflexil,代码行数:10,代码来源:DefaultClass.cs


示例19: ConvertAccessibility

		public abstract string ConvertAccessibility(ModifierEnum accessibility);
开发者ID:XQuantumForceX,项目名称:Reflexil,代码行数:1,代码来源:Ambience.cs


示例20: ConvertAccessibility

		public override string ConvertAccessibility(ModifierEnum accessibility)
		{
			return String.Empty;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:4,代码来源:MockAmbience.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ModifierKeys类代码示例发布时间:2022-05-24
下一篇:
C# ModifierData类代码示例发布时间: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