예제 #1
0
 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);
 }
예제 #2
0
 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);
 }
예제 #3
0
 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;
 }
예제 #4
0
 internal static ZeroBasedIndex CheckLT(this ZeroBasedIndex lhs, int rhs, string parameterName)
 {
     if (lhs.CompareTo(rhs) >= 0)
     {
         throw new ArgumentOutOfRangeException(parameterName, String.Format("Expected a value < {0}", rhs));
     }
     return(lhs);
 }
예제 #5
0
        //# Returns a list of MethodSemantic rows associated with the method located at the given index.S
        internal IReadOnlyList <IntPtr> GetAssociations(ZeroBasedIndex methodIndex)
        {
            CheckDisposed();
            if (m_semanticsMap == null)
            {
                lock (m_lockObject) {
                    if (m_semanticsMap == null)
                    {
                        LoadMethodSemantics();
                    }
                }
            }

            IReadOnlyList <IntPtr> ret;

            m_semanticsMap.AssumeNotNull().TryGetValue(methodIndex, out ret);
            return(ret ?? new List <IntPtr>(0).AsReadOnly());
        }
예제 #6
0
 //# Returns the set of all types defined in the module, including nested types.
 internal TypeDefinition GetType(ZeroBasedIndex typeDefIndex)
 {
     EnsureTypesLoaded();
     return(m_allTypes[typeDefIndex.Value]);
 }
예제 #7
0
파일: Module.cs 프로젝트: scottwis/tiny
 //# Returns the set of all types defined in the module, including nested types.
 internal TypeDefinition GetType(ZeroBasedIndex typeDefIndex)
 {
     EnsureTypesLoaded();
     return m_allTypes[typeDefIndex.Value];
 }
예제 #8
0
파일: Module.cs 프로젝트: scottwis/tiny
        //# Returns a list of MethodSemantic rows associated with the method located at the given index.S
        internal IReadOnlyList<IntPtr> GetAssociations(ZeroBasedIndex methodIndex)
        {
            CheckDisposed();
            if (m_semanticsMap == null) {
                lock(m_lockObject) {
                    if (m_semanticsMap == null) {
                        LoadMethodSemantics();
                    }
                }
            }

            IReadOnlyList<IntPtr> ret;
            m_semanticsMap.AssumeNotNull().TryGetValue(methodIndex, out ret);
            return ret ?? new List<IntPtr>(0).AsReadOnly();
        }
예제 #9
0
 public static unsafe void *GetRow(this MetadataTable table, ZeroBasedIndex index, PEFile peFile)
 {
     return(peFile.CheckNotNull("peFile").GetRow(index, table));
 }