ctrlX Data Layer API for .NET 5  2.1.0
Variant Class Reference

Variant class More...

Inheritance diagram for Variant:
IVariant INativeDisposable

Public Member Functions

 Variant ()
 Creates a Variant More...
 
 Variant (bool value)
 Creates a Variant More...
 
 Variant (bool[] value)
 Creates a Variant More...
 
 Variant (byte value)
 Creates a Variant More...
 
 Variant (byte[] value)
 Creates a Variant More...
 
 Variant (ByteBuffer flatBuffers)
 Creates a Variant More...
 
 Variant (double value)
 Creates a Variant More...
 
 Variant (double[] value)
 Creates a Variant More...
 
 Variant (FlatBufferBuilder builder)
 Creates a Variant More...
 
 Variant (float value)
 Creates a Variant More...
 
 Variant (float[] value)
 Creates a Variant More...
 
 Variant (int value)
 Creates a Variant More...
 
 Variant (int[] value)
 Creates a Variant More...
 
 Variant (IVariant other)
 Creates a Variant More...
 
 Variant (long value)
 Creates a Variant More...
 
 Variant (long[] value)
 Creates a Variant More...
 
 Variant (sbyte value)
 Creates a Variant More...
 
 Variant (sbyte[] value)
 Creates a Variant More...
 
 Variant (short value)
 Creates a Variant More...
 
 Variant (short[] value)
 Creates a Variant More...
 
 Variant (string value)
 Creates a Variant More...
 
 Variant (string[] value)
 Creates a Variant More...
 
 Variant (uint value)
 Creates a Variant More...
 
 Variant (uint[] value)
 Creates a Variant More...
 
 Variant (ulong value)
 Creates a Variant More...
 
 Variant (ulong[] value)
 Creates a Variant More...
 
 Variant (ushort value)
 Creates a Variant More...
 
 Variant (ushort[] value)
 Creates a Variant More...
 
DLR_RESULT CheckConvert (DLR_VARIANT_TYPE type)
 Checks if the Variant is convertable to given data type More...
 
Variant Clone ()
 Clones the Variant More...
 
void Dispose ()
 Dispose More...
 
override bool Equals (object obj)
 Returns true if this Variant equals given object More...
 
bool Equals (Variant other)
 Returns true if this Variant equals given Variant More...
 
override int GetHashCode ()
 Gets the HashCode of this Variant More...
 
bool ToBool ()
 Gets the value as bool More...
 
bool[] ToBoolArray ()
 Gets the value as bool array More...
 
byte ToByte ()
 Gets the value as byte More...
 
byte[] ToByteArray ()
 Gets the value as byte array More...
 
double ToDouble ()
 Gets the value as double More...
 
double[] ToDoubleArray ()
 Gets the value as double array More...
 
ByteBuffer ToFlatbuffers ()
 Gets the value as Flatbuffers More...
 
float ToFloat ()
 Gets the value as float More...
 
float[] ToFloatArray ()
 Gets the value as float array More...
 
short ToInt16 ()
 Gets the value as short More...
 
short[] ToInt16Array ()
 Gets the value as short array More...
 
int ToInt32 ()
 Gets the value as int More...
 
int[] ToInt32Array ()
 Gets the value as int array More...
 
long ToInt64 ()
 Gets the value as long More...
 
long[] ToInt64Array ()
 Gets the value as long array More...
 
byte[] ToRawByteArray ()
 Gets the value as raw byte array (UTF8) More...
 
sbyte ToSByte ()
 Gets the value as sbyte More...
 
sbyte[] ToSByteArray ()
 Gets the value as sbyte array More...
 
override string ToString ()
 Gets the value as string More...
 
string[] ToStringArray ()
 Gets the value as string array More...
 
ushort ToUInt16 ()
 Gets the value as ushort More...
 
ushort[] ToUInt16Array ()
 Gets the value as ushort array More...
 
uint ToUInt32 ()
 Gets the value as uint More...
 
