Ejemplo n.º 1
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Field, this);
     nameIx = md.AddToStringsHeap(name);
     if (!type.isDef())
     {
         type.BuildMDTables(md);
     }
     if (initVal != null)
     {
         FieldRVA rva = new FieldRVA(this, initVal);
         rva.BuildMDTables(md);
     }
     if (constVal != null)
     {
         ConstantElem constElem = new ConstantElem(this, constVal);
         constElem.BuildMDTables(md);
     }
     if (hasOffset)
     {
         FieldLayout layout = new FieldLayout(this, offset);
         layout.BuildMDTables(md);
     }
     if (marshalType != null)
     {
         FieldMarshal marshalInfo = new FieldMarshal(this, marshalType);
         marshalInfo.BuildMDTables(md);
     }
 }
Ejemplo n.º 2
0
        internal sealed override void BuildTables(MetaDataOut md)
        {
            md.AddToTable(MDTable.Method, this);
            nameIx = md.AddToStringsHeap(name);

            if (genericParams != null)
            {
                foreach (object genericParam in genericParams)
                {
                    ((GenericParam)genericParam).BuildMDTables(md);
                }
            }
            if (security != null)
            {
                foreach (object sec in security)
                {
                    ((DeclSecurity)sec).BuildMDTables(md);
                }
            }
            if (pinvokeImpl != null)
            {
                pinvokeImpl.BuildMDTables(md);
            }
            if (entryPoint)
            {
                md.SetEntryPoint(this);
            }
            if (locals != null)
            {
                localSig = new LocalSig(locals);
                localSig.BuildMDTables(md);
            }

            // The following code is done out of line in method
            // TraverseCode *after* all the method indices have
            // been allocated in the metadata.
            // (kjg, March 2010)
            //try {
            //  if (code != null) {
            //    if (code.IsEmpty()) {
            //      code = null;
            //    }
            //    else {
            //      code.BuildTables(md);
            //    }
            //  }
            //}
            //catch (InstructionException ex) {
            //  throw new Exception(ex.AddMethodName(name));
            //}


            parIx = md.TableIndex(MDTable.Param);
            for (int i = 0; i < sig.numPars; i++)
            {
                parList[i].seqNo = (ushort)(i + 1);
                parList[i].BuildMDTables(md);
            }
            sig.BuildTables(md);
        }
Ejemplo n.º 3
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(tabIx, this);
     foreach (Local local in locals)
     {
         local.BuildTables(md);
     }
 }
Ejemplo n.º 4
0
 internal void AddConstraints(MetaDataOut md)
 {
     Contract.Requires(md != null);
     foreach (GenericParamConstraint constraint in constraints)
     {
         md.AddToTable(MDTable.GenericParamConstraint, constraint);
     }
 }
Ejemplo n.º 5
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.AssemblyRef, this);
     keyIx  = md.AddToBlobHeap(keyBytes);
     nameIx = md.AddToStringsHeap(name);
     cultIx = md.AddToStringsHeap(culture);
     hashIx = md.AddToBlobHeap(hashBytes);
 }
Ejemplo n.º 6
0
 internal override Type AddTypeSpec(MetaDataOut md)
 {
     if (this.myTypeSpec == null)
     {
         this.myTypeSpec = new GenericParTypeSpec(this);
         md.AddToTable(MDTable.TypeSpec, this.myTypeSpec);
     }
     return(this.myTypeSpec);
 }
Ejemplo n.º 7
0
 // fix for Whidbey bug
 internal void AddGenericsToTable(MetaDataOut md)
 {
     if (genericParams != null)
     {
         foreach (object genericParam in genericParams)
         {
             md.AddToTable(MDTable.GenericParam, (GenericParam)genericParam);
         }
     }
 }
Ejemplo n.º 8
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.File, this);
     nameIx = md.AddToStringsHeap(name);
     hashIx = md.AddToBlobHeap(hashBytes);
     if (entryPoint)
     {
         md.SetEntryPoint(this);
     }
 }
Ejemplo n.º 9
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     if (!special)
     {
         md.AddToTable(MDTable.TypeRef, this);
         nameIx      = md.AddToStringsHeap(Name);
         nameSpaceIx = md.AddToStringsHeap(NameSpace);
     }
     parent.BuildMDTables(md);
 }
