Пример #1
0
 public static void WriteByteNullable(byte?val, BinaryWriter binaryWriter)
 {
     MyMwcMessageOut.WriteBool(val.HasValue, binaryWriter);
     if (val.HasValue)
     {
         WriteByte(val.Value, binaryWriter);
     }
 }
Пример #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);
     }
 }
Пример #3
0
        public static void WriteNullableString(string value, BinaryWriter binaryWriter)
        {
            bool hasValue = value != null;

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