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


C# ITypeReference类代码示例

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


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

示例1: AnalyzeNonGenericTypeReference

 private static IEnumerable<ITypeReference> AnalyzeNonGenericTypeReference(ITypeReference typeReference)
 {
     if (typeReference is Vector)
         return AnalyzeVectorTypeReference(typeReference);
     else
         return AnalyzeNonVectorTypeReference(typeReference);
 }
开发者ID:halllo,项目名称:MTSS12,代码行数:7,代码来源:TypeReferenceUnfold.cs

示例2: GetName

		public static string GetName(ITypeReference value)
		{
			if (value != null)
			{
				ITypeCollection genericParameters = value.GenericArguments;
				if (genericParameters.Count > 0)
				{
					using (StringWriter writer = new StringWriter(CultureInfo.InvariantCulture))
					{
						for (int i = 0; i < genericParameters.Count; i++)
						{
							if (i != 0)
							{
								writer.Write(",");
							}

							IType genericParameter = genericParameters[i];
							if (genericParameter != null)
							{
								writer.Write(genericParameter.ToString());
							}
						}

						return value.Name + "<" + writer.ToString() + ">";
					}
				}

				return value.Name;
			}

			throw new NotSupportedException();
		}
开发者ID:adisik,项目名称:simple-assembly-explorer,代码行数:32,代码来源:Helper.cs

示例3: ConstantExpression

 internal ConstantExpression(
   ITypeReference typeReference,
   object/*?*/ value
 ) {
   this.TypeReference = typeReference;
   this.value = value;
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:7,代码来源:Attributes.cs

示例4: Create

		public static ITypeReference Create(ITypeReference elementType)
		{
			if (elementType is IType)
				return new PointerType((IType)elementType);
			else
				return new PointerTypeReference(elementType);
		}
开发者ID:JustasB,项目名称:cudafy,代码行数:7,代码来源:PointerType.cs

示例5: DeclareLocalInternal

        protected override LocalDefinition DeclareLocalInternal(
            ITypeReference type,
            object identity,
            string name,
            bool isCompilerGenerated,
            LocalSlotConstraints constraints,
            bool isDynamic,
            ImmutableArray<TypedConstant> dynamicTransformFlags)
        {
            if (allLocals == null)
            {
                allLocals = ImmutableArray.CreateBuilder<ILocalDefinition>(1);
            }

            var local = new LocalDefinition(
                identity: identity,
                name: name,
                type: type,
                slot: this.allLocals.Count,
                isCompilerGenerated: isCompilerGenerated,
                constraints: constraints,
                isDynamic: isDynamic,
                dynamicTransformFlags: dynamicTransformFlags);

            this.allLocals.Add(local);
            return local;
        }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:27,代码来源:FullLocalSlotManager.cs

示例6: DefaultUnresolvedAttribute

		public DefaultUnresolvedAttribute(ITypeReference attributeType, IEnumerable<ITypeReference> constructorParameterTypes)
		{
			if (attributeType == null)
				throw new ArgumentNullException("attributeType");
			this.attributeType = attributeType;
			this.ConstructorParameterTypes.AddRange(constructorParameterTypes);
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:7,代码来源:DefaultUnresolvedAttribute.cs

示例7: WriteDefaultOf

 private void WriteDefaultOf(ITypeReference type)
 {
     WriteKeyword("default", true);
     WriteSymbol("(");
     WriteTypeName(type, true);
     WriteSymbol(")");
 }
开发者ID:pgavlin,项目名称:ApiTools,代码行数:7,代码来源:CSDeclarationWriter.Methods.cs

示例8: SimpleConstantValue

		public SimpleConstantValue(ITypeReference type, object value)
		{
			if (type == null)
				throw new ArgumentNullException("type");
			this.type = type;
			this.value = value;
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:7,代码来源:SimpleConstantValue.cs

示例9: TypeToString

		string TypeToString(ITypeReference type, ITypeDefinition currentTypeDef = null)
		{
			var builder = CreateBuilder(currentTypeDef);
			IType resolvedType = type.Resolve(ctx);
			AstType node = builder.ConvertType(resolvedType);
			return node.ToString();
		}
开发者ID:sbeparey,项目名称:ILSpy,代码行数:7,代码来源:TypeSystemAstBuilderTests.cs

示例10: InstanceCreatorOptions

 public InstanceCreatorOptions(IUnitReflector reflector, ILocalVariableBindings locals, ITypeReference type, params ITypeReference[] constructorParameters)
 {
     this.type = type;
     this.locals = locals;
     this.reflector = reflector;
     this.constructorParameters = constructorParameters;
 }
开发者ID:jamarchist,项目名称:SharpMock,代码行数:7,代码来源:InstanceCreatorOptions.cs

示例11: DefaultAttribute

		public DefaultAttribute(ITypeReference attributeType, IEnumerable<ITypeReference> constructorParameterTypes)
		{
			if (attributeType == null)
				throw new ArgumentNullException("attributeType");
			this.attributeType = attributeType;
			this.constructorParameterTypes = constructorParameterTypes != null ? constructorParameterTypes.ToArray() : null;
		}
开发者ID:constructor-igor,项目名称:cudafy,代码行数:7,代码来源:DefaultAttribute.cs

示例12: ConstantArrayCreation

 public ConstantArrayCreation(ITypeReference type, IList<ConstantExpression> arrayElements)
 {
     if (arrayElements == null)
         throw new ArgumentNullException("arrayElements");
     this.elementType = type;
     this.arrayElements = arrayElements;
 }
开发者ID:riviti,项目名称:NRefactory,代码行数:7,代码来源:ConstantValues.cs

示例13: CustomAttribute

 public CustomAttribute(
     IMethodReference constructor,
     ITypeReference type,
     ReadOnlyArray<MetadataConstant> positionalArguments) :
     this(constructor, type, positionalArguments, ReadOnlyArray<IMetadataNamedArgument>.Empty)
 {
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:7,代码来源:CustomAttribute.cs

示例14: Unspecialize

 public static ITypeReference Unspecialize(ITypeReference type) {
   var sntr = type as ISpecializedNestedTypeReference;
   if (sntr != null) return sntr.UnspecializedVersion;
   var gtir = type as IGenericTypeInstanceReference;
   if (gtir != null) return gtir.GenericType;
   return type;
 }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:7,代码来源:MethodHelper.cs

示例15: NameForLocal

        private string NameForLocal(int depth, ITypeReference type)
        {
            Contract.Requires(0 <= depth);
            Contract.Requires(type != null);

            var str = String.Format("stack_{0}_{1}", depth, TypeHelper.GetTypeName(type));
            return CleanUpIdentifierName(str);
        }
开发者ID:xornand,项目名称:cci,代码行数:8,代码来源:Unstacker.cs


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