uint[] ToUInt32Array ()
 Gets the value as uint array More...
 
ulong ToUInt64 ()
 Gets the value as ulong More...
 
ulong[] ToUInt64Array ()
 

Static Public Member Functions

static implicit operator Variant (bool source)
 
static implicit operator Variant (bool[] source)
 
static implicit operator Variant (byte source)
 
static implicit operator Variant (byte[] source)
 
static implicit operator Variant (ByteBuffer flatBuffers)
 
static implicit operator Variant (double source)
 
static implicit operator Variant (double[] source)
 
static implicit operator Variant (FlatBufferBuilder builder)
 
static implicit operator Variant (float source)
 
static implicit operator Variant (float[] source)
 
static implicit operator Variant (int source)
 
static implicit operator Variant (int[] source)
 
static implicit operator Variant (long source)
 
static implicit operator Variant (long[] source)
 
static implicit operator Variant (sbyte source)
 
static implicit operator Variant (sbyte[] source)
 
static implicit operator Variant (short source)
 
static implicit operator Variant (short[] source)
 
static implicit operator Variant (string source)
 
static implicit operator Variant (string[] source)
 
static implicit operator Variant (uint source)
 
static implicit operator Variant (uint[] source)
 
static implicit operator Variant (ulong source)
 
static implicit operator Variant (ulong[] source)
 
static implicit operator Variant (ushort source)
 
static implicit operator Variant (ushort[] source)
 
static bool operator!= (Variant x, Variant y)
 s Unequality Operator More...
 
static bool operator== (Variant x, Variant y)
 Equality Operator More...
 

Static Public Attributes

static readonly int DefaultFlatbuffersInitialSize = 1024
 Gets the default Flatbuffers initial size in bytes More...
 
static readonly Variant Empty = new(string.Empty)
 Gets a Variant with empty string value More...
 
static readonly Variant False = new(false)
 Gets a Variant with boolean value 'false' More...
 
static readonly Variant Null = new()
 Gets a Variant with no value of data type 'DLR_VARIANT_TYPE_UNKNOWN' More...
 
static readonly Variant One = new(1)
 Gets a Variant with value '1' of data type 'int' (Int32) More...
 
static readonly Variant True = new(true)
 Gets a Variant with boolean value 'true' More...
 
static readonly Variant Zero = new(0)
 Gets a Variant with value '0' of data type 'int' (Int32) More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Dispose the object More...
 

Properties

DLR_VARIANT_TYPE DataType [get]
 Gets the data type of the Variant More...
 
bool IsArray [get]
 Indicates whether the Variant is an array More...
 
bool IsBool [get]
 Indicates whether the Variant contains a boolean value More...
 
bool IsDisposed [get]
 Object is disposed More...
 
bool IsFlatbuffers [get]
 Indicates whether the Variant contains Flatbuffers More...
 
bool IsNull [get]
 Indicates whether the Variant is null More...
 
bool IsNumber [get]
 Indicates whether the Variant contains a numeric value Returns false for numeric arrays and booleans More...
 
bool IsString [get]
 Indicates whether the Variant contains a string value More...
 
string JsonDataType [get]
 Gets the Json data type of the Variant More...
 
DateTime Timestamp [get]
 Gets the Timestamp More...
 
object Value [get]
 Gets the value More...
 
- Properties inherited from IVariant
DLR_VARIANT_TYPE DataType [get]
 Gets the data type of the variant. More...
 
bool IsArray [get]
 Checks if the value is an array. More...
 
bool IsBool [get]
 Indicates whether the Variant contains a boolean value More...
 
bool IsFlatbuffers [get]
 Checks if the value is flatbuffers. More...
 
bool IsNull [get]
 Checks if the value is null. More...
 
bool IsNumber [get]
 Indicates whether the Variant contains a numeric value Returns false for numeric arrays and booleans More...
 
bool IsString [get]
 Indicates whether the Variant contains a string value More...
 