Ejemplo n.º 10
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);
     }
 }
Ejemplo n.º 11
0
 internal override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.MethodSpec, this);
     if (!(methParent is MethodDef)) // Never build a method def
     {
         methParent.BuildMDTables(md);
     }
     foreach (Type instType in instTypes)
     {
         instType.BuildMDTables(md);
     }
 }
Ejemplo n.º 12
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.ExportedType, this);
     nameSpaceIx = md.AddToStringsHeap(NameSpace);
     nameIx      = md.AddToStringsHeap(Name);
     if (implementation is ModuleRef)
     {
         ModuleFile mFile = ((ModuleRef)implementation).modFile;
         mFile.BuildMDTables(md);
         implementation = mFile;
     }
 }
Ejemplo n.º 13
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.ModuleRef, this);
     nameIx = md.AddToStringsHeap(name);
     if (modFile != null)
     {
         modFile.BuildMDTables(md);
     }
     foreach (object obj in exportedClasses)
     {
         ((ExternClass)obj).BuildMDTables(md);
     }
 }
Ejemplo n.º 14
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Assembly, this);
     nameIx = md.AddToStringsHeap(name);
     cultIx = md.AddToStringsHeap(culture);
     keyIx  = md.AddToBlobHeap(publicKey);
     if (security != null)
     {
         foreach (object dclSecurity in security)
         {
             ((DeclSecurity)dclSecurity).BuildMDTables(md);
         }
     }
 }
Ejemplo n.º 15
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Module, this);
     nameIx = md.AddToStringsHeap(name);
     mvidIx = md.AddToGUIDHeap(mvid);
     defaultClass.BuildTables(md);
     foreach (object cls in classes)
     {
         ((Class)cls).BuildMDTables(md);
     }
     foreach (ManifestResource rsrc in resources)
     {
         rsrc.BuildMDTables(md);
     }
 }
Ejemplo n.º 16
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.StandAloneSig, this);
     for (int i = 0; i < numPars; i++)
     {
         parTypes[i].BuildMDTables(md);
     }
     if (numOptPars > 0)
     {
         for (int i = 0; i < numOptPars; i++)
         {
             optParTypes[i].BuildMDTables(md);
         }
     }
 }
Ejemplo n.º 17
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));
            }
        }
Ejemplo n.º 18
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.MemberRef, this);
     nameIx = md.AddToStringsHeap(name);
     if (parent != null)
     {
         if (parent is ClassSpec)
         {
             md.ConditionalAddTypeSpec(parent);
         }
         if (parent is ConstructedTypeSpec)
         {
             md.ConditionalAddTypeSpec(((ConstructedTypeSpec)parent).Spec);
         }
         parent.BuildMDTables(md);
     }
     sig.BuildTables(md);
 }
Ejemplo n.º 19
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Property, this);
     nameIx = md.AddToStringsHeap(name);
     for (int i = 0; i < numPars; i++)
     {
         parList[i].BuildMDTables(md);
     }
     for (int i = 0; i < tide; i++)
     {
         methods[i].BuildMDTables(md);
     }
     if (constVal != null)
     {
         ConstantElem constElem = new ConstantElem(this, constVal);
         constElem.BuildMDTables(md);
     }
 }
Ejemplo n.º 20
0
        /*------------------------- internal functions --------------------------*/

        internal sealed override void BuildTables(MetaDataOut md)
        {
            md.AddToTable(tabIx, this);
            nameIx = md.AddToStringsHeap(name);
            if (type is ClassSpec)
            {
                md.ConditionalAddTypeSpec(type);
            }
            if (!type.isDef())
            {
                type.BuildMDTables(md);
            }
            if (parent != null)
            {
                if (parent is ClassSpec)
                {
                    md.ConditionalAddTypeSpec(parent);
                }
                parent.BuildMDTables(md);
            }
        }
Ejemplo n.º 21
0
        /*----------------------------- internal functions ------------------------------*/

        internal sealed override void BuildTables(MetaDataOut md)
        {
            md.AddToTable(tabIx, this);
        }
Ejemplo n.º 22
0
 /*----------------------------- internal functions ------------------------------*/
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(tabIx, this);
 }
