public LiftedList <T> LoadDirectChildren <T>( MetadataTable childTable, GetTokenDelegate tokenSelector, CreateObjectDelegateEX <T> factory, MetadataTable parentTable, void *parentRow ) where T : class { var firstMemberIndex = (ZeroBasedIndex)tokenSelector(parentRow); ZeroBasedIndex lastMemberIndex; var tableIndex = GetRowIndex(parentTable, parentRow); if (tableIndex == GetRowCount(parentTable) - 1) { lastMemberIndex = new ZeroBasedIndex(GetRowCount(childTable)); } else { lastMemberIndex = (ZeroBasedIndex)tokenSelector(GetRow(tableIndex + 1, parentTable)); } var ret = new LiftedList <T>( (lastMemberIndex - firstMemberIndex).Value, index => GetRow(firstMemberIndex + index, childTable), factory, () => IsDisposed ); return(ret); }
public HasFieldMarshal(MetadataTable table, ZeroBasedIndex index) { if (table != MetadataTable.Field && table != MetadataTable.Param) { throw new ArgumentOutOfRangeException("table"); } m_index = ((OneBasedIndex)index) | ((table == MetadataTable.Param ? 1u : 0u) << 1); }
public HasCustomAttribute(MetadataTable table, ZeroBasedIndex index) { uint value; if (!s_inverseTables.TryGetValue(table, out value)) { throw new ArgumentException("HasCustomAttributes does not support the provided meta-data table", "table"); } m_index = (OneBasedIndex)index | (value << 5); }
public TypeOrMethodDef(MetadataTable table, ZeroBasedIndex index) { if (table != MetadataTable.TypeDef && table != MetadataTable.MethodDef) { throw new ArgumentException("Expected TypeDef or MethodDef", "table"); } var tableId = (table == MetadataTable.TypeDef) ? 0u : 1u; m_index = ((OneBasedIndex)index << 1) | tableId; }
public void *GetRow(ZeroBasedIndex index, MetadataTable table) { CheckDisposed(); table.CheckDefined("table"); index.CheckGTE(0, "index"); index.CheckLT(GetRowCount(table), "index"); if (m_tables == null || m_tables[(int)table] == null) { throw new InvalidOperationException("Missing meta-data table."); } return(checked (m_tables[(int)table] + index.Value * GetRowSize(table))); }
public ISubList <T> LoadDirectChildren <T>( MetadataTable childTable, GetTokenDelegate tokenSelector, MetadataTable parentTable, void *parentRow, IReadOnlyList <T> sourceList ) where T : class { var firstMemberIndex = (ZeroBasedIndex)tokenSelector(parentRow); ZeroBasedIndex lastMemberIndex; var tableIndex = GetRowIndex(parentTable, parentRow); if (tableIndex == GetRowCount(parentTable) - 1) { lastMemberIndex = new ZeroBasedIndex(GetRowCount(childTable)); } else { lastMemberIndex = (ZeroBasedIndex)tokenSelector(GetRow(tableIndex + 1, parentTable)); } return(sourceList.SubList(firstMemberIndex.Value, (lastMemberIndex - firstMemberIndex).Value)); }
public Type ResolveTypeRef(ZeroBasedIndex index, Module module) { //TODO: Implement this throw new NotImplementedException(); }
public Type ParseTypeSpec(ZeroBasedIndex index, Module module) { //TODO: Implement this throw new NotImplementedException(); }
private IntPtr GetRowSafe(ZeroBasedIndex index, MetadataTable table) { return((IntPtr)GetRow(index, table)); }