Freigeben über


CodeObjectCreateExpression-Klasse

Stellt einen Ausdruck dar, der eine neue Instanz eines Typs erstellt.

Namespace: System.CodeDom
Assembly: System (in system.dll)

Syntax

'Declaration
<SerializableAttribute> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class CodeObjectCreateExpression
    Inherits CodeExpression
'Usage
Dim instance As CodeObjectCreateExpression
[SerializableAttribute] 
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
[ComVisibleAttribute(true)] 
public class CodeObjectCreateExpression : CodeExpression
[SerializableAttribute] 
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] 
[ComVisibleAttribute(true)] 
public ref class CodeObjectCreateExpression : public CodeExpression
/** @attribute SerializableAttribute() */ 
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
/** @attribute ComVisibleAttribute(true) */ 
public class CodeObjectCreateExpression extends CodeExpression
SerializableAttribute 
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
ComVisibleAttribute(true) 
public class CodeObjectCreateExpression extends CodeExpression

Hinweise

Mit CodeObjectCreateExpression kann ein Ausdruck dargestellt werden, der eine Instanz eines Typs erstellt.

Die CreateType-Eigenschaft gibt den Datentyp an, von dem eine neue Instanz erstellt werden soll. Die Parameters-Eigenschaft gibt die Parameter an, die an den Konstruktor des Typs übergeben werden, von dem eine neue Instanz erstellt werden soll.

Beispiel

Im folgenden Beispiel wird veranschaulicht, wie mithilfe von CodeObjectCreateExpression und unter Verwendung des Standardkonstruktors eine neue Instanz der System.DateTime-Klasse erstellt wird.

Dim objectCreate1 As New CodeObjectCreateExpression("System.DateTime", New CodeExpression() {})

' A Visual Basic code generator produces the following source code for the preceeding example code:    

'       New Date
CodeObjectCreateExpression objectCreate1 = new CodeObjectCreateExpression( "System.DateTime", new CodeExpression[] {} );            

// A C# code generator produces the following source code for the preceeding example code:    

//        new System.DateTime();
array<CodeExpression^>^temp0 = gcnew array<CodeExpression^>(0);
CodeObjectCreateExpression^ objectCreate1 = gcnew CodeObjectCreateExpression( "System.DateTime",temp0 );

// A C# code generator produces the following source code for the preceeding example code:
//        new System.DateTime();
CodeObjectCreateExpression objectCreate1 = new 
    CodeObjectCreateExpression("System.DateTime", 
    new CodeExpression[]{});
// A VJ# code generator produces the following source code for the 
// preceeding example code:    
//     new System.DateTime();

Vererbungshierarchie

System.Object
   System.CodeDom.CodeObject
     System.CodeDom.CodeExpression
      System.CodeDom.CodeObjectCreateExpression

Threadsicherheit

Alle öffentlichen statischen (Shared in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

CodeObjectCreateExpression-Member
System.CodeDom-Namespace