Ejemplo n.º 23
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldMarshal, this);
     ntIx = md.AddToBlobHeap(nt.ToBlob());
 }
Ejemplo n.º 24
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(tabIx, this);
     foreach (Local local in locals)
     {
         local.BuildTables(md);
     }
 }
Ejemplo n.º 25
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.DeclSecurity, this);
     permissionIx = md.AddToBlobHeap(permissionSet);
 }
Ejemplo n.º 26
0
 // fix for Whidbey bug
 internal void AddGenericsToTable(MetaDataOut md)
 {
     Contract.Requires(md != null);
     //for (int i=0; i < methods.Count; i++) {
     //  ((MethodDef)methods[i]).AddGenericsToTable(md);
     //}
     for (int i = 0; i < genericParams.Count; i++)
     {
         md.AddToTable(MDTable.GenericParam, (GenericParam)genericParams[i]);
     }
 }
Ejemplo n.º 27
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.MemberRef, this);
     nameIx = md.AddToStringsHeap(name);
     if (parent != null)
     {
         if (parent is ClassSpec) md.ConditionalAddTypeSpec(parent);
         if (parent is ConstructedTypeSpec)
             md.ConditionalAddTypeSpec(((ConstructedTypeSpec)parent).Spec);
         parent.BuildMDTables(md);
     }
     sig.BuildTables(md);
 }
Ejemplo n.º 28
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     if (!special)
     {
         md.AddToTable(MDTable.TypeRef, this);
         nameIx = md.AddToStringsHeap(Name);
         nameSpaceIx = md.AddToStringsHeap(NameSpace);
     }
     parent.BuildMDTables(md);
 }
Ejemplo n.º 29
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldLayout, this);
 }
Ejemplo n.º 30
0
 internal override sealed 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);
     }
 }
Ejemplo n.º 31
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.ImplMap, this);
     iNameIx = md.AddToStringsHeap(importName);
     importScope.BuildMDTables(md);
 }
Ejemplo n.º 32
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.ModuleRef, this);
     nameIx = md.AddToStringsHeap(name);
     if (modFile != null) modFile.BuildMDTables(md);
     foreach (object obj in exportedClasses)
         ((ExternClass)obj).BuildMDTables(md);
 }
Ejemplo n.º 33
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.AssemblyRef, this);
     keyIx = md.AddToBlobHeap(keyBytes);
     nameIx = md.AddToStringsHeap(name);
     cultIx = md.AddToStringsHeap(culture);
     hashIx = md.AddToBlobHeap(hashBytes);
 }
Ejemplo n.º 34
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.File, this);
     nameIx = md.AddToStringsHeap(name);
     hashIx = md.AddToBlobHeap(hashBytes);
     if (entryPoint) md.SetEntryPoint(this);
 }
Ejemplo n.º 35
0
 // fix for Whidbey bug
 internal void AddGenericsToTable(MetaDataOut md)
 {
     if (genericParams != null)
     {
         foreach (object genericParam in genericParams)
         {
             md.AddToTable(MDTable.GenericParam, (GenericParam)genericParam);
         }
     }
 }
Ejemplo n.º 36
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Property, this);
     nameIx = md.AddToStringsHeap(name);
     for (int i = 0; i < numPars; i++)
         parList[i].BuildMDTables(md);
     for (int i = 0; i < tide; i++)
         methods[i].BuildMDTables(md);
     if (constVal != null)
     {
         ConstantElem constElem = new ConstantElem(this, constVal);
         constElem.BuildMDTables(md);
     }
 }
Ejemplo n.º 37
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Assembly, this);
     nameIx = md.AddToStringsHeap(name);
     cultIx = md.AddToStringsHeap(culture);
     keyIx = md.AddToBlobHeap(publicKey);
     if (security != null)
     {
         foreach (object dclSecurity in security)
         {
             ((DeclSecurity)dclSecurity).BuildMDTables(md);
         }
     }
 }
