/// <summary> /// For multi-value storage key in string form /// </summary> public void SetStringKey(String KeyValue) { if (null != KeyValue) { KeyType = NmMvsKeyType.MvsKeyTypeString; ValuePointer = Marshal.StringToHGlobalUni(KeyValue); Length = KeyValue.Length; } else { throw new System.ArgumentNullException("NULL String pointer"); } }
/// <summary> /// For multi-value storage key in numeric form (64-bit) /// </summary> public void SetNumberKey(Int64 KeyValue) { KeyType = NmMvsKeyType.MvsKeyTypeNumber; ValuePointer = Marshal.AllocHGlobal(8); Marshal.WriteInt64(ValuePointer, KeyValue); Length = 8; }
/// <summary> /// For property in Array /// </summary> public void SetIndexKey(Int64 KeyValue) { KeyType = NmMvsKeyType.MvsKeyTypeArrayIndex; ValuePointer = Marshal.AllocHGlobal(8); Marshal.WriteInt64(ValuePointer, KeyValue); Length = 8; }
/// <summary> /// For multi-value storage key in byte array form /// </summary> public void SetByteArrayKey(byte[] KeyValue, Int32 KeyLength) { if (null != KeyValue) { KeyType = NmMvsKeyType.MvsKeyTypeByteArray; ValuePointer = Marshal.AllocHGlobal(KeyLength); for (int i = 0; i < KeyLength; ++i) { Marshal.WriteByte(ValuePointer, i, KeyValue[i]); } Length = KeyLength; } else { throw new System.ArgumentNullException("NULL KeyValue Byte Array."); } }
/// <summary> /// For multi-value storage key in byte array form /// </summary> public void SetByteArrayKey(byte[] KeyValue, Int32 KeyLength) { Type = NmMvsKeyType.MvsKeyTypeByteArray; ValuePointer = Marshal.AllocHGlobal(KeyLength); for (int i = 0; i < KeyLength; ++i) { Marshal.WriteByte(ValuePointer, i, KeyValue[i]); } Length = KeyLength; }
/// <summary> /// For multi-value storage key in string form /// </summary> public void SetStringKey(String KeyValue) { Type = NmMvsKeyType.MvsKeyTypeString; ValuePointer = Marshal.StringToHGlobalUni(KeyValue); Length = KeyValue.Length; }