コード例 #1
0
        unsafe Dictionary <uint, uint> CalculateFieldOffsets()
        {
            var  mdi   = readerModule.MetaDataImport;
            uint token = OriginalToken.Raw;
            var  fieldRidToFieldOffset = new Dictionary <uint, uint>();

            var fieldOffsets = MDAPI.GetFieldOffsets(mdi, token);

            fieldRidToFieldOffset.Clear();
            if (fieldOffsets != null)
            {
                foreach (var fo in fieldOffsets)
                {
                    if (fo.Offset != uint.MaxValue)
                    {
                        fieldRidToFieldOffset[fo.FieldToken & 0x00FFFFFF] = fo.Offset;
                    }
                }
            }
            return(fieldRidToFieldOffset);
        }