Ejemplo n.º 38
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Field, this);
     nameIx = md.AddToStringsHeap(name);
     if (!type.isDef()) type.BuildMDTables(md);
     if (initVal != null)
     {
         FieldRVA rva = new FieldRVA(this, initVal);
         rva.BuildMDTables(md);
     }
     if (constVal != null)
     {
         ConstantElem constElem = new ConstantElem(this, constVal);
         constElem.BuildMDTables(md);
     }
     if (hasOffset)
     {
         FieldLayout layout = new FieldLayout(this, offset);
         layout.BuildMDTables(md);
     }
     if (marshalType != null)
     {
         FieldMarshal marshalInfo = new FieldMarshal(this, marshalType);
         marshalInfo.BuildMDTables(md);
     }
 }
Ejemplo n.º 39
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.InterfaceImpl, this);
     if (!theInterface.isDef()) theInterface.BuildMDTables(md);
     if (theInterface is ClassSpec) md.ConditionalAddTypeSpec(theInterface);
 }
Ejemplo n.º 40
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldRVA, this);
     md.AddData(data);
 }
Ejemplo n.º 41
0
 /*------------------------- internal functions --------------------------*/
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(tabIx, this);
     nameIx = md.AddToStringsHeap(name);
     if (type is ClassSpec) md.ConditionalAddTypeSpec(type);
     if (!type.isDef())
         type.BuildMDTables(md);
     if (parent != null)
     {
       if (parent is ClassSpec) md.ConditionalAddTypeSpec(parent);
       parent.BuildMDTables(md);
     }
 }
Ejemplo n.º 42
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldLayout, this);
 }
Ejemplo n.º 43
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldRVA, this);
     md.AddData(data);
 }
Ejemplo n.º 44
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldMarshal, this);
     ntIx = md.AddToBlobHeap(nt.ToBlob());
 }
Ejemplo n.º 45
0
 internal void AddConstraints(MetaDataOut md)
 {
     Contract.Requires(md != null);
     foreach (GenericParamConstraint constraint in constraints)
     {
         md.AddToTable(MDTable.GenericParamConstraint, constraint);
     }
 }
Ejemplo n.º 46
0
 internal override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.MethodSpec, this);
     if (!(methParent is MethodDef)) // Never build a method def
         methParent.BuildMDTables(md);
     foreach (Type instType in instTypes)
     {
         instType.BuildMDTables(md);
     }
 }
Ejemplo n.º 47
0
 internal override Type AddTypeSpec(MetaDataOut md)
 {
     if (this.myTypeSpec == null) {
     this.myTypeSpec = new GenericParTypeSpec(this);
     md.AddToTable(MDTable.TypeSpec, this.myTypeSpec);
       }
       return this.myTypeSpec;
 }
Ejemplo n.º 48
0
        internal override sealed void BuildTables(MetaDataOut md)
        {
            md.AddToTable(MDTable.Method, this);
            nameIx = md.AddToStringsHeap(name);

            if (genericParams != null)
            {
                foreach (object genericParam in genericParams)
                {
                    ((GenericParam)genericParam).BuildMDTables(md);
                }
            }
            if (security != null)
            {
                foreach (object sec in security)
                {
                    ((DeclSecurity)sec).BuildMDTables(md);
                }
            }
            if (pinvokeImpl != null) pinvokeImpl.BuildMDTables(md);
            if (entryPoint) md.SetEntryPoint(this);
            if (locals != null)
            {
                localSig = new LocalSig(locals);
                localSig.BuildMDTables(md);
            }

              // The following code is done out of line in method
              // TraverseCode *after* all the method indices have
              // been allocated in the metadata.
              // (kjg, March 2010)
            //try {
            //  if (code != null) {
            //    if (code.IsEmpty()) {
            //      code = null;
            //    }
            //    else {
            //      code.BuildTables(md);
            //    }
            //  }
            //}
            //catch (InstructionException ex) {
            //  throw new Exception(ex.AddMethodName(name));
            //}

            parIx = md.TableIndex(MDTable.Param);
            for (int i = 0; i < sig.numPars; i++)
            {
                parList[i].seqNo = (ushort)(i + 1);
                parList[i].BuildMDTables(md);
            }
            sig.BuildTables(md);
        }
Ejemplo n.º 49
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));
              }
        }
