This documentation is archived and is not being maintained.

CodeTypeDeclaration.TypeAttributes Property

Gets or sets the attributes of the type.

[Visual Basic]
Public Property TypeAttributes As TypeAttributes
public TypeAttributes TypeAttributes {get; set;}
public: __property TypeAttributes get_TypeAttributes();
public: __property void set_TypeAttributes(TypeAttributes);
public function get TypeAttributes() : TypeAttributes;
public function set TypeAttributes(TypeAttributes);

Property Value

A TypeAttributes that indicates the attributes of the type.


The TypeAttributes property contains the same type of values used by System.Reflection when investigating a type at run time. Many of these flags do not correspond to the type declaration syntax for some languages. As a result, only the following flags are significant to CodeTypeDeclaration: Class, Interface, Abstract, Sealed, Public, NotPublic, NestedPublic, and NestedPrivate.

Note   Some of the flags such as Abstract overlap with the meaning of flags in the the Attributes property of CodeTypeDeclaration that is inherited from CodeTypeMember. The Attributes property is a side-effect of the CodeTypeDeclaration class inheriting from CodeTypeMember so that classes can be nested. The flags in the TypeAttributes property should be used instead of the flags in the Attributes property.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

CodeTypeDeclaration Class | CodeTypeDeclaration Members | System.CodeDom Namespace | TypeAttributes