예제 #1
0
        // добавление\удаление в историю
        public SearchMangaType Toggle(ref ObservableCollection <InHistory> History)
        {
            switch (_is_added)
            {
            case SearchMangaType.ALREADY_ADDED:
                break;

            case SearchMangaType.NOT_ADDED:
                History.Insert(0, new InHistory(Manga));
                _is_added = SearchMangaType.NOW_ADDED;
                break;

            case SearchMangaType.NOW_ADDED:
                History.Remove(History.Single(InHistory => Manga.Compare(InHistory.Manga)));
                _is_added = SearchMangaType.NOT_ADDED;
                break;

            default:
                break;
            }

            RaiseProperty("is_added");
            return(_is_added);
        }