示例#1
0
        public async Task <ErrorBase> TrySearchCategories(string query, SearchType searchType)
        {
            if (!string.IsNullOrEmpty(query) && (query.Length == 1 || (query.Length == 2 && searchType == SearchType.People)) || string.IsNullOrEmpty(query) && searchType == SearchType.People)
            {
                if (searchType == SearchType.Tags)
                {
                    TagsPresenter.NotifySourceChanged(nameof(TrySearchCategories), true);
                }
                else
                {
                    UserFriendPresenter.NotifySourceChanged(nameof(TrySearchCategories), true);
                }

                return(null);
            }

            if (string.IsNullOrEmpty(query))
            {
                return(await TagsPresenter.TryGetTopTags());
            }

            if (searchType == SearchType.Tags)
            {
                return(await TagsPresenter.TryLoadNext(query));
            }

            return(await UserFriendPresenter.TryLoadNextSearchUser(query));
        }
示例#2
0
 public SearchPresenter()
 {
     UserFriendPresenter = new UserFriendPresenter();
     TagsPresenter       = new TagsPresenter();
 }