AddToTable() private method

private AddToTable ( MDTable tableIx, MetaDataElement elem ) : void
tableIx MDTable
elem MetaDataElement
return void
Exemplo n.º 1
0
 internal override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.MethodSpec,this);
     if (!(methParent is MethodDef)) // Never build a method def
         methParent.BuildMDTables(md);
     for (int i=0; i < instTypes.Length; i++) {
         instTypes[i].BuildMDTables(md);
     }
 }
Exemplo n.º 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);
     for (int i=0; i < constraints.Count; i++) {
         Class cClass = (Class)constraints[i];
         constraints[i] = new GenericParamConstraint(this,cClass);
         if (cClass is ClassRef) cClass.BuildMDTables(md);
         // Fix by CK - should be BuildTables too??
         if (cClass is ClassSpec) md.AddToTable(MDTable.TypeSpec, cClass);
     }
 }
Exemplo n.º 3
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.ImplMap,this);
     iNameIx = md.AddToStringsHeap(importName);
     importScope.BuildMDTables(md);
 }
Exemplo n.º 4
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldRVA,this);
     md.AddData(data);
 }
Exemplo n.º 5
0
 internal void AddConstraints(MetaDataOut md)
 {
     for (int i=0; i < constraints.Count; i++) {
         md.AddToTable(MDTable.GenericParamConstraint,(GenericParamConstraint)constraints[i]);
     }
 }
Exemplo n.º 6
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);
     }
 }
Exemplo n.º 7
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldMarshal,this);
     ntIx = md.AddToBlobHeap(nt.ToBlob());
 }
Exemplo n.º 8
0
 internal override sealed Type AddTypeSpec(MetaDataOut md)
 {
     if (typeSpecAdded) return this;
     md.AddToTable(MDTable.TypeSpec,this);
     BuildMDTables(md);
     typeSpecAdded = true;
     return this;
 }
Exemplo n.º 9
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Constant,this);
     valIx = cValue.GetBlobIndex(md);
 }
Exemplo n.º 10
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);
     }
 }
Exemplo n.º 11
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);
         }
     }
 }
Exemplo n.º 12
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Param,this);
     nameIx = md.AddToStringsHeap(pName);
     if (defaultVal != null) {
         ConstantElem constElem = new ConstantElem(this,defaultVal);
         constElem.BuildMDTables(md);
     }
     if (marshalType != null) {
         FieldMarshal marshalInfo = new FieldMarshal(this,marshalType);
         marshalInfo.BuildMDTables(md);
     }
 }
Exemplo n.º 13
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.ModuleRef,this);
     nameIx = md.AddToStringsHeap(name);
     if (modFile != null) modFile.BuildMDTables(md);
     for (int i=0; i < exportedClasses.Count; i++)
         ((ExternClass)exportedClasses[i]).BuildMDTables(md);
 }
Exemplo n.º 14
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Module,this);
     nameIx = md.AddToStringsHeap(name);
     mvidIx = md.AddToGUIDHeap(mvid);
     defaultClass.BuildTables(md);
     for (int i=0; i < classes.Count; i++) {
         ((Class)classes[i]).BuildMDTables(md);
     }
     for (int i=0; i < resources.Count; i++) {
         ((ManifestResource)resources[i]).BuildMDTables(md);
     }
 }
Exemplo n.º 15
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.DeclSecurity, this);
     permissionIx = md.AddToBlobHeap(permissionSet);
 }
Exemplo n.º 16
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;
     }
 }
Exemplo n.º 17
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);
     }
 }
Exemplo n.º 18
0
 // fix for Whidbey bug
 internal void AddGenericsToTable(MetaDataOut md)
 {
     //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]);
     }
 }
Exemplo n.º 19
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldLayout,this);
 }
