Exemplo n.º 1
0
        private void NewWatchList(bool suppressAsk)
        {
            var result = true;

            if (_watches.Changes)
            {
                result = AskSaveChanges();
            }

            if (result || suppressAsk)
            {
                _watches.Clear();
                WatchListView.RowCount = _watches.Count;
                GeneralUpdate();
                UpdateWatchCount();
                UpdateStatusBar();
                _sortReverse  = false;
                _sortedColumn = "";

                PokeAddressToolBarItem.Enabled       =
                    FreezeAddressToolBarItem.Enabled =
                        SelectedIndices.Any() &&
                        SelectedWatches.All(w => w.Domain.Writable);
            }
        }
Exemplo n.º 2
0
        private async Task RemoveFromWatchlist(string movieTitle)
        {
            WatchList.Remove(movieTitle);

            var listString = JsonConvert.SerializeObject(WatchList);

            WatchList.Clear();

            Application.Current.Properties["myMovieList"] = null;
            await Application.Current.SavePropertiesAsync();

            Application.Current.Properties["myMovieList"] = listString;
            await Application.Current.SavePropertiesAsync();

            var           listofstring = Application.Current.Properties["myMovieList"] as string;
            List <string> newList      = JsonConvert.DeserializeObject <List <string> >(listofstring);

            foreach (var item in newList)
            {
                WatchList.Add(item);
            }

            IsAddVisible    = true;
            IsRemoveVisible = false;
        }
Exemplo n.º 3
0
        public void Clear()
        {
            Add();

            list.Clear();
            CollectionAssert.IsEmpty(list);

            var msg = server.DequeueAndAssertMessage <BuddyListMessage>();

            Assert.AreEqual(NotifyCollectionChangedAction.Reset, msg.ChangeAction);
        }
Exemplo n.º 4
0
        public void WatchListTriggersClear()
        {
            var wl = new WatchList<int>("carp");
            bool triggered = false;

            wl.AddRangeInternal(new int[] { 1, 2, 3 });

            wl.OnCollectionChanged += new CollectionChanged<int>(delegate(string name, IEnumerable<int> collection)
            {
                triggered = true;
            });

            wl.Clear();

            Assert.IsTrue(triggered);
        }
Exemplo n.º 5
0
        private void NewWatchList(bool suppressAsk)
        {
            var result = true;

            if (_watches.Changes)
            {
                result = AskSave();
            }

            if (result || suppressAsk)
            {
                _watches.Clear();
                WatchListView.ItemCount = _watches.ItemCount;
                UpdateWatchCount();
                UpdateStatusBar();
                _sortReverse  = false;
                _sortedColumn = string.Empty;
            }
        }