Пример #1
0
        private void SearchItems()
        {
            IEnumerable <Dictionary.WordList> searchLists = GetSearchLists();

            foreach (Dictionary.WordList searchList in searchLists)
            {
                Dictionary.SearchResultsList resultList;
                if (searchList.Type == Dictionary.WordListTypes.Dictionary)
                {
                    resultList = searchList.NextWordsSearch(SearchQuery, 20);
                }
                else
                {
                    resultList = searchList.Search(SearchQuery);
                }
                foreach (var item in resultList.Items.Where(item => item.ShowVariants.ContainsValue("three-D") &&
                                                            (SearchQuery.ToLower() == "have" || _searchQuery.ToLower() == "has")))
                {
                    resultList.Items.Remove(item);//Эпичный костыль для контейнера Редхаус.Проблема где-то глубоко в ядре на плюсах
                    break;
                }
                if (resultList.Items.Count > 0)
                {
                    DictionaryListType listType = GetDictionaryListType(searchList.Type);
                    DictionaryList     list     = new DictionaryList(Utils.GetWordListName(searchList), listType, resultList.Items);
                    list.ItemClicked   += ListOnItemClicked;
                    list.HeaderClicked += ListOnHeaderClicked;

                    SearchResults.Add(list);
                }
            }
        }
Пример #2
0
        internal DictionaryList(string name, DictionaryListType type, ICollection <Dictionary.ListItem> items)
        {
            _itemsController = Mvx.Resolve <IItemsController>();

            Name     = name;
            Type     = type;
            Items    = new ObservableCollection <DictionaryItem>();
            TopItems = new ObservableCollection <DictionaryItem>();

            ItemClickCommand   = new Common.Mvvm.Command(ItemClickCommandImpl);
            HeaderClickCommand = new Common.Mvvm.Command(HeaderClickCommandImpl);

            Initialize(items);
        }