CodeSnippetExpression 類別
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示常值 (Literal) 運算式。
public ref class CodeSnippetExpression : System::CodeDom::CodeExpression
C#
public class CodeSnippetExpression : System.CodeDom.CodeExpression
C#
[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
- 繼承
- 屬性
下列程式代碼範例示範如何使用常值代碼段建立 類別的 CodeSnippetExpression 實例。
// 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" );
C#
// 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")
常值表達式會將表達式的程式代碼儲存為常值代碼段。 CodeDOM 不會轉譯常值代碼段。 常值代碼段會儲存並輸出,就像是一樣。 提供包含常值程式代碼的CodeDOM物件,讓開發人員可以封裝已在目標語言中的程式碼。
屬性 Value 包含這個代碼段表達式的常值程序代碼。
Code |
初始化 CodeSnippetExpression 類別的新執行個體。 |
Code |
使用指定的常值運算式,來初始化 CodeSnippetExpression 類別的新執行個體。 |
User |
取得目前物件的使用者可定義資料。 (繼承來源 CodeObject) |
Value |
取得或設定程式碼的常值字串。 |
Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
Get |
做為預設雜湊函式。 (繼承來源 Object) |
Get |
取得目前執行個體的 Type。 (繼承來源 Object) |
Memberwise |
建立目前 Object 的淺層複製。 (繼承來源 Object) |
To |
傳回代表目前物件的字串。 (繼承來源 Object) |
產品 | 版本 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |