public void WriteBool(string name, bool value) { var node = PrepareBaseType(NodeValueType.Boolean, typeof(bool), name); byte[] bytes = FrameworkBitConverter.GetBytes(value); node.WriteBaseValue(bytes); }
public void WriteDecimal(string name, decimal value) { var node = PrepareBaseType(NodeValueType.Decimal, typeof(decimal), name); byte[] bytes = FrameworkBitConverter.GetBytes(value); node.WriteBaseValue(bytes); }
public void WriteGuid(string name, Guid value) { var node = PrepareBaseType(NodeValueType.Guid, typeof(Guid), name); byte[] bytes = FrameworkBitConverter.GetBytes(value); node.WriteBaseValue(bytes); }
public void WriteDouble(string name, double value) { var node = PrepareBaseType(NodeValueType.Double, typeof(double), name); byte[] bytes = FrameworkBitConverter.GetBytes(value); node.WriteBaseValue(bytes); }
public void WriteFloat(string name, float value) { var node = PrepareBaseType(NodeValueType.Float, typeof(float), name); byte[] bytes = FrameworkBitConverter.GetBytes(value); node.WriteBaseValue(bytes); }
public void WriteUInt64(string name, ulong value) { var node = PrepareBaseType(NodeValueType.UInt64, typeof(ulong), name); byte[] bytes = FrameworkBitConverter.GetBytes(value); node.WriteBaseValue(bytes); }
public void WriteInt32(string name, int value) { var node = PrepareBaseType(NodeValueType.Int32, typeof(int), name); byte[] bytes = FrameworkBitConverter.GetBytes(value); node.WriteBaseValue(bytes); }
public void WriteChar(string name, char value) { var node = PrepareBaseType(NodeValueType.Char, typeof(char), name); byte[] bytes = FrameworkBitConverter.GetBytes(value); node.WriteBaseValue(bytes); }
public ulong ReadUInt64(string name) { var child = FindChildNode(_cur, name, typeof(ulong), NodeValueType.UInt64); if (child == null) { throw new Exception(string.Format("The Node Can't Find Name : {0} ,Type : {1}", name, typeof(ulong))); } if (child.nodeType != NodeType.Node) { throw new Exception("The Child is Not Node"); } return(FrameworkBitConverter.ToUInt64(child.valuePacket.message, 0)); }
public bool ReadBool(string name) { var child = FindChildNode(_cur, name, typeof(bool), NodeValueType.Boolean); if (child == null) { throw new Exception(string.Format("The Node Can't Find Name : {0} ,Type : {1}", name, typeof(bool))); } if (child.nodeType != NodeType.Node) { throw new Exception("The Child is Not Node"); } return(FrameworkBitConverter.ToBoolean(child.valuePacket.message, 0)); }
protected Packet CreateGUIDPacket() { Packet pkg = new Packet(0, (ushort)NodeValueType.Guid, (byte)PacketType.Guid, FrameworkBitConverter.GetBytes(context.guid)); return(pkg); }
protected void ReadGUID(Packet pkg) { context.guid = FrameworkBitConverter.ToGuid(pkg.message, 0); }