public void Remove(ObservingGamePage page) { // remove page int num = gamesBook.PageNum (page); // unobserve TreePath path = new TreePath (new int[]{ num }); TreeIter iter; gamesStore.GetIter (out iter, path); gamesStore.Remove (ref iter); if (page.NeedsUnobserve) client.CommandSender. SendCommand ("unobserve " + page.GameId); gamesBook.RemovePage (num); currentGames.Remove (page.GameId); AdjustCursorForCurrentPage (); if (GamePageRemovedEvent != null) GamePageRemovedEvent (this, EventArgs. Empty); }
private void AddGamePage(MoveDetails details) { string title = String.Format ("{0} vs {1}", details.white, details.black); gamesStore.AppendValues (title, // markup title); ObservingGamePage info; bool myGame = ObservingGamePage.IsMyGame (details. relation); if (myGame) info = new PlayerPage (this, details); else info = new ObservingGamePage (this, details); currentGames[details.gameNumber] = info; Label label = new Label (title); gamesBook.AppendPage (info, label); gamesBook.Page = gamesBook.NPages - 1; if (GamePageAddedEvent != null) GamePageAddedEvent (this, new GamePageAddedEventArgs (myGame)); AdjustCursorForCurrentPage (); MovesGetter.GetMovesAsync (client, details.gameNumber, info.OnGetMoves); }