Пример #1
0
        private string SaveMedia(byte[] image, JsonClasses.Snap snap)
        {
            string filename = Path.Combine(this.path, string.Format("{0}-{1}.{2}", snap.sn, snap.id, snap.m == 0 ? "jpg" : "mov"));

            File.WriteAllBytes(filename, image);
            return(filename);
        }
Пример #2
0
 public bool AddSnap(JsonClasses.Snap snap)
 {
     JsonClasses.Snap existing = this.connection.Table <JsonClasses.Snap>().Where <JsonClasses.Snap>(u => u.id.Equals(snap.id)).FirstOrDefault <JsonClasses.Snap>();
     if (existing != null)
     {
         return(false);
     }
     else
     {
         this.connection.Insert(snap);
         return(true);
     }
 }
Пример #3
0
 protected void NotifyTray(JsonClasses.Snap snap, string file)
 {
     if (this.InvokeRequired)
     {
         NotifySnapDelegate d = new NotifySnapDelegate(NotifyTray);
         this.Invoke(d, snap, file);
     }
     else
     {
         this.unseenCounter++;
         this.fileToOpen = file;
         this._notifyTray(string.Format("New snap from {0}!", snap.sn),
                          this.getNotifyPreview(file));
         this.UpdateNotifyText();
     }
 }