Ejemplo n.º 1
0
            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);
            }
Ejemplo n.º 2
0
 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());
     }
 }
Ejemplo n.º 3
0
 public TIElementClassificationRule(TypeElementClassification classification)
 {
     this.Classification = classification;
 }
Ejemplo n.º 4
0
 internal CliMetadataElementTypeSignature(TypeElementClassification classification, ICliMetadataTypeSignature elementType)
 {
     this.Classification = classification;
     this.ElementType    = elementType;
 }