Esempio n. 1
0
        public static PacketRawWriter SetValue <T>(this PacketRawWriter writer, T value)
        {
            ThrowIfArgumentError(writer);

            writer.stream.WriteValueGeneric(writer.converters, value);
            return(writer);
        }
Esempio n. 2
0
 private static void ThrowIfArgumentError(PacketRawWriter writer)
 {
     if (writer == null)
     {
         throw new ArgumentNullException(nameof(writer));
     }
     return;
 }
Esempio n. 3
0
        public static PacketRawWriter SetValue(this PacketRawWriter writer, object value, Type type)
        {
            ThrowIfArgumentError(type);
            ThrowIfArgumentError(writer);

            writer.stream.WriteValue(writer.converters, value, type);
            return(writer);
        }
Esempio n. 4
0
        public static PacketWriter SetItem(this PacketWriter writer, string key, PacketRawWriter raw)
        {
            ThrowIfArgumentError(key);
            ThrowIfArgumentError(writer);

            var itm = writer.GetDictionary();

            itm[key] = new PacketWriter(writer.converters, new PacketWriter.Item(raw?.stream));
            return(writer);
        }