Ejemplo n.º 50
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Module, this);
     nameIx = md.AddToStringsHeap(name);
     mvidIx = md.AddToGUIDHeap(mvid);
     defaultClass.BuildTables(md);
     foreach (object cls in classes)
     {
         ((Class)cls).BuildMDTables(md);
     }
     foreach (ManifestResource rsrc in resources)
     {
         rsrc.BuildMDTables(md);
     }
 }
Ejemplo n.º 51
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.StandAloneSig, this);
     for (int i = 0; i < numPars; i++)
     {
         parTypes[i].BuildMDTables(md);
     }
     if (numOptPars > 0)
     {
         for (int i = 0; i < numOptPars; i++)
         {
             optParTypes[i].BuildMDTables(md);
         }
     }
 }
Ejemplo n.º 52
0
        internal override sealed void BuildTables(MetaDataOut md)
        {
            // The processing of superTypes must be done either entirely
              // before or entirely after the processing of this TypeDef.
              // Otherwise the method indices will not be monotonic in table-2.

              if (superType != null) {
            superType.BuildMDTables(md);
            if (superType is ClassSpec) md.ConditionalAddTypeSpec(superType);
              }

              //uint startT = md.TableIndex(MDTable.TypeDef);
              //uint startM = md.TableIndex(MDTable.Method);

              md.AddToTable(MDTable.TypeDef, this);
              methodIx = md.TableIndex(MDTable.Method);
              fieldIx = md.TableIndex(MDTable.Field);

              //Console.WriteLine("Building tables for " + this.TypeName());
              //Console.WriteLine("tIx {0}, methods {1} - {2}",
              //  Hex.Short((short)startT),
              //  Hex.Short((short)startM),
              //  Hex.Short((short)md.TableIndex(MDTable.Method)));

              foreach (GenericParam genericParam in genericParams)
              {
              genericParam.BuildMDTables(md);
              }
            nameIx = md.AddToStringsHeap(Name);
              nameSpaceIx = md.AddToStringsHeap(NameSpace);
              if (security != null) {
            foreach (object sec in security)
            {
                ((DeclSecurity)sec).BuildMDTables(md);
            }
              }

              if (Layout != null) Layout.BuildMDTables(md);

              // Console.WriteLine("adding methods " + methods.Count);
              foreach (object method in methods)
              {
              ((MethodDef)method).BuildMDTables(md);
              }

            // Console.WriteLine("adding fields");
              foreach (object field in fields)
              {
              ((FieldDef)field).BuildMDTables(md);
              }
              // Console.WriteLine("adding interfaceimpls and methodimpls");
              if (interfaces.Count > 0) {
            for (int i = 0; i < interfaces.Count; i++) {
              ((InterfaceImpl)interfaces[i]).BuildMDTables(md);
            }
              }
              if (methodImpls.Count > 0) {
            foreach (object methodImpl in methodImpls)
            {
                ((MethodImpl)methodImpl).BuildMDTables(md);
            }
              }
              // Console.WriteLine("adding events and properties");
              if (events.Count > 0) {
            new MapElem(this, md.TableIndex(MDTable.Event), MDTable.EventMap).BuildMDTables(md);
            for (int i = 0; i < events.Count; i++) {
              ((Event)events[i]).BuildMDTables(md);
            }
              }
              if (properties.Count > 0) {
            new MapElem(this, md.TableIndex(MDTable.Property), MDTable.PropertyMap).BuildMDTables(md);
            for (int i = 0; i < properties.Count; i++) {
              ((Property)properties[i]).BuildMDTables(md);
            }
              }
              // Console.WriteLine("Adding nested classes");
              if (nestedClasses.Count > 0) {
            foreach (object nestedClass in nestedClasses)
            {
                ClassDef nClass = (ClassDef)nestedClass;
                nClass.BuildMDTables(md);
                new MapElem(nClass, this, MDTable.NestedClass).BuildTables(md);
            }
              }
              // Console.WriteLine("End of building tables");
        }
Ejemplo n.º 53
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.ExportedType, this);
     nameSpaceIx = md.AddToStringsHeap(NameSpace);
     nameIx = md.AddToStringsHeap(Name);
     if (implementation is ModuleRef)
     {
         ModuleFile mFile = ((ModuleRef)implementation).modFile;
         mFile.BuildMDTables(md);
         implementation = mFile;
     }
 }