Пример #1
0
        public SearchPagePayload(ISearchPagePayloadContent content)
        {
            _Content = content;

            if (content is KeywordSearchPagePayloadContent)
            {
                SearchTarget = SearchTarget.Keyword;
            }
            else if (content is TagSearchPagePayloadContent)
            {
                SearchTarget = SearchTarget.Tag;
            }
            else if (content is MylistSearchPagePayloadContent)
            {
                SearchTarget = SearchTarget.Mylist;
            }
            else if (content is CommunitySearchPagePayloadContent)
            {
                SearchTarget = SearchTarget.Community;
            }
            else if (content is LiveSearchPagePayloadContent)
            {
                SearchTarget = SearchTarget.Niconama;
            }

            ContentJson = content.ToParameterString();
        }
        public static void Search(this PageManager pageManager, ISearchPagePayloadContent searchPayload, bool forgetLastSearch = false)
        {
            HohoemaPageType resultPageType = HohoemaPageType.Search;

            if (searchPayload is KeywordSearchPagePayloadContent)
            {
                resultPageType = HohoemaPageType.SearchResultKeyword;
            }
            else if (searchPayload is TagSearchPagePayloadContent)
            {
                resultPageType = HohoemaPageType.SearchResultTag;
            }
            else if (searchPayload is MylistSearchPagePayloadContent)
            {
                resultPageType = HohoemaPageType.SearchResultMylist;
            }
            else if (searchPayload is CommunitySearchPagePayloadContent)
            {
                resultPageType = HohoemaPageType.SearchResultCommunity;
            }
            else if (searchPayload is LiveSearchPagePayloadContent)
            {
                resultPageType = HohoemaPageType.SearchResultLive;
            }

            pageManager.OpenPage(resultPageType, searchPayload.ToParameterString(), forgetLastSearch);
        }
Пример #3
0
        public static void Search(this PageManager pageManager, ISearchPagePayloadContent searchPayload, bool forgetLastSearch = false)
        {
            HohoemaPageType resultPageType = HohoemaPageType.Search;

            if (searchPayload is KeywordSearchPagePayloadContent)
            {
                resultPageType = HohoemaPageType.SearchResultKeyword;
            }
            else if (searchPayload is TagSearchPagePayloadContent)
            {
                resultPageType = HohoemaPageType.SearchResultTag;
            }
            else if (searchPayload is MylistSearchPagePayloadContent)
            {
                resultPageType = HohoemaPageType.SearchResultMylist;
            }
            else if (searchPayload is CommunitySearchPagePayloadContent)
            {
                resultPageType = HohoemaPageType.SearchResultCommunity;
            }
            else if (searchPayload is LiveSearchPagePayloadContent)
            {
                resultPageType = HohoemaPageType.SearchResultLive;
            }

            bool isRequireForgetLastNavigation = false;

            if (pageManager.CurrentPageType == HohoemaPageType.SearchResultCommunity ||
                pageManager.CurrentPageType == HohoemaPageType.SearchResultKeyword ||
                pageManager.CurrentPageType == HohoemaPageType.SearchResultTag ||
                pageManager.CurrentPageType == HohoemaPageType.SearchResultLive ||
                pageManager.CurrentPageType == HohoemaPageType.SearchResultMylist)
            {
                isRequireForgetLastNavigation = true;
            }

            pageManager.OpenPage(resultPageType, searchPayload.ToParameterString(), isRequireForgetLastNavigation);
        }