CodeSnippetExpression Klasa

Definicja

Reprezentuje wyrażenie literału.

public ref class CodeSnippetExpression : System::CodeDom::CodeExpression
public class CodeSnippetExpression : System.CodeDom.CodeExpression
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeSnippetExpression : System.CodeDom.CodeExpression
type CodeSnippetExpression = class
    inherit CodeExpression
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeSnippetExpression = class
    inherit CodeExpression
Public Class CodeSnippetExpression
Inherits CodeExpression
Dziedziczenie
CodeSnippetExpression
Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano, jak utworzyć wystąpienie CodeSnippetExpression klasy przy użyciu fragmentu kodu literału.

// Creates a CodeSnippetExpression that represents a literal string that
// can be used as an expression in a CodeDOM graph.
CodeSnippetExpression^ literalExpression =
   gcnew CodeSnippetExpression( "Literal expression" );
// Creates a CodeSnippetExpression that represents a literal string that
// can be used as an expression in a CodeDOM graph.
CodeSnippetExpression literalExpression =
    new CodeSnippetExpression("Literal expression");
' Creates a CodeSnippetExpression that represents a literal string that
' can be used as an expression in a CodeDOM graph.
Dim literalExpression As New CodeSnippetExpression("Literal expression")

Uwagi

Wyrażenie literału przechowuje kod wyrażenia jako fragment kodu literału. Element CodeDOM nie tłumaczy fragmentów kodu literału. Fragmenty kodu literału są przechowywane i wyjściowe tak samo jak są. Podano obiekty CodeDOM zawierające kod literału, aby deweloperzy mogli hermetyzować kod, który jest już w języku docelowym.

Właściwość Value zawiera kod literału dla tego wyrażenia fragmentu kodu.

Konstruktory

CodeSnippetExpression()

Inicjuje nowe wystąpienie klasy CodeSnippetExpression.

CodeSnippetExpression(String)

Inicjuje CodeSnippetExpression nowe wystąpienie klasy przy użyciu określonego wyrażenia literału.

Właściwości

UserData

Pobiera dane, które można definiować przez użytkownika dla bieżącego obiektu.

(Odziedziczone po CodeObject)
Value

Pobiera lub ustawia ciąg literału kodu.

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy