private static void UpdateLocalNote(Note localNote, NoteUpdate serverNote, NoteSyncType syncType) { // In each case, update existingNote's content and revision try { localNote.LoadForeignNoteXml(serverNote.XmlContent, ChangeType.OtherDataChanged); } catch {} // TODO: Handle exception in case that serverNote.XmlContent is invalid XML client.SetRevision(localNote, serverNote.LatestRevision); // Update dialog's sync status if (syncUI != null) { syncUI.NoteSynchronized(localNote.Title, syncType); } }
public void NoteSynchronized(string noteTitle, NoteSyncType type) { // This event handler will be called by the synchronization thread // so we have to use the delegate here to manipulate the GUI. Gtk.Application.Invoke(delegate { // FIXME: Change these strings to be more user-friendly // TODO: Update status for a note when status changes ("Uploading" -> "Uploaded", etc) string statusText = string.Empty; switch (type) { case NoteSyncType.DeleteFromClient: statusText = Catalog.GetString("Deleted locally"); break; case NoteSyncType.DeleteFromServer: statusText = Catalog.GetString("Deleted from server"); break; case NoteSyncType.DownloadModified: statusText = Catalog.GetString("Updated"); break; case NoteSyncType.DownloadNew: statusText = Catalog.GetString("Added"); break; case NoteSyncType.UploadModified: statusText = Catalog.GetString("Uploaded changes to server"); break; case NoteSyncType.UploadNew: statusText = Catalog.GetString("Uploaded new note to server"); break; } AddUpdateItem(noteTitle, statusText); }); }
public void NoteSynchronized (string noteTitle, NoteSyncType type) { // This event handler will be called by the synchronization thread // so we have to use the delegate here to manipulate the GUI. Gtk.Application.Invoke (delegate { // FIXME: Change these strings to be more user-friendly // TODO: Update status for a note when status changes ("Uploading" -> "Uploaded", etc) string statusText = string.Empty; switch (type) { case NoteSyncType.DeleteFromClient: statusText = Catalog.GetString ("Deleted locally"); break; case NoteSyncType.DeleteFromServer: statusText = Catalog.GetString ("Deleted from server"); break; case NoteSyncType.DownloadModified: statusText = Catalog.GetString ("Updated"); break; case NoteSyncType.DownloadNew: statusText = Catalog.GetString ("Added"); break; case NoteSyncType.UploadModified: statusText = Catalog.GetString ("Uploaded changes to server"); break; case NoteSyncType.UploadNew: statusText = Catalog.GetString ("Uploaded new note to server"); break; } AddUpdateItem (noteTitle, statusText); }); }
private static void UpdateLocalNote (Note localNote, NoteUpdate serverNote, NoteSyncType syncType) { // In each case, update existingNote's content and revision try { localNote.LoadForeignNoteXml (serverNote.XmlContent, ChangeType.OtherDataChanged); } catch {} // TODO: Handle exception in case that serverNote.XmlContent is invalid XML client.SetRevision (localNote, serverNote.LatestRevision); // Update dialog's sync status if (syncUI != null) syncUI.NoteSynchronized (localNote.Title, syncType); }
public void NoteSynchronized(string noteTitle, NoteSyncType type) { Logger.Debug("SilentUI: NoteSynchronized, Title: {0}, Type: {1}", noteTitle, type); }
public void NoteSynchronized (string noteTitle, NoteSyncType type) { Logger.Debug ("SilentUI: NoteSynchronized, Title: {0}, Type: {1}", noteTitle, type); }