예제 #1
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);
 }
예제 #2
0
 internal sealed override uint GetBlobIndex(MetaDataOut md)
 {
     if (addedToBlobHeap != md)
     {
         if (val == null)
         {
             blobIndex = md.AddToBlobHeap(strBytes);
         }
         else
         {
             blobIndex = md.AddToBlobHeap(val);
         }
         addedToBlobHeap = md;
     }
     return(blobIndex);
 }
예제 #3
0
        internal override void BuildSignatures(MetaDataOut md)
        {
            MemoryStream outSig = new MemoryStream();

            TypeSig(outSig);
            sigIx = md.AddToBlobHeap(outSig.ToArray());
        }
예제 #4
0
 /*----------------------------- internal functions ------------------------------*/
 internal override sealed void BuildSignatures(MetaDataOut md)
 {
     MemoryStream sig = new MemoryStream();
     sig.WriteByte(FieldTag);
     type.TypeSig(sig);
     sigIx = md.AddToBlobHeap(sig.ToArray());
     done = false;
 }
예제 #5
0
        internal override void BuildSignatures(MetaDataOut md)
        {
            MemoryStream str = new MemoryStream();

            TypeSig(str);
            sigIx = md.AddToBlobHeap(str.ToArray());
            done  = false;
        }
예제 #6
0
        internal sealed override void BuildSignatures(MetaDataOut md)
        {
            sig.BuildSignatures(md);
            MemoryStream sigStream = new MemoryStream();

            TypeSig(sigStream);
            sigIx = md.AddToBlobHeap(sigStream.ToArray());
            done  = false;
        }
예제 #7
0
 internal sealed override uint GetBlobIndex(MetaDataOut md)
 {
     if (addedToBlobHeap != md)
     {
         blobIndex       = md.AddToBlobHeap(val);
         addedToBlobHeap = md;
     }
     return(blobIndex);
 }
예제 #8
0
        /*----------------------------- internal functions ------------------------------*/

        internal sealed override void BuildSignatures(MetaDataOut md)
        {
            MemoryStream sig = new MemoryStream();

            sig.WriteByte(FieldTag);
            type.TypeSig(sig);
            sigIx = md.AddToBlobHeap(sig.ToArray());
            done  = false;
        }
예제 #9
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);
     }
 }
예제 #10
0
 internal sealed override uint GetBlobIndex(MetaDataOut md)
 {
     if (addedToBlobHeap != md)
     {
         MemoryStream str = new MemoryStream();
         BinaryWriter bw  = new BinaryWriter(str);
         Write(bw);
         blobIndex       = md.AddToBlobHeap(str.ToArray());
         addedToBlobHeap = md;
     }
     return(blobIndex);
 }
예제 #11
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);
         }
     }
 }
예제 #12
0
 internal sealed override uint GetBlobIndex(MetaDataOut md)
 {
     if (addedToBlobHeap != md)
     {
         blobIndex = md.AddToBlobHeap(val, size);
         //switch (size) {
         //  case (1) : blobIndex = md.AddToBlobHeap((byte)val); break;
         //  case (2) : blobIndex = md.AddToBlobHeap((ushort)val); break;
         //  case (4) : blobIndex = md.AddToBlobHeap((uint)val); break;
         //  default : blobIndex = md.AddToBlobHeap(val); break;
         //}
         addedToBlobHeap = md;
     }
     return(blobIndex);
 }
예제 #13
0
        internal sealed override void BuildSignatures(MetaDataOut md)
        {
            MemoryStream sig = new MemoryStream();

            sig.WriteByte(PropertyTag);
            MetaDataOut.CompressNum(BlobUtil.CompressUInt(numPars), sig);
            returnType.TypeSig(sig);
            for (int i = 0; i < numPars; i++)
            {
                parList[i].BuildSignatures(md);
                parList[i].TypeSig(sig);
            }
            typeBlobIx = md.AddToBlobHeap(sig.ToArray());
            done       = false;
        }
예제 #14
0
        internal sealed override void BuildSignatures(MetaDataOut md)
        {
            if (locals != null)
            {
                localSig.BuildSignatures(md);
                locToken = localSig.Token();
            }
            if (code != null)
            {
                // If the stack depth has not been explicity set, try to work out what is needed.
                if (maxStack == 0)
                {
                    try
                    {
                        // Set the flag to show if the return type is void or other.
                        code.ReturnsVoid = GetRetType().SameType(PrimitiveType.Void);

                        // Calculate the max stack depth
                        maxStack = code.GetMaxStackDepthRequired();
                    }
                    catch (CouldNotFindMaxStackDepth)
                    {
                        // Could not find the depth, assign the default
                        maxStack = DefaultMaxStackDepth;
                    }
                }
                code.CheckCode(locToken, initLocals, maxStack, md);
                textOffset = md.AddCode(code);
                if (Diag.DiagOn)
                {
                    Console.WriteLine("code offset = " + textOffset);
                }
            }
            sig.BuildSignatures(md);
            MemoryStream outSig = new MemoryStream();

            TypeSig(outSig);
            sigIx = md.AddToBlobHeap(outSig.ToArray());
            done  = false;
        }
