Esempio n. 1
0
 public EmitTypeBuilder(EmitAssembly assembly, string ns, string name, EmitTypeKind kind, EmitType declaringType,
                        EmitVisibility visibility, EmitTypeReference baseType, Func <EmitType, IReadOnlyList <EmitTypeReference> > implementedInterfacesFactory,
                        bool isAbstract, bool isSealed
                        ) :
     base(assembly, ns, name, kind, declaringType,
          result => ((EmitTypeBuilder)result).memberBuilders = new List <EmitMemberReference>(),
          visibility, baseType, implementedInterfacesFactory, isAbstract, isSealed)
 {
 }
Esempio n. 2
0
        public EmitType(EmitAssembly assembly, string ns, string name, EmitTypeKind kind, EmitType declaringType,
                        Func <EmitType, IReadOnlyList <EmitMemberReference> > membersFactory, EmitVisibility visibility,
                        EmitTypeReference baseType,
                        Func <EmitType, IReadOnlyList <EmitTypeReference> > implementedInterfacesFactory,
                        bool isAbstract, bool isSealed
                        ) :
            base(declaringType, name)
        {
            Assembly              = assembly;
            Namespace             = ns;
            Members               = new ReadOnlyListWrapper <EmitMemberReference, EmitMember>(membersFactory(this));
            Visibility            = visibility;
            Kind                  = kind;
            IsAbstract            = isAbstract;
            IsSealed              = isSealed;
            ImplementedInterfaces = new ReadOnlyListWrapper <EmitTypeReference, EmitType>(implementedInterfacesFactory(this));

            this.baseType = baseType;
        }
Esempio n. 3
0
 public EmitGenericType(EmitAssembly assembly, string ns, string name, EmitType declaringType, Func <EmitType, IReadOnlyList <EmitMemberReference> > membersFactory, EmitTypeReference baseType, EmitType genericTypeDefinition, IReadOnlyList <EmitType> typeArguments) : base(assembly, ns, name, genericTypeDefinition.Kind, declaringType, membersFactory, genericTypeDefinition.Visibility, baseType, DeriveImplementedInterfaces(genericTypeDefinition), genericTypeDefinition.IsAbstract, genericTypeDefinition.IsSealed)
 {
     GenericTypeDefinition = genericTypeDefinition;
     TypeArguments         = typeArguments;
 }
Esempio n. 4
0
        public EmitTypeBuilder DefineType(string ns, string name, EmitTypeKind kind = EmitTypeKind.Class,
                                          EmitVisibility visibility = EmitVisibility.Public, EmitTypeReference baseType   = null,
                                          IReadOnlyList <EmitTypeReference> implementedInterfaces = null, bool isAbstract = false,
                                          bool isSealed = false)
        {
            baseType = baseType ?? typeof(object);
            var typeBuilder = new EmitTypeBuilder(this, ns, name, kind, null, visibility, baseType, result => implementedInterfaces ?? new List <EmitTypeReference>(), isAbstract, isSealed);

            typeBuilders.Add(new EmitTypeReference(() => typeBuilder));
            return(typeBuilder);
        }
Esempio n. 5
0
 public EmitArrayType(EmitAssembly assembly, string ns, string name, EmitTypeKind kind, EmitType declaringType,
                      Func <EmitType, IReadOnlyList <EmitMemberReference> > membersFactory, EmitTypeReference baseType,
                      EmitType elementType, int rank
                      ) :
     base(assembly, ns, name, kind, declaringType, membersFactory, elementType.Visibility, baseType, _ => new List <EmitTypeReference>(), true, true)
 {
     ElementType = elementType;
     Rank        = rank;
 }