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


C# ICSharpCode.Annotation方法代码示例

本文整理汇总了C#中ICSharpCode.Annotation方法的典型用法代码示例。如果您正苦于以下问题:C# ICSharpCode.Annotation方法的具体用法?C# ICSharpCode.Annotation怎么用?C# ICSharpCode.Annotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICSharpCode的用法示例。


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

示例1: GetTypeKindForAstType

		public TypeKind GetTypeKindForAstType(ICSharpCode.NRefactory.CSharp.AstType type) {
			var annotation = type.Annotation<ITypeDefOrRef>();
			if (annotation == null)
				return TypeKind.Unknown;

			var definition = annotation.ResolveTypeDef();
			if (definition == null)
				return TypeKind.Unknown;
			if (definition.IsClass)
				return TypeKind.Class;
			if (definition.IsInterface)
				return TypeKind.Interface;
			if (definition.IsEnum)
				return TypeKind.Enum;
			if (definition.IsValueType)
				return TypeKind.Struct;

			return TypeKind.Unknown;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:19,代码来源:ILSpyEnvironmentProvider.cs

示例2: GetTypeKindForAstType

		public TypeKind GetTypeKindForAstType(ICSharpCode.NRefactory.CSharp.AstType type)
		{
			var annotation = type.Annotation<TypeReference>();
			if (annotation == null)
				return TypeKind.Unknown;
			
			var definition = annotation.ResolveOrThrow();
			if (definition.IsClass)
				return TypeKind.Class;
			if (definition.IsInterface)
				return TypeKind.Interface;
			if (definition.IsEnum)
				return TypeKind.Enum;
			if (definition.IsFunctionPointer)
				return TypeKind.Delegate;
			if (definition.IsValueType)
				return TypeKind.Struct;
			
			return TypeKind.Unknown;
		}
开发者ID:manojdjoshi,项目名称:simple-assembly-exploror,代码行数:20,代码来源:ILSpyEnvironmentProvider.cs

示例3: IsMethodGroup

		public bool IsMethodGroup(ICSharpCode.NRefactory.CSharp.Expression expression)
		{
			var annotation = expression.Annotation<MethodDef>();
			if (annotation != null) {
				return true;
			}
			
			return false;
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:9,代码来源:ILSpyEnvironmentProvider.cs

示例4: IsMethodGroup

        public bool IsMethodGroup(ICSharpCode.NRefactory.CSharp.Expression expression)
        {
            var annotation = expression.Annotation<MethodDefinition>();
            if (annotation != null && annotation.SemanticsAttributes == MethodSemanticsAttributes.None)
            {
                return true;
            }

            return false;
        }
开发者ID:pmeaster,项目名称:ILSpy,代码行数:10,代码来源:ILSpyEnvironmentProvider.cs

示例5: GetParametersForProperty

		public ICSharpCode.NRefactory.CSharp.ParameterDeclaration[] GetParametersForProperty(ICSharpCode.NRefactory.CSharp.PropertyDeclaration property) {
			var propInfo = property.Annotation<PropertyDef>();

			if (propInfo == null)
				return new ICSharpCode.NRefactory.CSharp.ParameterDeclaration[0];

			sb.Clear();
			var getMethod = propInfo.GetMethod;
			if (getMethod != null)
				return getMethod.Parameters.Where(p => p.IsNormalMethodParameter).Select(p => new ICSharpCode.NRefactory.CSharp.ParameterDeclaration(AstBuilder.ConvertType(p.Type, sb), p.Name, GetModifiers(p))).ToArray();
			var setMethod = propInfo.SetMethod;
			if (setMethod != null) {
				var ps = setMethod.Parameters.Where(p => p.IsNormalMethodParameter).ToArray();
				if (ps.Length > 1)
					return ps.Take(ps.Length - 1).Select(p => new ICSharpCode.NRefactory.CSharp.ParameterDeclaration(AstBuilder.ConvertType(p.Type, sb), p.Name, GetModifiers(p))).ToArray();
			}

			return new ICSharpCode.NRefactory.CSharp.ParameterDeclaration[0];
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:19,代码来源:ILSpyEnvironmentProvider.cs

示例6: IsMethodGroup

		public bool IsMethodGroup(ICSharpCode.NRefactory.CSharp.Expression expression) {
			var annotation = expression.Annotation<MethodDef>();
			if (annotation == null)
				return false;
			return expression.Annotation<PropertyDef>() == null && expression.Annotation<EventDef>() == null;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:6,代码来源:ILSpyEnvironmentProvider.cs

示例7: HasEvent

		public bool HasEvent(ICSharpCode.NRefactory.VB.Ast.Expression expression) => expression.Annotation<EventDef>() != null;
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:1,代码来源:ILSpyEnvironmentProvider.cs


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