CodeSnippetExpression CodeSnippetExpression CodeSnippetExpression CodeSnippetExpression Class

Definition

Represents a literal expression.

public ref class CodeSnippetExpression : System::CodeDom::CodeExpression
[System.Runtime.InteropServices.ClassInterface]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Serializable]
public class CodeSnippetExpression : System.CodeDom.CodeExpression
type CodeSnippetExpression = class
    inherit CodeExpression
Public Class CodeSnippetExpression
Inherits CodeExpression
Inheritance
CodeSnippetExpressionCodeSnippetExpressionCodeSnippetExpressionCodeSnippetExpression
Attributes

Examples

The following code example demonstrates how to create an instance of the CodeSnippetExpression class using a literal code fragment.

// 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")

Remarks

A literal expression stores the code of an expression as a literal code fragment. The CodeDOM does not translate literal code fragments. Literal code fragments are stored and output just as they are. CodeDOM objects that contain literal code are provided so developers can encapsulate code that is already in the target language.

The Value property contains the literal code for this snippet expression.

Constructors

CodeSnippetExpression() CodeSnippetExpression() CodeSnippetExpression() CodeSnippetExpression()

Initializes a new instance of the CodeSnippetExpression class.

CodeSnippetExpression(String) CodeSnippetExpression(String) CodeSnippetExpression(String) CodeSnippetExpression(String)

Initializes a new instance of the CodeSnippetExpression class using the specified literal expression.

Properties

UserData UserData UserData UserData

Gets the user-definable data for the current object.

(Inherited from CodeObject)
Value Value Value Value

Gets or sets the literal string of code.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to