public void SearchMore()
        {
            int start = SearchResults.Last().sup_no / 10 + 1;

            WordFinder wordFinder = new WordFinder(SearchResults, (Visibility visibility) => {
                IsMasterProgressBarVisible = visibility;
                RaisePropertyChanged("IsMasterProgressBarVisible");
            }, (string text) =>
            {
                ErrorMessageText      = text;
                IsErrorMessageVisible = Visibility.Visible;
                RaisePropertyChanged("ErrorMessageText", "IsErrorMessageVisible");
            });

            wordFinder.GetSearchResults(start, 10, lastSearchedQuery, IsMoreButtonVisible, (visibility) => {
                IsMoreButtonVisible = visibility;
                RaisePropertyChanged("IsMoreButtonVisible");
            });
        }
        public void SearchWords()
        {
            IsErrorMessageVisible = Visibility.Collapsed;
            RaisePropertyChanged("IsErrorMessageVisible");

            if (NetworkCheck() == false)
            {
                return;
            }

            // 되돌리기 위한 기록
            History.RecordAll(Query, lastSearchedQuery, SearchResults, Definitions, SearchResultSelectedIndex, false, IsMoreButtonVisible);

            // 검색어 숫자 지우기
            string query = Regex.Replace(Query, @"/[1-9]/g", "");

            // 검색 결과 지우기
            SearchResults.Clear();
            // 뜻풀이 감추기
            IsDefinitionViewerVisible = Visibility.Collapsed;
            RaisePropertyChanged("SearchResultSelectedIndex", "IsDefinitionViewerVisible");

            lastSearchedQuery = query;
            WordFinder wordFinder = new WordFinder(SearchResults, (Visibility visibility) => {
                IsMasterProgressBarVisible = visibility;
                RaisePropertyChanged("IsMasterProgressBarVisible");
            }, (string text) =>
            {
                ErrorMessageText      = text;
                IsErrorMessageVisible = Visibility.Visible;
                RaisePropertyChanged("ErrorMessageText", "IsErrorMessageVisible");
            });

            wordFinder.GetSearchResults(1, 10, query, IsMoreButtonVisible, (visibility) => {
                IsMoreButtonVisible = visibility;
                RaisePropertyChanged("IsMoreButtonVisible");
            });

            RaisePropertyChanged("CanGoBack", "CanGoForward");
            //최근 검색어 기록
            RecentWordManager.Append(Query);
        }
Exemplo n.º 3
0
        public void SearchWords(string q)
        {
            this.Query = q;

            IsErrorMessageVisible = Visibility.Collapsed;
            RaisePropertyChanged("IsErrorMessageVisible");

            if (NetworkCheck() == false)
            {
                return;
            }

            // 검색어 숫자 지우기
            string query = Regex.Replace(Query, @"/[1-9]/g", "");

            // 검색 결과 지우기
            SearchResults.Clear();
            // 뜻풀이 감추기
            IsTitleBarBackButtonVisible = Visibility.Collapsed;
            SearchResultSelectedIndex   = -1;
            IsDefinitionViewerVisible   = Visibility.Collapsed;
            IsDetailGridVisible         = Visibility.Collapsed;
            RaisePropertyChanged("IsTitleBarBackButtonVisible", "SearchResultSelectedIndex", "IsDefinitionViewerVisible", "IsDetailGridVisible");

            WordFinder wordFinder = new WordFinder(SearchResults, (Visibility visibility) => {
                IsMasterProgressBarVisible = visibility;
                RaisePropertyChanged("IsMasterProgressBarVisible");
            }, (string text) =>
            {
                ErrorMessageText      = text;
                IsErrorMessageVisible = Visibility.Visible;
                RaisePropertyChanged("ErrorMessageText", "IsErrorMessageVisible");
            });

            wordFinder.GetSearchResults(1, 10, query, IsMoreButtonVisible, (visibility) => {
                IsMoreButtonVisible = visibility;
                RaisePropertyChanged("IsMoreButtonVisible");
            });
        }