Example #1
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     if (!(elemType is ClassDef))
     {
         elemType.BuildMDTables(md);
     }
 }
Example #2
0
        internal override void BuildTables(MetaDataOut md)
        {
            if (parent is MethodRef || parent is ClassRef)
            {
                return;                                          // don't add it - fix by CK
            }
            md.AddToTable(MDTable.GenericParam, this);
            nameIx = md.AddToStringsHeap(name);
            // KJG note, Aug 2010.
            // The constraint metadata table (0x2c) holds four kinds of thing:
            // (1) TypeDef objects -- always already in table 0x2
            // (2) TypeRef objects -- must be entered in table 0x1
            // (3) ClassSpec objects -- entered in typespec table 0x1b
            // (4) GenericParamTypeSpec objects -- also in table 0x1b.
            //     These are generated on demand, for those GenericParam
            //     objects which do not have a TypeSpec already.
            // In the last three cases, 2 - 4, the objects should also
            // be offered up to the relevant metadata table.
            for (int i = 0; i < constraintTypes.Count; i++)
            {
                ClassSpec    constraintSpec;
                GenericParam constraintParam;
                Type         cType = constraintTypes[i];

                if (cType is ClassRef)
                {
                    cType.BuildMDTables(md);
                }
                else if ((constraintSpec = cType as ClassSpec) != null)
                {
                    // Fix by CK - should be BuildTables too??
                    // Yes it should (kjg) Aug 2010
                    md.ConditionalAddTypeSpec(cType);
                    cType.BuildMDTables(md); // Just in case genClass is a TypeRef
                }
                else if ((constraintParam = cType as GenericParam) != null)
                {
                    // AddTypeSpec creates GenericParamTypeSpec object and
                    // adds it to table 0x1b, if not already allocated.
                    // Replace GenericParam constraint on list by
                    // the GenericParamTypeSpec
                    cType = constraintParam.AddTypeSpec(md);
                }

                constraints.Add(new GenericParamConstraint(this, cType));
            }
        }
Example #3
0
 internal void BuildTables(MetaDataOut md)
 {
     Contract.Requires(md != null);
     if (!(type is ClassDef))
     {
         type.BuildMDTables(md);
     }
 }
Example #4
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Event, this);
     nameIx = md.AddToStringsHeap(name);
     eventType.BuildMDTables(md);
     for (int i = 0; i < tide; i++)
     {
         methods[i].BuildMDTables(md);
     }
 }
Example #5
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     if (!(cmodType is ClassDef))
     {
         cmodType.BuildMDTables(md);
     }
     if (!(type is ClassDef))
     {
         type.BuildMDTables(md);
     }
 }
Example #6
0
 internal void BuildTables(MetaDataOut md)
 {
     Contract.Requires(md != null);
     if (!retType.isDef())
     {
         retType.BuildMDTables(md);
     }
     for (int i = 0; i < numPars; i++)
     {
         if (!parTypes[i].isDef())
         {
             parTypes[i].BuildMDTables(md);
         }
     }
     for (int i = 0; i < numOptPars; i++)
     {
         if (!optParTypes[i].isDef())
         {
             optParTypes[i].BuildMDTables(md);
         }
     }
 }