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


C# IType.ToTypeReference方法代码示例

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


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

示例1: EventCreationCompletionData

		public EventCreationCompletionData(string handlerName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType, CSharpResolver contextAtCaret)
		{
			if (string.IsNullOrEmpty(handlerName)) {
				handlerName = (evt != null ? evt.Name : "Handle");
			}
			this.handlerName = handlerName;
			this.DisplayText = "<Create " + handlerName + ">";
			this.delegateTypeReference = delegateType.ToTypeReference();
			this.isStatic = callingMember != null && callingMember.IsStatic;
		}
开发者ID:fanyjie,项目名称:SharpDevelop,代码行数:10,代码来源:EventCreationCompletionData.cs

示例2: EventCreationCompletionData

		public EventCreationCompletionData(string handlerName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType, CSharpResolver contextAtCaret)
		{
			if (string.IsNullOrEmpty(handlerName)) {
				handlerName = (evt != null ? evt.Name : "Handle");
			}
			this.handlerName = handlerName;
			this.DisplayText = StringParser.Parse("${res:CSharpBinding.Refactoring.EventCreation.EventHandlerText}", new[] { new StringTagPair("HandlerName", handlerName) });
			this.delegateTypeReference = delegateType.ToTypeReference();
			this.isStatic = callingMember != null && callingMember.IsStatic;
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:10,代码来源:EventCreationCompletionData.cs

示例3: Import

		/// <summary>
		/// Imports a type from another compilation.
		/// </summary>
		public static IType Import(this ICompilation compilation, IType type)
		{
			if (compilation == null)
				throw new ArgumentNullException("compilation");
			if (type == null)
				return null;
			return type.ToTypeReference().Resolve(compilation.TypeResolveContext);
		}
开发者ID:Netring,项目名称:ILSpy,代码行数:11,代码来源:ExtensionMethods.cs

示例4: Import

 /// <summary>
 /// Imports a type from another compilation.
 /// </summary>
 public static IType Import(this ICompilation compilation, IType type)
 {
     if (compilation == null)
         throw new ArgumentNullException("compilation");
     if (type == null)
         return null;
     var compilationProvider = type as ICompilationProvider;
     if (compilationProvider != null && compilationProvider.Compilation == compilation)
         return type;
     IEntity typeParameterOwner = GetTypeParameterOwner(type);
     IEntity importedTypeParameterOwner = compilation.Import(typeParameterOwner);
     if (importedTypeParameterOwner != null) {
         return type.ToTypeReference().Resolve(new SimpleTypeResolveContext(importedTypeParameterOwner));
     } else {
         return type.ToTypeReference().Resolve(compilation.TypeResolveContext);
     }
 }
开发者ID:segaman,项目名称:NRefactory,代码行数:20,代码来源:TypeSystemExtensions.cs

示例5: Get

        public BridgeType Get(IType type, bool safe = false)
        {
            if (type.IsParameterized)
            {
                type = ((ParameterizedTypeReference)type.ToTypeReference()).GenericType.Resolve(this.Emitter.Resolver.Resolver.TypeResolveContext);
            }
            else if(type.Kind == TypeKind.Array) {
                return typesOfKey_["System.Array"];
            }

            var bridgeType = typesOfIType_.GetOrDefault(type);
            if(bridgeType != null) {
                return bridgeType;
            }

            if (!safe)
            {
                throw new Exception("Cannot find type: " + type.ReflectionName);
            }

            return null;
        }
开发者ID:yindongfei,项目名称:bridge.lua,代码行数:22,代码来源:BridgeType.cs


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