public void SetBinary(int idx, byte[] bytevalue) { idx = ifNilInitArr2idx(idx); DxBaseValue v = arrayList[idx]; if (v != null && v.Type == ValueType.VT_Binary) { ((DxBinaryValue)v).Bytes = bytevalue; } else { DxBinaryValue bv = new DxBinaryValue(); bv.Bytes = bytevalue; arrayList[idx] = bv; } }
public DxValue(object v) { Type type = v.GetType(); if (type == typeof(bool)) { value = new DxBoolValue((bool)v); } else if (type == typeof(int) || type == typeof(uint) || type == typeof(short) || type == typeof(ushort) || type == typeof(byte) || type == typeof(sbyte)) { value = new DxIntValue((int)v); } else if (type == typeof(long) || type == typeof(ulong)) { value = new DxInt64Value((long)v); } else if (type == typeof(string)) { value = new DxStringValue((string)v); } else if (type == typeof(float)) { value = new DxFloatValue((float)v); } else if (type == typeof(double)) { value = new DxDoubleValue((double)v); } else if (type == typeof(DateTime)) { value = new DxDateTimeValue((DateTime)v); } else if (type == typeof(DxBaseValue)) { value = (DxBaseValue)v; } else if (type == typeof(byte[])) { DxBinaryValue bv = new DxBinaryValue(); bv.Bytes = (byte[])v; } }