Пример #1
0
        private void LoadEnumEntries(Rfl.Enum type, IDiaSymbol dia_type)
        {
            IDiaEnumSymbols enum_entries;

            dia_type.findChildren(SymTagEnum.SymTagData, null, 0, out enum_entries);

            m_Logger.WriteSection("Reflecting Enum - {" + type.FullName.String + "}");

            foreach (IDiaSymbol symbol in enum_entries)
            {
                // The values of an enumeration are stored as the smallest type possible (sbyte, short, int)
                // so need casting to int (casting to uint gives out of range exceptions).
                int value = System.Convert.ToInt32(symbol.value);
                type.AddEntry(symbol.name, value);

                m_Logger.Write(symbol.name + " = " + value.ToString());
            }

            m_Logger.EndSection();
        }