Uredi

CodePrimitiveExpression Class

Definition

Represents a primitive data type value.

public ref class CodePrimitiveExpression : System::CodeDom::CodeExpression
public class CodePrimitiveExpression : System.CodeDom.CodeExpression
type CodePrimitiveExpression = class
    inherit CodeExpression
Public Class CodePrimitiveExpression
Inherits CodeExpression
Inheritance
CodePrimitiveExpression

Examples

The following example demonstrates use of CodePrimitiveExpression to represent values of several primitive types.

// Represents a string.
CodePrimitiveExpression stringPrimitive = new CodePrimitiveExpression("Test String");
// Represents an integer.
CodePrimitiveExpression intPrimitive = new CodePrimitiveExpression(10);
// Represents a floating point number.
CodePrimitiveExpression floatPrimitive = new CodePrimitiveExpression(1.03189);
// Represents a null value expression.
CodePrimitiveExpression nullPrimitive = new CodePrimitiveExpression(null);
' Represents a string.
Dim stringPrimitive As New CodePrimitiveExpression("Test String")
' Represents an integer.
Dim intPrimitive As New CodePrimitiveExpression(10)
' Represents a floating point number.
Dim floatPrimitive As New CodePrimitiveExpression(1.03189)
' Represents a null value expression.
Dim nullPrimitive As New CodePrimitiveExpression(Nothing)

Remarks

CodePrimitiveExpression can be used to represent an expression that indicates a primitive data type value.

The Value property specifies the primitive data type value to represent.

Primitive data types that can be represented using CodePrimitiveExpression include null; string; 16-, 32-, and 64-bit signed integers; and single-precision and double-precision floating-point numbers.

Constructors

Name Description
CodePrimitiveExpression()

Initializes a new instance of the CodePrimitiveExpression class.

CodePrimitiveExpression(Object)

Initializes a new instance of the CodePrimitiveExpression class using the specified object.

Properties

Name Description
UserData

Gets the user-definable data for the current object.

(Inherited from CodeObject)
Value

Gets or sets the primitive data type to represent.

Applies to