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)); }
public async Task GetPostVotersTest(KnownChains apiName, string url) { var presenter = new UserFriendPresenter() { VotersType = VotersType.All }; presenter.SetClient(Api[apiName]); Assert.IsTrue(presenter.Count == 0); var exception = await presenter.TryLoadNextPostVoters(url); Assert.IsTrue(exception == null); Assert.IsTrue(presenter.Count > 0); }
public async Task GetPostVotersTest(KnownChains apiName, string url) { await BasePresenter.SwitchChain(apiName); var presenter = new UserFriendPresenter() { VotersType = VotersType.All }; Assert.IsTrue(presenter.Count == 0); var error = await presenter.TryLoadNextPostVoters(url); Assert.IsTrue(error == null); Assert.IsTrue(presenter.Count > 0); }
public async Task <Exception> TrySearchCategories(string query, SearchType searchType) { try { 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); TagsPresenter.TasksCancel(); } else { UserFriendPresenter.NotifySourceChanged(nameof(TrySearchCategories), true); UserFriendPresenter.TasksCancel(); } return(new ValidationException(LocalizationKeys.TagSearchWarning)); } if (string.IsNullOrEmpty(query)) { return(await TagsPresenter.TryGetTopTags()); } if (searchType == SearchType.Tags) { return(await TagsPresenter.TryLoadNext(query)); } return(await UserFriendPresenter.TryLoadNextSearchUser(query)); } catch (Exception ex) { return(null); } }
public UserSearchTableViewSource(UserFriendPresenter presenter) { _presenter = presenter; }
public VotersTableViewSource(UserFriendPresenter presenter, UITableView table) : base(presenter, table) { }
public void TasksCancel(bool andDispose = false) { UserFriendPresenter.TasksCancel(andDispose); TagsPresenter.TasksCancel(andDispose); }
public SearchFacade() { UserFriendPresenter = new UserFriendPresenter(); TagsPresenter = new TagsPresenter(); }
public FollowTableViewSource(UserFriendPresenter presenter, UITableView table, bool hideFollowButton = false) : base(presenter, table) { _hideFollowButton = hideFollowButton; }
public void TasksCancel() { UserFriendPresenter.TasksCancel(); TagsPresenter.TasksCancel(); }
public void SetClient(SteepshotApiClient client) { UserFriendPresenter.SetClient(client); TagsPresenter.SetClient(client); }