internal SyncWorkItem(ODataOperation op, Bookmark bookmark, int serverId) { if (bookmark == null) throw new ArgumentNullException("bookmark"); this.Operation = op; this.Bookmark = bookmark; this.ServerId = serverId; }
private void ConfigureBookmark(Bookmark bookmark) { if (bookmark == null) throw new ArgumentNullException("bookmark"); // get... Button button = this.GetButton(bookmark.Ordinal); if (button == null) throw new InvalidOperationException("'button' is null."); // set it... button.Content = bookmark.Name; }
private void GetLatest() { Debug.WriteLine("Getting latest..."); BookmarksService service = new BookmarksService(); service.GetAll((Action<List<Bookmark>>)delegate(List<Bookmark> bookmarks) { // delete first... Bookmark.DeleteAll(); // go through and save them... foreach (Bookmark fromServer in bookmarks) { // we need to clone it as the ones that come from the server will have an id set. we // need to junk this id... Bookmark newBookmark = new Bookmark(); newBookmark.Ordinal = fromServer.Ordinal; newBookmark.Name = fromServer.Name; newBookmark.Url = fromServer.Url; // set the local only stuff... newBookmark.IsLocalModified = false; newBookmark.IsLocalDeleted = false; // save... newBookmark.SaveChanges(); } // signal that we've finished... this.Callback(); }, this.Failed); }