Name

TypeAttributes

Synopsis

These attributes can be applied to a type. A type is either a class or interface, so either Class or Interface must be set. Most of the modifiers share the same keywords with C#, so they are easy to understand. The values prefixed with Nested indicate a class that is nested as well as its visibility.

public enum TypeAttributes {
   Class = 0x00000000,
   AutoLayout = 0x00000000,
   AnsiClass = 0x00000000,
   NotPublic = 0x00000000,
   Public = 0x00000001,
   NestedPublic = 0x00000002,
   NestedPrivate = 0x00000003,
   NestedFamily = 0x00000004,
   NestedAssembly = 0x00000005,
   NestedFamANDAssem = 0x00000006,
   VisibilityMask = 0x00000007,
   NestedFamORAssem = 0x00000007,
   SequentialLayout = 0x00000008,
   ExplicitLayout = 0x00000010,
   LayoutMask = 0x00000018,
   Interface = 0x00000020,
   ClassSemanticsMask = 0x00000020,
   Abstract = 0x00000080,
   Sealed = 0x00000100,
   SpecialName = 0x00000400,
   RTSpecialName = 0x00000800,
   Import = 0x00001000,
   Serializable = 0x00002000,
   UnicodeClass = 0x00010000,
   AutoClass = 0x00020000,
   StringFormatMask = 0x00030000,
   HasSecurity = 0x00040000,
   ReservedMask = 0x00040800,
   BeforeFieldInit = 0x00100000
}

Hierarchy

System.ObjectSystem.ValueTypeSystem.Enum(System.IComparable, System.IFormattable, System.IConvertible)TypeAttributes

Returned By

System.Type.{Attributes, GetAttributeFlagsImpl()}

Passed To

System.Reflection.Emit.ModuleBuilder.{DefineEnum(), DefineType()}, System.Reflection.Emit.TypeBuilder.DefineNestedType()

Get C# in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.