Exemplo n.º 20
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.TypeDef,this);
     //if ((flags & (uint)TypeAttr.Interface) != 0) { superType = null; }
     if (superType != null) {
         superType.BuildMDTables(md);
         if (superType is ClassSpec) md.AddToTable(MDTable.TypeSpec,superType);
     }
     for (int i=0; i < genericParams.Count; i++) {
         ((GenericParam)genericParams[i]).BuildMDTables(md);
     }
     nameIx = md.AddToStringsHeap(name);
     nameSpaceIx = md.AddToStringsHeap(nameSpace);
     if (security != null) {
         for (int i=0; i < security.Count; i++) {
             ((DeclSecurity)security[i]).BuildMDTables(md);
         }
     }
     // Console.WriteLine("Building tables for " + name);
     if (layout != null) layout.BuildMDTables(md);
     // Console.WriteLine("adding methods " + methods.Count);
     methodIx = md.TableIndex(MDTable.Method);
     for (int i=0; i < methods.Count; i++) {
         ((MethodDef)methods[i]).BuildMDTables(md);
     }
     // Console.WriteLine("adding fields");
     fieldIx = md.TableIndex(MDTable.Field);
     for (int i=0; i < fields.Count; i++) {
         ((FieldDef)fields[i]).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) {
         for (int i=0; i < methodImpls.Count; i++) {
             ((MethodImpl)methodImpls[i]).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) {
         for (int i=0; i < nestedClasses.Count; i++) {
             ClassDef nClass = (ClassDef)nestedClasses[i];
             nClass.BuildMDTables(md);
             new MapElem(nClass,this,MDTable.NestedClass).BuildTables(md);
         }
     }
     // Console.WriteLine("End of building tables");
 }
Exemplo n.º 21
0
 /*------------------------- internal functions --------------------------*/
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(tabIx,this);
     nameIx = md.AddToStringsHeap(name);
     if (type is ClassSpec) md.AddToTable(MDTable.TypeSpec, type);
     if (!type.isDef())
         type.BuildMDTables(md);
     if (parent != null) {
         if (parent is ClassSpec) md.AddToTable(MDTable.TypeSpec,parent);
         parent.BuildMDTables(md);
     }
 }
Exemplo n.º 22
0
 internal override void BuildTables(MetaDataOut md)
 {
     if (!special) {
         md.AddToTable(MDTable.TypeRef,this);
         nameIx = md.AddToStringsHeap(name);
         nameSpaceIx = md.AddToStringsHeap(nameSpace);
     }
     scope.BuildMDTables(md);
 }
Exemplo n.º 23
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);
 }
Exemplo n.º 24
0
 internal override sealed Type AddTypeSpec(MetaDataOut md)
 {
     md.AddToTable(MDTable.TypeSpec,this);
     BuildMDTables(md);
     return this;
 }
Exemplo n.º 25
0
 internal override Type AddTypeSpec(MetaDataOut md)
 {
     // check that this generic parameter belongs to the "current" method ??
     GenericParTypeSpec tSpec = new GenericParTypeSpec(this);
     md.AddToTable(MDTable.TypeSpec,tSpec);
     return tSpec;
 }
Exemplo n.º 26
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(tabIx,this);
     type.BuildMDTables(md);
     // more adding to tables if data is not bytes
     if (changed || (byteVal == null)) {
         MemoryStream str = new MemoryStream();
         BinaryWriter bw = new BinaryWriter(str);
         bw.Write((ushort)1);
         if (argVals != null) {
             for (int i=0; i < argVals.Length; i++) {
                 argVals[i].Write(bw);
             }
         }
         bw.Write(numNamed);
         for (int i=0; i < numNamed; i++) {
             if (isField[i]) bw.Write(Field.FieldTag);
             else bw.Write(Property.PropertyTag);
             bw.Write(vals[i].GetTypeIndex());
             bw.Write(names[i]);  // check this is the right format!!!
             vals[i].Write(bw);
         }
         byteVal = str.ToArray();
     }
     valIx = md.AddToBlobHeap(byteVal);
 }
Exemplo n.º 27
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) {
         for (int i=0; i < security.Count; i++) {
             ((DeclSecurity)security[i]).BuildMDTables(md);
         }
     }
 }
Exemplo n.º 28
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(tabIx, this);
 }
Exemplo n.º 29
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.InterfaceImpl,this);
     if (!theInterface.isDef()) theInterface.BuildMDTables(md);
     if (theInterface is ClassSpec) md.AddToTable(MDTable.TypeSpec,theInterface);
 }
Exemplo n.º 30
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.MethodSemantics,this);
 }