Exemple #1
0
 public ChatDetailInfo(WriteableBitmap bmp)
 {
     Content   = "";
     Mime      = ChatInfoType.Image;
     ID        = -1;
     IsFrom    = false;
     Timestamp = Util.GetTimeStamp(DateTime.Now);
     BmpSrc    = bmp;
 }
Exemple #2
0
 public ChatDetailInfo(int _id, String _content, String _mime, long _timestamp, String _type)
 {
     ID        = _id;
     Content   = new String(_content.ToCharArray());
     Timestamp = _timestamp * 1000;
     if (_mime.Contains("text"))
     {
         Mime = ChatInfoType.Text;
     }
     else
     {
         Content = "";
         Mime    = ChatInfoType.Image;
         JsonObject json = JsonObject.Parse(_content);
         String     type = json.GetNamedString("type", "unknown");
         if (!type.Equals("image"))
         {
             return;
         }
         JsonObject param = json.GetNamedObject("parameter", null);
         if (param == null)
         {
             return;
         }
         String filename = param.GetNamedString("filename", "");
         LoadImage(filename);
     }
     if (_type.Equals("from"))
     {
         IsFrom = true;
     }
     else
     {
         IsFrom = false;
     }
 }