System [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.3300.0 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.CodeDom.CodeTypeMember System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch) System.Runtime.InteropServices.ComVisible(true)

can be used to represent code that declares a class, structure, interface, or enumeration. can be used to declare a type that is nested within another type.

The property specifies the base type or base types of the type being declared. The property contains the type members, which can include methods, fields, properties, comments and other types. The property indicates the values for the type declaration, which indicate the type category of the type. The , , , and methods indicate whether the type is a class, structure, enumeration, or interface type, respectively.

Some programming languages only support the declaration of reference types, or classes. To check a language-specific CodeDOM code generator for support for declaring interfaces, enumerations, or value types, call the method to test for the appropriate flags. indicates support for interfaces, indicates support for enumerations, and indicates support for value types such as structures.

You can build a class or a structure implementation in one complete declaration, or spread the implementation across multiple declarations. The property indicates whether the type declaration is complete or partial. Not all code generators support partial type declarations, so you should test for this support by calling the method with the flag .

Represents a type declaration for a class, structure, interface, or enumeration.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class with the specified name.

  The name for the new type.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CodeDom.CodeTypeReferenceCollection containing list of types from which this type is derived.

  To generate a class in Visual Basic that does not inherit from a base type, but that does implement one or more interfaces, you must include as the first item in the collection.

  In the .NET Framework version 2.0 you do not need the for if the interface you are implementing already exists and you are referring to it by type. For example, if you are implementing the interface and add it to the collection with this statement, ctd.BaseTypes.Add(New CodeTypeReference(typeof(ICollection))), you do not need the preceding ctd.BaseTypes.Add(New CodeTypeReference(GetType(Object))) statement.

  The following code illustrates the addition of a to the collection that refers to .

  [Visual Basic]

  `Dim ctd As New CodeTypeDeclaration("Class1") ctd.IsClass = True ctd.BaseTypes.Add(New CodeTypeReference(GetType(Object))) ctd.BaseTypes.Add(New CodeTypeReference("Interface1"))`

  [C#]

  `CodeTypeDeclaration ctd = new CodeTypeDeclaration("Class1"); ctd.IsClass = true; ctd.BaseTypes.Add(new CodeTypeReference(typeof(Object))); ctd.BaseTypes.Add(new CodeTypeReference("Interface1"));`

  The preceding code generates the equivalent of the following Visual Basic code.

  `Public Class Class1 Implements Interface1`

  However, the Visual Basic code actually generated is the following.

  `Public Class Class1 Inherits Object Implements Interface1`

  Gets the base types of the type.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool' To be added

  Gets or sets a value indicating whether the type is a class or reference type.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool' `CodeTypeDeclaration colorEnum=new CodeTypeDeclaration("Colors"); colorEnum.IsEnum=true; CodeMemberField memBlue=new CodeMemberField(typeof(int),"BLUE"); memBlue.InitExpression=new CodeSnippetExpression("2"); colorEnum.Members.Add(memBlue); colorEnum.Members.Add(new CodeMemberField(typeof(int),"Green"));` Generates the following code for the C# generator: `public enum Colors { BLUE = 2, Green, }`

  Gets or sets a value indicating whether the type is an enumeration.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool' To be added

  Gets or sets a value indicating whether the type is an interface.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  You can build a class or structure implementation in one complete declaration, or spread the implementation across multiple declarations. Implementations are commonly supplied in one complete type declaration. In this case, set the type declaration property to false, which indicates that the type declaration represents all details for the class or structure implementation.

  A partial type declaration makes it easier to build different portions of a class or structure implementation in different modules of your application. The partial type declarations can be stored in one source file, or spread across multiple source files that are eventually compiled together to form the combined type implementation.

  The C# language supports partial type declarations of classes and structures through the partial keyword. Visual Basic supports partial type declarations of classes and structures with the Partial keyword. Not all code generators support partial type declarations, so you should test for this support by calling the method with the flag .

  Partial type declarations are supported for classes and structures. If you specify a partial type declaration for an enumeration or interface, the generated code produces compiler errors.

  When supplying a class or structure implementation across multiple declarations, set the property to true for the initial declaration and all supplemental declarations. The initial declaration must fully specify the type signature, including access modifiers, inherited types, and implemented interfaces. The supplementary declarations do not need to re-specify the type signature. A compiler error typically results if you redefine the type signature in a supplementary declaration.

  Visual Studio 2005 uses partial types to separate user-generated code from designer code. In Visual Basic Windows Application projects, the user code is placed in a partial class that is not qualified by the Partial keyword; the designer-provided code appears in the partial class that has the Partial keyword. In C#, both the user code and designer code appear in partial classes identified by the partial keyword.

  Gets or sets a value indicating whether the type declaration is complete or partial.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool' To be added

  Gets or sets a value indicating whether the type is a value type (struct).

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CodeDom.CodeTypeMemberCollection To be added: an object of type 'CodeTypeMemberCollection' To be added

  Gets the collection of class members for the represented type.

- Event
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.EventHandler To be added

  Occurs when the collection is accessed for the first time.

- Event
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.EventHandler To be added

  Occurs when the collection is accessed for the first time.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Reflection.TypeAttributes To be added: an object of type 'Reflection.TypeAttributes'

  The property contains the same type of values used by 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 : , , , , , , , and .

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

  The pattern for setting the visibility flags (flags containing the words Public or Nested) is to mask out all visibility flags using the and then set the desired visibility flag. For example, the C# code statement to identify the (named cd) as an internal class is cd.TypeAttributes = (cd.TypeAttributes & ~TypeAttributes.VisibilityMask) | TypeAttributes.NotPublic;. The code to set the same value in Visual Basic is cd.TypeAttributes = (cd.TypeAttributes And (TypeAttributes.VisibilityMask Xor -1)) Or TypeAttributes.NotPublic. Setting the property directly to a visibility flag (cd.TypeAttributes = TypeAttributes.NotPublic;) erases all other flags that might be set.

  Gets or sets the attributes of the type.

- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.CodeDom.CodeTypeParameterCollection To be added.

  A generic type declaration contains one or more unspecified types known as type parameters. A type parameter name stands for the type within the body of the generic declaration. For example, the generic declaration for the class contains the type parameter .

  For more information on generics, see Generics in the .NET Framework Class Library.

  Gets the type parameters for the type declaration.