Ejemplo n.º 1
0
 public static void WriteByteNullable(byte?val, BinaryWriter binaryWriter)
 {
     MyMwcMessageOut.WriteBool(val.HasValue, binaryWriter);
     if (val.HasValue)
     {
         WriteByte(val.Value, binaryWriter);
     }
 }
Ejemplo n.º 2
0
 public static void WriteStringDictionary(Dictionary <string, string> dictionary, BinaryWriter binaryWriter)
 {
     MyMwcMessageOut.WriteInt32(dictionary.Count, binaryWriter);
     foreach (var item in dictionary)
     {
         MyMwcMessageOut.WriteString(item.Key, binaryWriter);
         MyMwcMessageOut.WriteNullableString(item.Value, binaryWriter);
     }
 }
Ejemplo n.º 3
0
        public static void WriteNullableString(string value, BinaryWriter binaryWriter)
        {
            bool hasValue = value != null;

            MyMwcMessageOut.WriteBool(hasValue, binaryWriter);
            if (hasValue)
            {
                MyMwcMessageOut.WriteString(value, binaryWriter);
            }
        }