Esempio n. 1
0
 protected override void SaveJson(Stream s)
 {
     using (var w = new JsonStreamWriter(s))
     {
         w.WriteStartObject();
         w.WritePropertyName("key");
         w.WriteValue(Key);
         w.WriteEndObject();
         w.Flush();
     }
 }
Esempio n. 2
0
 protected override void SaveJson(Stream s)
 {
     using (var w = new JsonStreamWriter(s))
     {
         var skey = Convert.ToBase64String(SessionKey);
         w.WriteStartObject();
         w.WritePropertyName("skey");
         w.WriteValue(skey);
         w.WriteEndObject();
         w.Flush();
     }
 }
Esempio n. 3
0
 protected override void SaveJson(Stream s)
 {
     using (var w = new JsonStreamWriter(s))
     {
         w.WriteStartObject();
         w.WritePropertyName("usr");
         w.WriteValue(Username);
         w.WritePropertyName("msg");
         w.WriteValue(Message);
         w.WriteEndObject();
         w.Flush();
     }
 }
Esempio n. 4
0
 protected override void SaveJson(Stream s)
 {
     using (var w = new JsonStreamWriter(s))
     {
         w.WriteStartObject();
         w.WritePropertyName("login");
         w.WriteValue(Login);
         w.WritePropertyName("password");
         w.WriteValue(Password);
         w.WriteEndObject();
         w.Flush();
     }
 }
Esempio n. 5
0
 protected override void SaveJson(Stream s)
 {
     using (var w = new JsonStreamWriter(s))
     {
         w.WriteStartObject();
         w.WritePropertyName("result");
         w.WriteValue((int)Result);
         w.WritePropertyName("sid");
         w.WriteValue(SessionId.ToString());
         w.WriteEndObject();
         w.Flush();
     }
 }
Esempio n. 6
0
 protected override void SaveJson(Stream s)
 {
     using (var w = new JsonStreamWriter(s))
     {
         w.WriteStartObject();
         w.WritePropertyName("sid");
         w.WriteValue(SessionId.ToString());
         w.WritePropertyName("data");
         w.WriteValue(Convert.ToBase64String(Data));
         w.WriteEndObject();
         w.Flush();
     }
 }
 private void SaveJson(Stream s)
 {
     using (var w = new JsonStreamWriter(s))
     {
         var siv    = Convert.ToBase64String(iv, 0, iv.Length);
         var scdata = Convert.ToBase64String(cdata.GetBuffer(), 0, (int)cdata.Length);
         w.WriteStartObject();
         w.WritePropertyName("iv");
         w.WriteValue(siv);
         w.WritePropertyName("cdata");
         w.WriteValue(scdata);
         w.WriteEndObject();
         w.Flush();
     }
 }
Esempio n. 8
0
 private void SaveJson(Stream s)
 {
     using (var w = new JsonStreamWriter(s))
     {
         w.WriteStartObject();
         w.WritePropertyName("msz");
         w.WriteValue(Size);
         w.WritePropertyName("mid");
         w.WriteValue((int)Id);
         w.WritePropertyName("mflags");
         w.WriteValue((int)Flags);
         w.WriteEndObject();
         w.Flush();
     }
 }
Esempio n. 9
0
 protected override void SaveJson(Stream s)
 {
     using (var w = new JsonStreamWriter(s))
     {
         w.WriteStartObject();
         w.WritePropertyName("unames");
         w.WriteStartArray();
         foreach (var uname in Usernames)
         {
             w.WriteValue(uname);
         }
         w.WriteEndArray();
         w.WriteEndObject();
         w.Flush();
     }
 }
Esempio n. 10
0
 protected override void SaveJson(Stream s)
 {
     using (var w = new JsonStreamWriter(s))
     {
         w.WriteStartObject();
         w.WritePropertyName("usr");
         w.WriteValue(Username);
         w.WritePropertyName("file_name");
         w.WriteValue(FileName);
         w.WritePropertyName("file_size");
         w.WriteValue(FileSize);
         w.WritePropertyName("file_hash");
         w.WriteValue(Convert.ToBase64String(FileHash));
         w.WritePropertyName("block_size");
         w.WriteValue(BlockSize);
         w.WritePropertyName("sid");
         w.WriteValue(SessionId.ToString());
         w.WriteEndObject();
         w.Flush();
     }
 }