CodeTypeReferenceExpression Osztály
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Adattípusra mutató hivatkozást jelöl.
public ref class CodeTypeReferenceExpression : System::CodeDom::CodeExpression
public class CodeTypeReferenceExpression : System.CodeDom.CodeExpression
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeTypeReferenceExpression : System.CodeDom.CodeExpression
type CodeTypeReferenceExpression = class
inherit CodeExpression
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeTypeReferenceExpression = class
inherit CodeExpression
Public Class CodeTypeReferenceExpression
Inherits CodeExpression
- Öröklődés
- Attribútumok
Példák
Az alábbi példa egy típusra mutató hivatkozás ábrázolására használható CodeTypeReferenceExpression .
// Creates an expression referencing the System.DateTime type.
CodeTypeReferenceExpression typeRef1 = new CodeTypeReferenceExpression("System.DateTime");
// Create a C# code provider
CodeDomProvider provider = CodeDomProvider.CreateProvider("CSharp");
// Generate code and send the output to the console
provider.GenerateCodeFromExpression(typeRef1, Console.Out, new CodeGeneratorOptions());
// The code generator produces the following source code for the preceeding example code:
// System.DateTime
' Creates an expression referencing the System.DateTime type.
Dim typeRef1 As new CodeTypeReferenceExpression("System.DateTime")
' Create a Visual Basic code provider
Dim provider As CodeDomProvider = CodeDomProvider.CreateProvider("VisualBasic")
' Generate code and send the output to the console
provider.GenerateCodeFromExpression(typeRef1, Console.Out, New CodeGeneratorOptions())
' The code generator produces the following source code for the preceeding example code:
' Date
Megjegyzések
CodeTypeReferenceExpression segítségével hivatkozhat egy adott adattípusra.
A Type tulajdonság megadja a hivatkozni kívánt adattípust.
Konstruktorok
| Name | Description |
|---|---|
| CodeTypeReferenceExpression() |
Inicializálja a CodeTypeReferenceExpression osztály új példányát. |
| CodeTypeReferenceExpression(CodeTypeReference) |
Inicializálja az CodeTypeReferenceExpression osztály új példányát a megadott típussal. |
| CodeTypeReferenceExpression(String) |
Inicializálja az CodeTypeReferenceExpression osztály új példányát a megadott adattípusnév használatával. |
| CodeTypeReferenceExpression(Type) |
Inicializálja az osztály új példányát a CodeTypeReferenceExpression megadott adattípus használatával. |
Tulajdonságok
| Name | Description |
|---|---|
| Type |
Lekéri vagy beállítja az adattípust hivatkozásra. |
| UserData |
Lekéri az aktuális objektum felhasználó által definiálható adatait. (Öröklődés forrása CodeObject) |
Metódusok
| Name | Description |
|---|---|
| Equals(Object) |
Meghatározza, hogy a megadott objektum egyenlő-e az aktuális objektummal. (Öröklődés forrása Object) |
| GetHashCode() |
Ez az alapértelmezett kivonatoló függvény. (Öröklődés forrása Object) |
| GetType() |
Lekéri az Type aktuális példányt. (Öröklődés forrása Object) |
| MemberwiseClone() |
Az aktuális Objectpéldány sekély másolatát hozza létre. (Öröklődés forrása Object) |
| ToString() |
Az aktuális objektumot jelképező sztringet ad vissza. (Öröklődés forrása Object) |