/// <summary>
        /// Create a synthetic field and add it to the given declaring type.
        /// </summary>
        public static XSyntheticTypeDefinition Create(XModule module, XTypeDefinition declaringType, XSyntheticTypeFlags flags, string @namespace, string name, XTypeReference baseType, string fullScopeId)
        {
            var type = new XSyntheticTypeDefinition(module, declaringType, flags, @namespace, name, baseType, fullScopeId);
            if(declaringType != null)
                declaringType.Add(type);

            module.Register(type);
            return type;
        }
 /// <summary>
 /// Default ctor
 /// </summary>
 private XSyntheticTypeDefinition(XModule module, XTypeDefinition declaringType, XSyntheticTypeFlags flags, string @namespace, string name, XTypeReference baseType)
     : base(module, declaringType, flags.HasFlag(XSyntheticTypeFlags.ValueType), null)
 {
     this.flags = flags;
     this.@namespace = @namespace;
     this.name = name;
     this.baseType = baseType;
     fields = new List<XFieldDefinition>();
     methods = new List<XMethodDefinition>();
     nestedTypes = new List<XTypeDefinition>();
     interfaces = new List<XTypeReference>();
 }
 /// <summary>
 /// Default ctor
 /// </summary>
 private XSyntheticTypeDefinition(XModule module, XTypeDefinition declaringType, XSyntheticTypeFlags flags, string @namespace, string name, XTypeReference baseType)
     : base(module, declaringType, flags.HasFlag(XSyntheticTypeFlags.ValueType), null)
 {
     this.flags      = flags;
     this.@namespace = @namespace;
     this.name       = name;
     this.baseType   = baseType;
     fields          = new List <XFieldDefinition>();
     methods         = new List <XMethodDefinition>();
     nestedTypes     = new List <XTypeDefinition>();
     interfaces      = new List <XTypeReference>();
 }
Example #4
0
        protected override XTypeDefinition CreateXType(XTypeDefinition parentXType)
        {
            var typeDef = (XBuilder.ILTypeDefinition)XBuilder.AsTypeReference(Compiler.Module, Type)
                          .Resolve();

            string name = NameConverter.GetNullableClassName(typeDef.Name);

            XSyntheticTypeFlags xflags = default(XSyntheticTypeFlags);

            return(XSyntheticTypeDefinition.Create(Compiler.Module, parentXType, xflags,
                                                   typeDef.Namespace, name,
                                                   Compiler.Module.TypeSystem.Object,
                                                   string.Join(":", Type.Scope.Name, Type.MetadataToken.ToScopeId(), "Nullable")));
        }
 /// <summary>
 /// Create a synthetic field and add it to the given declaring type.
 /// </summary>
 public static XSyntheticTypeDefinition Create(XModule module, XTypeDefinition declaringType, XSyntheticTypeFlags flags, string @namespace, string name, XTypeReference baseType)
 {
     var type = new XSyntheticTypeDefinition(module, declaringType, flags, @namespace, name, baseType);
     declaringType.Add(type);
     return type;
 }
        /// <summary>
        /// Create a synthetic field and add it to the given declaring type.
        /// </summary>
        public static XSyntheticTypeDefinition Create(XModule module, XTypeDefinition declaringType, XSyntheticTypeFlags flags, string @namespace, string name, XTypeReference baseType)
        {
            var type = new XSyntheticTypeDefinition(module, declaringType, flags, @namespace, name, baseType);

            declaringType.Add(type);
            return(type);
        }
Example #7
0
        /// <summary>
        /// Create a synthetic field and add it to the given declaring type.
        /// </summary>
        public static XSyntheticTypeDefinition Create(XModule module, XTypeDefinition declaringType, XSyntheticTypeFlags flags, string @namespace, string name, XTypeReference baseType, string fullScopeId)
        {
            var type = new XSyntheticTypeDefinition(module, declaringType, flags, @namespace, name, baseType, fullScopeId);

            if (declaringType != null)
            {
                declaringType.Add(type);
            }

            module.Register(type);
            return(type);
        }