示例#1
0
        public override sealed void Read()
        {
            if (this.fullyRead)
            {
                return;
            }
            for (uint index = 1; (index <= this.Count); index++)
            {
                bool gotLock = false;
                Monitor.Enter(this.syncObject, ref gotLock);
                if (!(base.ItemLoaded(index)))
                {
                    this.fStream.Seek((this.streamOffset + ((index - 1) * this.__size)), SeekOrigin.Begin);
                    AssemblyHashAlgorithm hashAlgorithmId = ((AssemblyHashAlgorithm)(this.reader.ReadUInt32()));
                    QWordLongVersion      version         = new QWordLongVersion();
                    version.Read(this.reader);
                    CliMetadataAssemblyFlags flags = ((CliMetadataAssemblyFlags)(this.reader.ReadUInt32()));
                    uint publicKeyIndex;
                    switch (this.state)
                    {
                    case 1:
                    case 3:
                        publicKeyIndex = this.reader.ReadUInt32();
                        break;

                    default:
                        publicKeyIndex = this.reader.ReadUInt16();
                        break;
                    }
                    uint nameIndex;
                    uint cultureIndex;
                    switch (this.state)
                    {
                    case 2:
                    case 3:
                        nameIndex    = this.reader.ReadUInt32();
                        cultureIndex = this.reader.ReadUInt32();
                        break;

                    default:
                        nameIndex    = this.reader.ReadUInt16();
                        cultureIndex = this.reader.ReadUInt16();
                        break;
                    }
                    base.InjectLoadedItem(new CliMetadataAssemblyLockedTableRow(index, this.state, this.metadataRoot,
                                                                                hashAlgorithmId, version, flags,
                                                                                publicKeyIndex, nameIndex, cultureIndex), index);
                }
                if (gotLock)
                {
                    Monitor.Exit(this.syncObject);
                }
            }
            this.fullyRead = true;
        }
示例#2
0
        protected override sealed ICliMetadataAssemblyTableRow ReadElementAt(uint index)
        {
            bool gotLock = false;

            Monitor.Enter(this.syncObject, ref gotLock);
            if (index == 0)
            {
                return(null);
            }
            this.fStream.Seek((this.streamOffset + ((index - 1) * this.__size)), SeekOrigin.Begin);
            AssemblyHashAlgorithm hashAlgorithmId = ((AssemblyHashAlgorithm)(this.reader.ReadUInt32()));
            QWordLongVersion      version         = new QWordLongVersion();

            version.Read(this.reader);
            CliMetadataAssemblyFlags flags = ((CliMetadataAssemblyFlags)(this.reader.ReadUInt32()));
            uint publicKeyIndex;

            switch (this.state)
            {
            case 1:
            case 3:
                publicKeyIndex = this.reader.ReadUInt32();
                break;

            default:
                publicKeyIndex = this.reader.ReadUInt16();
                break;
            }
            uint nameIndex;
            uint cultureIndex;

            switch (this.state)
            {
            case 2:
            case 3:
                nameIndex    = this.reader.ReadUInt32();
                cultureIndex = this.reader.ReadUInt32();
                break;

            default:
                nameIndex    = this.reader.ReadUInt16();
                cultureIndex = this.reader.ReadUInt16();
                break;
            }
            if (gotLock)
            {
                Monitor.Exit(this.syncObject);
            }
            return(new CliMetadataAssemblyLockedTableRow(index, this.state, this.metadataRoot,
                                                         hashAlgorithmId, version, flags,
                                                         publicKeyIndex, nameIndex, cultureIndex));
        }
示例#3
0
        public override void Read()
        {
            if (this.fullyRead)
            {
                return;
            }
            for (uint index = 1; index <= this.Count; index++)
            {
                bool gotLock = false;
                System.Threading.Monitor.Enter(this.syncObject, ref gotLock);
                if (!base.ItemLoaded(index))
                {
                    this.fStream.Seek(this.streamOffset + (index - 1) * this.__size, SeekOrigin.Begin);
                    QWordLongVersion version = new QWordLongVersion();
                    version.Read(this.reader);
                    CliMetadataAssemblyFlags flags = ((CliMetadataAssemblyFlags)(this.reader.ReadUInt32()));
                    uint publicKeyOrTokenIndex;
                    switch (this.state)
                    {
                    case 1:
                    case 3:
                        publicKeyOrTokenIndex = this.reader.ReadUInt32();
                        break;

                    default:
                        publicKeyOrTokenIndex = this.reader.ReadUInt16();
                        break;
                    }
                    uint nameIndex;
                    uint cultureIndex;
                    switch (this.state)
                    {
                    case 2:
                    case 3:
                        nameIndex    = this.reader.ReadUInt32();
                        cultureIndex = this.reader.ReadUInt32();
                        break;

                    default:
                        nameIndex    = this.reader.ReadUInt16();
                        cultureIndex = this.reader.ReadUInt16();
                        break;
                    }
                    uint hashValueIndex;
                    switch (this.state)
                    {
                    case 1:
                    case 3:
                        hashValueIndex = this.reader.ReadUInt32();
                        break;

                    default:
                        hashValueIndex = this.reader.ReadUInt16();
                        break;
                    }
                    base.InjectLoadedItem(new CliMetadataAssemblyRefLockedTableRow(index, this.state, this.metadataRoot, version, flags, publicKeyOrTokenIndex, nameIndex, cultureIndex, hashValueIndex), index);
                }
                if (gotLock)
                {
                    System.Threading.Monitor.Exit(this.syncObject);
                }
            }
            this.fullyRead = true;
        }
示例#4
0
        protected override ICliMetadataAssemblyRefTableRow ReadElementAt(uint index)
        {
            bool gotLock = false;

            System.Threading.Monitor.Enter(this.syncObject, ref gotLock);
            if (index == 0)
            {
                return(null);
            }
            this.fStream.Seek(this.streamOffset + (index - 1) * this.__size, SeekOrigin.Begin);
            QWordLongVersion version = new QWordLongVersion();

            version.Read(this.reader);
            CliMetadataAssemblyFlags flags = ((CliMetadataAssemblyFlags)(this.reader.ReadUInt32()));
            uint publicKeyOrTokenIndex;

            switch (this.state)
            {
            case 1:
            case 3:
                publicKeyOrTokenIndex = this.reader.ReadUInt32();
                break;

            default:
                publicKeyOrTokenIndex = this.reader.ReadUInt16();
                break;
            }
            uint nameIndex;
            uint cultureIndex;

            switch (this.state)
            {
            case 2:
            case 3:
                nameIndex    = this.reader.ReadUInt32();
                cultureIndex = this.reader.ReadUInt32();
                break;

            default:
                nameIndex    = this.reader.ReadUInt16();
                cultureIndex = this.reader.ReadUInt16();
                break;
            }
            uint hashValueIndex;

            switch (this.state)
            {
            case 1:
            case 3:
                hashValueIndex = this.reader.ReadUInt32();
                break;

            default:
                hashValueIndex = this.reader.ReadUInt16();
                break;
            }
            if (gotLock)
            {
                System.Threading.Monitor.Exit(this.syncObject);
            }
            return(new CliMetadataAssemblyRefLockedTableRow(index, this.state, this.metadataRoot, version, flags, publicKeyOrTokenIndex, nameIndex, cultureIndex, hashValueIndex));
        }