internal CliMetadataImportMapLockedTableRow(byte state, ICliMetadataRoot metadataRoot, PlatformInvokeCharacterSet mappingCharset, PlatformInvokeCallingConvention mappingCallingConvention, CliMetadataMemberForwardedTag memberForwardedSource, uint memberForwardedIndex, uint importNameIndex, uint importScopeIndex) { this.metadataRoot = metadataRoot; this.state = state; this.mappingCharset = mappingCharset; this.mappingCallingConvention = mappingCallingConvention; this.memberForwardedSource = memberForwardedSource; this.memberForwardedIndex = memberForwardedIndex; this.importNameIndex = importNameIndex; this.importScopeIndex = importScopeIndex; }
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); PlatformInvokeCharacterSet mappingCharset = ((PlatformInvokeCharacterSet)(this.reader.ReadByte())); PlatformInvokeCallingConvention mappingCallingConvention = ((PlatformInvokeCallingConvention)(this.reader.ReadByte())); uint memberForwardedIndex; CliMetadataMemberForwardedTag memberForwardedSource; switch (this.state) { case 1: case 3: case 5: case 7: memberForwardedIndex = this.reader.ReadUInt32(); break; default: memberForwardedIndex = this.reader.ReadUInt16(); break; } memberForwardedSource = ((CliMetadataMemberForwardedTag)((memberForwardedIndex & 1))); memberForwardedIndex = (memberForwardedIndex >> 1); uint importNameIndex; switch (this.state) { case 4: case 5: case 6: case 7: importNameIndex = this.reader.ReadUInt32(); break; default: importNameIndex = this.reader.ReadUInt16(); break; } uint importScopeIndex; switch (this.state) { case 2: case 3: case 6: case 7: importScopeIndex = this.reader.ReadUInt32(); break; default: importScopeIndex = this.reader.ReadUInt16(); break; } base.InjectLoadedItem(new CliMetadataImportMapLockedTableRow(this.state, this.metadataRoot, mappingCharset, mappingCallingConvention, memberForwardedSource, memberForwardedIndex, importNameIndex, importScopeIndex), index); } if (gotLock) { Monitor.Exit(this.syncObject); } } this.fullyRead = true; }
protected override sealed ICliMetadataImportMapTableRow 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); PlatformInvokeCharacterSet mappingCharset = ((PlatformInvokeCharacterSet)(this.reader.ReadByte())); PlatformInvokeCallingConvention mappingCallingConvention = ((PlatformInvokeCallingConvention)(this.reader.ReadByte())); uint memberForwardedIndex; CliMetadataMemberForwardedTag memberForwardedSource; switch (this.state) { case 1: case 3: case 5: case 7: memberForwardedIndex = this.reader.ReadUInt32(); break; default: memberForwardedIndex = this.reader.ReadUInt16(); break; } memberForwardedSource = ((CliMetadataMemberForwardedTag)((memberForwardedIndex & 1))); memberForwardedIndex = (memberForwardedIndex >> 1); uint importNameIndex; switch (this.state) { case 4: case 5: case 6: case 7: importNameIndex = this.reader.ReadUInt32(); break; default: importNameIndex = this.reader.ReadUInt16(); break; } uint importScopeIndex; switch (this.state) { case 2: case 3: case 6: case 7: importScopeIndex = this.reader.ReadUInt32(); break; default: importScopeIndex = this.reader.ReadUInt16(); break; } if (gotLock) { Monitor.Exit(this.syncObject); } return(new CliMetadataImportMapLockedTableRow(this.state, this.metadataRoot, mappingCharset, mappingCallingConvention, memberForwardedSource, memberForwardedIndex, importNameIndex, importScopeIndex)); }