示例#1
0
        public void WriteBool(string name, bool value)
        {
            var node = PrepareBaseType(NodeValueType.Boolean, typeof(bool), name);

            byte[] bytes = FrameworkBitConverter.GetBytes(value);
            node.WriteBaseValue(bytes);
        }
示例#2
0
        public void WriteDecimal(string name, decimal value)
        {
            var node = PrepareBaseType(NodeValueType.Decimal, typeof(decimal), name);

            byte[] bytes = FrameworkBitConverter.GetBytes(value);
            node.WriteBaseValue(bytes);
        }
示例#3
0
        public void WriteGuid(string name, Guid value)
        {
            var node = PrepareBaseType(NodeValueType.Guid, typeof(Guid), name);

            byte[] bytes = FrameworkBitConverter.GetBytes(value);
            node.WriteBaseValue(bytes);
        }
示例#4
0
        public void WriteDouble(string name, double value)
        {
            var node = PrepareBaseType(NodeValueType.Double, typeof(double), name);

            byte[] bytes = FrameworkBitConverter.GetBytes(value);
            node.WriteBaseValue(bytes);
        }
示例#5
0
        public void WriteFloat(string name, float value)
        {
            var node = PrepareBaseType(NodeValueType.Float, typeof(float), name);

            byte[] bytes = FrameworkBitConverter.GetBytes(value);
            node.WriteBaseValue(bytes);
        }
示例#6
0
        public void WriteUInt64(string name, ulong value)
        {
            var node = PrepareBaseType(NodeValueType.UInt64, typeof(ulong), name);

            byte[] bytes = FrameworkBitConverter.GetBytes(value);
            node.WriteBaseValue(bytes);
        }
示例#7
0
        public void WriteInt32(string name, int value)
        {
            var node = PrepareBaseType(NodeValueType.Int32, typeof(int), name);

            byte[] bytes = FrameworkBitConverter.GetBytes(value);
            node.WriteBaseValue(bytes);
        }
示例#8
0
        public void WriteChar(string name, char value)
        {
            var node = PrepareBaseType(NodeValueType.Char, typeof(char), name);

            byte[] bytes = FrameworkBitConverter.GetBytes(value);
            node.WriteBaseValue(bytes);
        }
示例#9
0
        protected Packet CreateGUIDPacket()
        {
            Packet pkg = new Packet(0, (ushort)NodeValueType.Guid, (byte)PacketType.Guid, FrameworkBitConverter.GetBytes(context.guid));

            return(pkg);
        }