public IType MakeClassificationType(IType elementType, TypeElementClassification classification) { IType result; if (!classifiedTypeCache.TryGetValue(elementType, classification, out result)) { switch (classification) { case TypeElementClassification.Nullable: classifiedTypeCache.Add(elementType, classification, result = ((IGenericType)this.manager.ObtainTypeReference(this.manager.RuntimeEnvironment.GetCoreIdentifier(CliRuntimeCoreType.NullableType), elementType.Assembly)).MakeGenericClosure(elementType)); break; case TypeElementClassification.Pointer: classifiedTypeCache.Add(elementType, classification, result = new PointerType(elementType, this.manager)); break; case TypeElementClassification.Reference: classifiedTypeCache.Add(elementType, classification, result = new ByRefType(elementType, this.manager)); break; default: throw new ArgumentOutOfRangeException("classification"); } } return(result); }
public CliMetadataElementTypeAndModifiersSignature(TypeElementClassification classification, ICliMetadataTypeSignature elementType, ICliMetadataCustomModifierSignature[] customModifiers) : base(classification, elementType) { if (customModifiers == null || customModifiers.Length == 0) { this.CustomModifiers = ArrayReadOnlyCollection <ICliMetadataCustomModifierSignature> .Empty; } else { this.CustomModifiers = new ArrayReadOnlyCollection <ICliMetadataCustomModifierSignature>(customModifiers.ToArray()); } }
public TIElementClassificationRule(TypeElementClassification classification) { this.Classification = classification; }
internal CliMetadataElementTypeSignature(TypeElementClassification classification, ICliMetadataTypeSignature elementType) { this.Classification = classification; this.ElementType = elementType; }