本文整理汇总了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);
}
示例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();
}
示例3: ConstantExpression
internal ConstantExpression(
ITypeReference typeReference,
object/*?*/ value
) {
this.TypeReference = typeReference;
this.value = value;
}
示例4: Create
public static ITypeReference Create(ITypeReference elementType)
{
if (elementType is IType)
return new PointerType((IType)elementType);
else
return new PointerTypeReference(elementType);
}
示例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;
}
示例6: DefaultUnresolvedAttribute
public DefaultUnresolvedAttribute(ITypeReference attributeType, IEnumerable<ITypeReference> constructorParameterTypes)
{
if (attributeType == null)
throw new ArgumentNullException("attributeType");
this.attributeType = attributeType;
this.ConstructorParameterTypes.AddRange(constructorParameterTypes);
}
示例7: WriteDefaultOf
private void WriteDefaultOf(ITypeReference type)
{
WriteKeyword("default", true);
WriteSymbol("(");
WriteTypeName(type, true);
WriteSymbol(")");
}
示例8: SimpleConstantValue
public SimpleConstantValue(ITypeReference type, object value)
{
if (type == null)
throw new ArgumentNullException("type");
this.type = type;
this.value = value;
}
示例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();
}
示例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;
}
示例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;
}
示例12: ConstantArrayCreation
public ConstantArrayCreation(ITypeReference type, IList<ConstantExpression> arrayElements)
{
if (arrayElements == null)
throw new ArgumentNullException("arrayElements");
this.elementType = type;
this.arrayElements = arrayElements;
}
示例13: CustomAttribute
public CustomAttribute(
IMethodReference constructor,
ITypeReference type,
ReadOnlyArray<MetadataConstant> positionalArguments) :
this(constructor, type, positionalArguments, ReadOnlyArray<IMetadataNamedArgument>.Empty)
{
}
示例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;
}
示例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);
}