Пример #1
0
        void WriteTypeHeader(TypeDefinition type)
        {
            m_writer.Write(".class ");

            if ((type.Attributes & TypeAttributes.ClassSemanticMask) == TypeAttributes.Interface)
            {
                m_writer.Write("interface ");
            }

            int attributes = (int)type.Attributes;

            m_writer.WriteFlags(attributes, (int)TypeAttributes.VisibilityMask,
                                m_typeVisibilityVals, m_typeVisibilityMap);
            m_writer.WriteFlags(attributes, (int)TypeAttributes.LayoutMask,
                                m_typeLayoutVals, m_typeLayoutMap);
            m_writer.WriteFlags(attributes, (int)TypeAttributes.StringFormatMask,
                                m_typeFormatVals, m_typeFormatMap);
            m_writer.WriteFlags(attributes, m_typeVals, m_typeMap);

            m_writer.WriteLine(Formater.Escape(type.Name));

            if (type.BaseType != null)
            {
                m_writer.Indent();
                m_writer.Write("extends ");
                m_writer.WriteLine(Formater.Format(type.BaseType));
                m_writer.Unindent();
            }
        }
Пример #2
0
 void WriteMethodVisibility(MethodAttributes attributes)
 {
     m_writer.WriteFlags((int)attributes, (int)(ushort)MethodAttributes.MemberAccessMask,
                         m_methodVisibilityVals, m_methodVisibilityMap);
 }