string JsonDataType [get]
 Gets the data type as JSON string. More...
 
DateTime Timestamp [get]
 Gets the time stamp of the variant. More...
 
object Value [get]
 Gets the value of the variant. More...
 
- Properties inherited from INativeDisposable
bool IsDisposed [get]
 Checks disposed More...
 

Detailed Description

Variant class

Definition at line 15 of file Variant.cs.

Constructor & Destructor Documentation

◆ Variant() [1/28]

Variant ( )
inline

Creates a Variant

Definition at line 128 of file Variant.cs.

Referenced by Variant.Clone(), and Variant.operator Variant().

◆ Variant() [2/28]

Variant ( IVariant  other)
inline

Creates a Variant

Exceptions
ArgumentNullExceptionArgument cannot be null.
InvalidOperationExceptionObject can't be created

Definition at line 141 of file Variant.cs.

◆ Variant() [3/28]

Variant ( bool  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 163 of file Variant.cs.

◆ Variant() [4/28]

Variant ( string  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 178 of file Variant.cs.

◆ Variant() [5/28]

Variant ( sbyte  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 192 of file Variant.cs.

◆ Variant() [6/28]

Variant ( short  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 206 of file Variant.cs.

◆ Variant() [7/28]

Variant ( int  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 220 of file Variant.cs.

◆ Variant() [8/28]

Variant ( long  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 234 of file Variant.cs.

◆ Variant() [9/28]

Variant ( byte  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 248 of file Variant.cs.

◆ Variant() [10/28]

Variant ( ushort  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 262 of file Variant.cs.

◆ Variant() [11/28]

Variant ( uint  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 276 of file Variant.cs.

◆ Variant() [12/28]

Variant ( ulong  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 290 of file Variant.cs.

◆ Variant() [13/28]

Variant ( float  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 304 of file Variant.cs.

◆ Variant() [14/28]

Variant ( double  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 318 of file Variant.cs.

◆ Variant() [15/28]

Variant ( bool[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 333 of file Variant.cs.

◆ Variant() [16/28]

Variant ( string[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 348 of file Variant.cs.

◆ Variant() [17/28]

Variant ( sbyte[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 363 of file Variant.cs.

◆ Variant() [18/28]

Variant ( short[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 378 of file Variant.cs.

◆ Variant() [19/28]

Variant ( int[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 393 of file Variant.cs.

◆ Variant() [20/28]

Variant ( long[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 408 of file Variant.cs.

◆ Variant() [21/28]

Variant ( byte[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 423 of file Variant.cs.

◆ Variant() [22/28]

Variant ( ushort[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 438 of file Variant.cs.

◆ Variant() [23/28]

Variant ( uint[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 453 of file Variant.cs.

◆ Variant() [24/28]

Variant ( ulong[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 468 of file Variant.cs.

◆ Variant() [25/28]

Variant ( float[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 483 of file Variant.cs.

◆ Variant() [26/28]

Variant ( double[]  value)
inline

Creates a Variant

Parameters
valueThe value of the Variant
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 498 of file Variant.cs.

◆ Variant() [27/28]

Variant ( ByteBuffer  flatBuffers)
inline

Creates a Variant

Parameters
flatBuffersThe Flatbuffers
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 513 of file Variant.cs.

◆ Variant() [28/28]

Variant ( FlatBufferBuilder  builder)
inline

Creates a Variant

Parameters
builderThe FlatBufferBuilder
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 528 of file Variant.cs.

Member Function Documentation

◆ CheckConvert()

DLR_RESULT CheckConvert ( DLR_VARIANT_TYPE  type)
inline

Checks if the Variant is convertable to given data type

Parameters
type
Returns
True if convertable, else False
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1717 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ Clone()

Variant Clone ( )
inline

Clones the Variant

Returns
Clone of the Variant
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1687 of file Variant.cs.

References Variant.IsDisposed, and Variant.Variant().

◆ Dispose() [1/2]

void Dispose ( )
inline

Dispose

Definition at line 114 of file Variant.cs.

◆ Dispose() [2/2]

virtual void Dispose ( bool  disposing)
inlineprotectedvirtual

Dispose the object

Parameters
disposing

Definition at line 68 of file Variant.cs.

References Variant.IsDisposed.

◆ Equals() [1/2]

override bool Equals ( object  obj)
inline

Returns true if this Variant equals given object

Parameters
objThe other object
Returns
True if equal, else False

Definition at line 551 of file Variant.cs.

Referenced by Variant.Equals(), Variant.operator!=(), and Variant.operator==().

◆ Equals() [2/2]

bool Equals ( Variant  other)
inline

Returns true if this Variant equals given Variant

Parameters
otherThe other Variant
Returns
True if equal, else False

Implements IVariant.

Definition at line 562 of file Variant.cs.

References Variant.DataType, Variant.Equals(), Variant.ToFlatbuffers(), and Variant.Value.

◆ GetHashCode()

override int GetHashCode ( )
inline

Gets the HashCode of this Variant

Returns
The HashCode

Implements IVariant.

Definition at line 600 of file Variant.cs.

References Variant.Value.

◆ operator Variant() [1/26]

static implicit operator Variant ( bool  source)
inlinestatic

Definition at line 1742 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [2/26]

static implicit operator Variant ( bool[]  source)
inlinestatic

Definition at line 1750 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [3/26]

static implicit operator Variant ( byte  source)
inlinestatic

Definition at line 1774 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [4/26]

static implicit operator Variant ( byte[]  source)
inlinestatic

Definition at line 1782 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [5/26]

static implicit operator Variant ( ByteBuffer  flatBuffers)
inlinestatic

Definition at line 1942 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [6/26]

static implicit operator Variant ( double  source)
inlinestatic

Definition at line 1902 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [7/26]

static implicit operator Variant ( double[]  source)
inlinestatic

Definition at line 1910 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [8/26]

static implicit operator Variant ( FlatBufferBuilder  builder)
inlinestatic

Definition at line 1934 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [9/26]

static implicit operator Variant ( float  source)
inlinestatic

Definition at line 1886 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [10/26]

static implicit operator Variant ( float[]  source)
inlinestatic

Definition at line 1894 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [11/26]

static implicit operator Variant ( int  source)
inlinestatic

Definition at line 1822 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [12/26]

static implicit operator Variant ( int[]  source)
inlinestatic

Definition at line 1830 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [13/26]

static implicit operator Variant ( long  source)
inlinestatic

Definition at line 1854 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [14/26]

static implicit operator Variant ( long[]  source)
inlinestatic

Definition at line 1862 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [15/26]

static implicit operator Variant ( sbyte  source)
inlinestatic

Definition at line 1758 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [16/26]

static implicit operator Variant ( sbyte[]  source)
inlinestatic

Definition at line 1766 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [17/26]

static implicit operator Variant ( short  source)
inlinestatic

Definition at line 1790 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [18/26]

static implicit operator Variant ( short[]  source)
inlinestatic

Definition at line 1798 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [19/26]

static implicit operator Variant ( string  source)
inlinestatic

Definition at line 1918 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [20/26]

static implicit operator Variant ( string[]  source)
inlinestatic

Definition at line 1926 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [21/26]

static implicit operator Variant ( uint  source)
inlinestatic

Definition at line 1838 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [22/26]

static implicit operator Variant ( uint[]  source)
inlinestatic

Definition at line 1846 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [23/26]

static implicit operator Variant ( ulong  source)
inlinestatic

Definition at line 1870 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [24/26]

static implicit operator Variant ( ulong[]  source)
inlinestatic

Definition at line 1878 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [25/26]

static implicit operator Variant ( ushort  source)
inlinestatic

Definition at line 1806 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [26/26]

static implicit operator Variant ( ushort[]  source)
inlinestatic

Definition at line 1814 of file Variant.cs.

References Variant.Variant().

◆ operator!=()

static bool operator!= ( Variant  x,
Variant  y 
)
inlinestatic

s Unequality Operator

Parameters
x
y
Returns
True if not equal, else False

Definition at line 664 of file Variant.cs.

References Variant.Equals().

◆ operator==()

static bool operator== ( Variant  x,
Variant  y 
)
inlinestatic

Equality Operator

Parameters
x
y
Returns
True if equal, else False

Definition at line 640 of file Variant.cs.

References Variant.Equals().

◆ ToBool()

bool ToBool ( )
inline

Gets the value as bool

Returns
The value as bool
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 897 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToBoolArray()

bool [] ToBoolArray ( )
inline

Gets the value as bool array

Returns
The value as bool array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1150 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToByte()

byte ToByte ( )
inline

Gets the value as byte

Returns
The value as byte
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 943 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToByteArray()

byte [] ToByteArray ( )
inline

Gets the value as byte array

Returns
The value as byte array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1220 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToDouble()

double ToDouble ( )
inline

Gets the value as double

Returns
The value as double
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1127 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToDoubleArray()

double [] ToDoubleArray ( )
inline

Gets the value as double array

Returns
The value as double array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1500 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToFlatbuffers()

ByteBuffer ToFlatbuffers ( )
inline

Gets the value as Flatbuffers

Returns
The value as Flatbuffers
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1612 of file Variant.cs.

References Variant.IsDisposed, Variant.IsFlatbuffers, and Variant.IsNull.

Referenced by Variant.Equals().

◆ ToFloat()

float ToFloat ( )
inline

Gets the value as float

Returns
The value as float
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1104 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToFloatArray()

float [] ToFloatArray ( )
inline

Gets the value as float array

Returns
The value as float array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1465 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToInt16()

short ToInt16 ( )
inline

Gets the value as short

Returns
The value as short
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 966 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToInt16Array()

short [] ToInt16Array ( )
inline

Gets the value as short array

Returns
The value as short array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1255 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToInt32()

int ToInt32 ( )
inline

Gets the value as int

Returns
The value as int
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1012 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToInt32Array()

int [] ToInt32Array ( )
inline

Gets the value as int array

Returns
The value as int array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1325 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToInt64()

long ToInt64 ( )
inline

Gets the value as long

Returns
The value as long
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1058 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToInt64Array()

long [] ToInt64Array ( )
inline

Gets the value as long array

Returns
The value as long array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1395 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToRawByteArray()

byte [] ToRawByteArray ( )
inline

Gets the value as raw byte array (UTF8)

Returns
The value as raw byte array (UTF8)
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1653 of file Variant.cs.

References Variant.IsDisposed, Variant.IsNull, and Variant.ToUInt32().

◆ ToSByte()

sbyte ToSByte ( )
inline

Gets the value as sbyte

Returns
The value as sbyte
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 920 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToSByteArray()

sbyte [] ToSByteArray ( )
inline

Gets the value as sbyte array

Returns
The value as sbyte array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1185 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToString()

override string ToString ( )
inline

Gets the value as string

Returns
The value as string
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 611 of file Variant.cs.

References Variant.IsDisposed, Variant.IsNull, and Variant.ToUInt32().

◆ ToStringArray()

string [] ToStringArray ( )
inline

Gets the value as string array

Returns
The value as string array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1535 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToUInt16()

ushort ToUInt16 ( )
inline

Gets the value as ushort

Returns
The value as ushort
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 989 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToUInt16Array()

ushort [] ToUInt16Array ( )
inline

Gets the value as ushort array

Returns
The value as ushort array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1290 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToUInt32()

uint ToUInt32 ( )
inline

Gets the value as uint

Returns
The value as uint
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1035 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

Referenced by Variant.ToRawByteArray(), and Variant.ToString().

◆ ToUInt32Array()

uint [] ToUInt32Array ( )
inline

Gets the value as uint array

Returns
The value as uint array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1360 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToUInt64()

ulong ToUInt64 ( )
inline

Gets the value as ulong

Returns
The value as ulong
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1081 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

◆ ToUInt64Array()

ulong [] ToUInt64Array ( )
inline

Gets the value as ulong array

Returns
The value as ulong array
Exceptions
ObjectDisposedExceptionCannot access a disposed object

Implements IVariant.

Definition at line 1430 of file Variant.cs.

References Variant.IsDisposed, and Variant.IsNull.

Member Data Documentation

◆ DefaultFlatbuffersInitialSize

readonly int DefaultFlatbuffersInitialSize = 1024
static

Gets the default Flatbuffers initial size in bytes

Definition at line 689 of file Variant.cs.

◆ Empty

readonly Variant Empty = new(string.Empty)
static

Gets a Variant with empty string value

Definition at line 709 of file Variant.cs.

◆ False

readonly Variant False = new(false)
static

Gets a Variant with boolean value 'false'

Definition at line 719 of file Variant.cs.

◆ Null

readonly Variant Null = new()
static

Gets a Variant with no value of data type 'DLR_VARIANT_TYPE_UNKNOWN'

Definition at line 694 of file Variant.cs.

◆ One

readonly Variant One = new(1)
static

Gets a Variant with value '1' of data type 'int' (Int32)

Definition at line 704 of file Variant.cs.

◆ True

readonly Variant True = new(true)
static

Gets a Variant with boolean value 'true'

Definition at line 714 of file Variant.cs.

◆ Zero

readonly Variant Zero = new(0)
static

Gets a Variant with value '0' of data type 'int' (Int32)

Definition at line 699 of file Variant.cs.

Property Documentation

◆ DataType

DLR_VARIANT_TYPE DataType
get

Gets the data type of the Variant

Exceptions
ObjectDisposedExceptionCannot access a disposed object

Definition at line 1570 of file Variant.cs.

Referenced by Variant.Equals().

◆ IsArray

bool IsArray
get

Indicates whether the Variant is an array

Exceptions
ObjectDisposedExceptionCannot access a disposed object

Definition at line 811 of file Variant.cs.

◆ IsBool

bool IsBool
get

Indicates whether the Variant contains a boolean value

Exceptions
ObjectDisposedExceptionCannot access a disposed object

Definition at line 845 of file Variant.cs.

◆ IsDisposed

◆ IsFlatbuffers

bool IsFlatbuffers
get

Indicates whether the Variant contains Flatbuffers

Exceptions
ObjectDisposedExceptionCannot access a disposed object

Definition at line 880 of file Variant.cs.

Referenced by Variant.ToFlatbuffers().

◆ IsNull

◆ IsNumber

bool IsNumber
get

Indicates whether the Variant contains a numeric value Returns false for numeric arrays and booleans

Exceptions
ObjectDisposedExceptionCannot access a disposed object

Definition at line 863 of file Variant.cs.

◆ IsString

bool IsString
get

Indicates whether the Variant contains a string value

Exceptions
ObjectDisposedExceptionCannot access a disposed object

Definition at line 828 of file Variant.cs.

◆ JsonDataType

string JsonDataType
get

Gets the Json data type of the Variant

Exceptions
ObjectDisposedExceptionCannot access a disposed object

Definition at line 1595 of file Variant.cs.

◆ Timestamp

DateTime Timestamp
get

Gets the Timestamp

Exceptions
ObjectDisposedExceptionCannot access a disposed object

Definition at line 730 of file Variant.cs.

◆ Value

object Value
get

Gets the value

Exceptions
ObjectDisposedExceptionCannot access a disposed object

Definition at line 747 of file Variant.cs.

Referenced by Variant.Equals(), and Variant.GetHashCode().


The documentation for this class was generated from the following file: