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); }
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); } }
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(); } }