예제 #15
0
        internal sealed override void BuildSignatures(MetaDataOut md)
        {
            MemoryStream sig = new MemoryStream();

            sig.WriteByte((byte)callConv);
            MetaDataOut.CompressNum(BlobUtil.CompressUInt(numPars + numOptPars), sig);
            retType.TypeSig(sig);
            for (int i = 0; i < numPars; i++)
            {
                parTypes[i].TypeSig(sig);
            }
            if (numOptPars > 0)
            {
                sig.WriteByte((byte)ElementType.Sentinel);
                for (int i = 0; i < numOptPars; i++)
                {
                    optParTypes[i].TypeSig(sig);
                }
            }
            sigIx = md.AddToBlobHeap(sig.ToArray());
            done  = false;
        }
예제 #16
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldMarshal, this);
     ntIx = md.AddToBlobHeap(nt.ToBlob());
 }
예제 #17
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);
 }
예제 #18
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);
         }
     }
 }
예제 #19
0
 internal sealed override void BuildSignatures(MetaDataOut md)
 {
     sigIx = md.AddToBlobHeap(SigBytes());
     done  = false;
 }
예제 #20
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);
 }
예제 #21
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.DeclSecurity, this);
     permissionIx = md.AddToBlobHeap(permissionSet);
 }
예제 #22
0
 internal override sealed void BuildSignatures(MetaDataOut md)
 {
     MemoryStream sig = new MemoryStream();
     sig.WriteByte(PropertyTag);
     MetaDataOut.CompressNum(BlobUtil.CompressUInt(numPars), sig);
     returnType.TypeSig(sig);
     for (int i = 0; i < numPars; i++)
     {
         parList[i].BuildSignatures(md);
         parList[i].TypeSig(sig);
     }
     typeBlobIx = md.AddToBlobHeap(sig.ToArray());
     done = false;
 }
예제 #23
0
 internal override sealed void BuildSignatures(MetaDataOut md)
 {
     sig.BuildSignatures(md);
     MemoryStream sigStream = new MemoryStream();
     TypeSig(sigStream);
     sigIx = md.AddToBlobHeap(sigStream.ToArray());
     done = false;
 }
예제 #24
0
        internal override sealed void BuildSignatures(MetaDataOut md)
        {
            if (locals != null)
            {
                localSig.BuildSignatures(md);
                locToken = localSig.Token();
            }
            if (code != null)
            {
                // If the stack depth has not been explicity set, try to work out what is needed.
                if (maxStack == 0)
                {
                    try
                    {

                        // Set the flag to show if the return type is void or other.
                        code.ReturnsVoid = GetRetType().SameType(PrimitiveType.Void);

                        // Calculate the max stack depth
                        maxStack = code.GetMaxStackDepthRequired();
                    }
                    catch (CouldNotFindMaxStackDepth)
                    {
                        // Could not find the depth, assign the default
                        maxStack = DefaultMaxStackDepth;
                    }
                }
                code.CheckCode(locToken, initLocals, maxStack, md);
                textOffset = md.AddCode(code);
                if (Diag.DiagOn) Console.WriteLine("code offset = " + textOffset);
            }
            sig.BuildSignatures(md);
            MemoryStream outSig = new MemoryStream();
            TypeSig(outSig);
            sigIx = md.AddToBlobHeap(outSig.ToArray());
            done = false;
        }
예제 #25
0
 internal override sealed void BuildSignatures(MetaDataOut md)
 {
     MemoryStream sig = new MemoryStream();
     sig.WriteByte((byte)callConv);
     MetaDataOut.CompressNum(BlobUtil.CompressUInt(numPars + numOptPars), sig);
     retType.TypeSig(sig);
     for (int i = 0; i < numPars; i++)
     {
         parTypes[i].TypeSig(sig);
     }
     if (numOptPars > 0)
     {
         sig.WriteByte((byte)ElementType.Sentinel);
         for (int i = 0; i < numOptPars; i++)
         {
             optParTypes[i].TypeSig(sig);
         }
     }
     sigIx = md.AddToBlobHeap(sig.ToArray());
     done = false;
 }
예제 #26
0
 internal override void BuildSignatures(MetaDataOut md)
 {
     MemoryStream outSig = new MemoryStream();
     TypeSig(outSig);
     sigIx = md.AddToBlobHeap(outSig.ToArray());
 }
예제 #27
0
 internal override sealed void BuildSignatures(MetaDataOut md)
 {
     sigIx = md.AddToBlobHeap(SigBytes());
     done = false;
 }
예제 #28
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.FieldMarshal, this);
     ntIx = md.AddToBlobHeap(nt.ToBlob());
 }
예제 #29
0
 internal override sealed uint GetBlobIndex(MetaDataOut md)
 {
     if (addedToBlobHeap != md)
     {
         MemoryStream str = new MemoryStream();
         BinaryWriter bw = new BinaryWriter(str);
         Write(bw);
         blobIndex = md.AddToBlobHeap(str.ToArray());
         addedToBlobHeap = md;
     }
     return blobIndex;
 }
예제 #30
0
 internal override void BuildSignatures(MetaDataOut md)
 {
     MemoryStream str = new MemoryStream();
     TypeSig(str);
     sigIx = md.AddToBlobHeap(str.ToArray());
     done = false;
 }
예제 #31
0
 internal override sealed uint GetBlobIndex(MetaDataOut md)
 {
     if (addedToBlobHeap != md)
     {
         blobIndex = md.AddToBlobHeap(val);
         addedToBlobHeap = md;
     }
     return blobIndex;
 }