public GNIData SetData(string key, string value) { this.Initialize(); this.keyType = GNIDataType.String; this.keyString = key; this.valueType = GNIDataType.String; this.valueString = value; return(this); }
public GNIData SetData(byte[] key, byte[] value) { this.Initialize(); this.keyType = GNIDataType.ByteArray; this.keyBytes = key; this.valueType = GNIDataType.ByteArray; this.valueBytes = value; return(this); }
//Set functions public GNIData SetData(int key, int value) { this.Initialize(); this.keyType = GNIDataType.Short; this.keyInt = key; this.valueType = GNIDataType.Short; this.valueInt = value; return(this); }
public static int GetLengthLength(GNIDataType type) { switch (type) { case GNIDataType.None: return 0; case GNIDataType.Short: return 0; case GNIDataType.String: return 2; case GNIDataType.ByteArray: return 4; } return 1; }
public void Initialize() { keyType = GNIDataType.Short; valueType = GNIDataType.Short; encoding = GNIEncoding.ASCII; keyInt = -1; keyString = ""; keyBytes = new byte[0]; valueInt = 0; valueString = ""; valueBytes = new byte[0]; }
public GNIData(string key, string value) { keyType = GNIDataType.String; valueType = GNIDataType.String; encoding = GNIEncoding.ASCII; keyInt = -1; keyString = key; keyBytes = new byte[0]; valueInt = 0; valueString = value; valueBytes = new byte[0]; }
public GNIData(bool empty) { keyType = GNIDataType.Short; valueType = GNIDataType.Short; encoding = GNIEncoding.ASCII; keyInt = -1; keyString = ""; keyBytes = new byte[0]; valueInt = 0; valueString = ""; valueBytes = new byte[0]; }
public static int GetLengthLength(GNIDataType type) { switch (type) { case GNIDataType.None: return(0); case GNIDataType.Short: return(0); case GNIDataType.String: return(2); case GNIDataType.ByteArray: return(4); } return(1); }
public GNIData(string key, int value) { keyType = GNIDataType.String; valueType = GNIDataType.Short; encoding = GNIEncoding.ASCII; keyInt = -1; keyString = key; keyBytes = new byte[0]; valueInt = value; valueString = Convert.ToString(value); valueBytes = new byte[0]; }
public GNIData SetData(byte[] key, byte[] value) { this.Initialize(); this.keyType = GNIDataType.ByteArray; this.keyBytes = key; this.valueType = GNIDataType.ByteArray; this.valueBytes = value; return this; }
public GNIData SetData(string key, string value) { this.Initialize(); this.keyType = GNIDataType.String; this.keyString = key; this.valueType = GNIDataType.String; this.valueString = value; return this; }
//Set functions public GNIData SetData(int key, int value) { this.Initialize(); this.keyType = GNIDataType.Short; this.keyInt = key; this.valueType = GNIDataType.Short; this.valueInt = value; return this; }
public void Initialize() { keyType = GNIDataType.Short; valueType = GNIDataType.Short; encoding = GNIEncoding.ASCII; keyInt = -1; keyString = ""; keyBytes = new byte[0]; valueInt = 0; valueString = ""; valueBytes = new byte[0]; }