CodeSnippetExpression Class
TOC
Collapse the table of content
Expand the table of content

CodeSnippetExpression Class

 

Represents a literal expression.

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

System.Object
  System.CodeDom.CodeObject
    System.CodeDom.CodeExpression
      System.CodeDom.CodeSnippetExpression

[SerializableAttribute]
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
[ComVisibleAttribute(true)]
public class CodeSnippetExpression : CodeExpression

NameDescription
System_CAPS_pubmethodCodeSnippetExpression()

Initializes a new instance of the CodeSnippetExpression class.

System_CAPS_pubmethodCodeSnippetExpression(String)

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

NameDescription
System_CAPS_pubpropertyUserData

Gets the user-definable data for the current object.(Inherited from CodeObject.)

System_CAPS_pubpropertyValue

Gets or sets the literal string of code.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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.

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 = 
    new CodeSnippetExpression("Literal expression");

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft