A union holding a primitive value.
public struct PrimitiveValue : IEquatable<PrimitiveValue>, IConvertible
Constructors
Declaration
public PrimitiveValue(bool value)
Parameters
Type |
Name |
Description |
System.Boolean |
value |
|
Declaration
public PrimitiveValue(byte value)
Parameters
Type |
Name |
Description |
System.Byte |
value |
|
Declaration
public PrimitiveValue(char value)
Parameters
Type |
Name |
Description |
System.Char |
value |
|
Declaration
public PrimitiveValue(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Declaration
public PrimitiveValue(short value)
Parameters
Type |
Name |
Description |
System.Int16 |
value |
|
Declaration
public PrimitiveValue(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
Declaration
public PrimitiveValue(long value)
Parameters
Type |
Name |
Description |
System.Int64 |
value |
|
Declaration
public PrimitiveValue(sbyte value)
Parameters
Type |
Name |
Description |
System.SByte |
value |
|
Declaration
public PrimitiveValue(float value)
Parameters
Type |
Name |
Description |
System.Single |
value |
|
Declaration
public PrimitiveValue(ushort value)
Parameters
Type |
Name |
Description |
System.UInt16 |
value |
|
Declaration
public PrimitiveValue(uint value)
Parameters
Type |
Name |
Description |
System.UInt32 |
value |
|
Declaration
public PrimitiveValue(ulong value)
Parameters
Type |
Name |
Description |
System.UInt64 |
value |
|
Properties
If true, the struct does not contain a primitive value (i.e. has type
System.TypeCode.Empty).
Declaration
public bool isEmpty { get; }
Property Value
Type |
Description |
System.Boolean |
|
Type of value stored in the struct. System.TypeCode.Empty
if the struct does not hold a value (i.e. has been default-initialized).
Declaration
public TypeCode type { get; }
Property Value
Type |
Description |
System.TypeCode |
|
Methods
Declaration
public PrimitiveValue ConvertTo(TypeCode type)
Parameters
Type |
Name |
Description |
System.TypeCode |
type |
|
Returns
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
Declaration
public bool Equals(PrimitiveValue other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static PrimitiveValue From<TValue>(TValue value)
where TValue : struct
Parameters
Type |
Name |
Description |
TValue |
value |
|
Returns
Type Parameters
Declaration
public static PrimitiveValue FromBoolean(bool value)
Parameters
Type |
Name |
Description |
System.Boolean |
value |
|
Returns
Declaration
public static PrimitiveValue FromByte(byte value)
Parameters
Type |
Name |
Description |
System.Byte |
value |
|
Returns
Declaration
public static PrimitiveValue FromChar(char value)
Parameters
Type |
Name |
Description |
System.Char |
value |
|
Returns
Declaration
public static PrimitiveValue FromDouble(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
Declaration
public static PrimitiveValue FromInt16(short value)
Parameters
Type |
Name |
Description |
System.Int16 |
value |
|
Returns
Declaration
public static PrimitiveValue FromInt32(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
Returns
Declaration
public static PrimitiveValue FromInt64(long value)
Parameters
Type |
Name |
Description |
System.Int64 |
value |
|
Returns
Declaration
public static PrimitiveValue FromObject(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
Declaration
public static PrimitiveValue FromSByte(sbyte value)
Parameters
Type |
Name |
Description |
System.SByte |
value |
|
Returns
Declaration
public static PrimitiveValue FromSingle(float value)
Parameters
Type |
Name |
Description |
System.Single |
value |
|
Returns
Declaration
public static PrimitiveValue FromString(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
Declaration
public static PrimitiveValue FromUInt16(ushort value)
Parameters
Type |
Name |
Description |
System.UInt16 |
value |
|
Returns
Declaration
public static PrimitiveValue FromUInt32(uint value)
Parameters
Type |
Name |
Description |
System.UInt32 |
value |
|
Returns
Declaration
public static PrimitiveValue FromUInt64(ulong value)
Parameters
Type |
Name |
Description |
System.UInt64 |
value |
|
Returns
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
Declaration
public TypeCode GetTypeCode()
Returns
Type |
Description |
System.TypeCode |
|
Declaration
public bool ToBoolean(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public byte ToByte(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.Byte |
|
Declaration
public char ToChar(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.Char |
|
Declaration
public DateTime ToDateTime(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.DateTime |
|
Declaration
public decimal ToDecimal(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.Decimal |
|
Declaration
public double ToDouble(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.Double |
|
Declaration
public short ToInt16(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.Int16 |
|
Declaration
public int ToInt32(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.Int32 |
|
Declaration
public long ToInt64(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.Int64 |
|
Declaration
Returns
Type |
Description |
System.Object |
|
Declaration
public sbyte ToSByte(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.SByte |
|
Declaration
public float ToSingle(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.Single |
|
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.ValueType.ToString()
Declaration
public string ToString(IFormatProvider provider)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.String |
|
Declaration
public object ToType(Type conversionType, IFormatProvider provider)
Parameters
Type |
Name |
Description |
System.Type |
conversionType |
|
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.Object |
|
Declaration
public ushort ToUInt16(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.UInt16 |
|
Declaration
public uint ToUInt32(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.UInt32 |
|
Declaration
public ulong ToUInt64(IFormatProvider provider = null)
Parameters
Type |
Name |
Description |
System.IFormatProvider |
provider |
|
Returns
Type |
Description |
System.UInt64 |
|
Operators
Declaration
public static bool operator ==(PrimitiveValue left, PrimitiveValue right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static implicit operator PrimitiveValue(bool value)
Parameters
Type |
Name |
Description |
System.Boolean |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(byte value)
Parameters
Type |
Name |
Description |
System.Byte |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(char value)
Parameters
Type |
Name |
Description |
System.Char |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(short value)
Parameters
Type |
Name |
Description |
System.Int16 |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(long value)
Parameters
Type |
Name |
Description |
System.Int64 |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(sbyte value)
Parameters
Type |
Name |
Description |
System.SByte |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(float value)
Parameters
Type |
Name |
Description |
System.Single |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(ushort value)
Parameters
Type |
Name |
Description |
System.UInt16 |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(uint value)
Parameters
Type |
Name |
Description |
System.UInt32 |
value |
|
Returns
Declaration
public static implicit operator PrimitiveValue(ulong value)
Parameters
Type |
Name |
Description |
System.UInt64 |
value |
|
Returns
Declaration
public static bool operator !=(PrimitiveValue left, PrimitiveValue right)
Parameters
Returns
Type |
Description |
System.Boolean |
|