コード例 #1
0
        /// <summary>
        /// Creates a new collector and starts a search.
        /// </summary>
        /// <param name="searchTerm"></param>
        private void DoPostSearch(string searchTerm)
        {
            // Get all of the filters.
            var sort            = GetCurrentPostSort();
            var times           = GetCurrentPostTime();
            var subredditFilter = ui_postSubreddit.Text;
            var authorFilter    = ui_postUserName.Text;
            var websiteFilter   = ui_postWebsite.Text;
            var selftextFilter  = ui_postSelfText.Text;
            var isSelfPost      = ui_postIsSelf.SelectedIndex == 0 ? string.Empty : (ui_postIsSelf.SelectedIndex == 1 ? "yes" : "no");
            var isNsfw          = ui_postIsNsfw.SelectedIndex == 0 ? string.Empty : (ui_postIsNsfw.SelectedIndex == 1 ? "yes" : "no");

            lock (this)
            {
                _mCurrentPostCollector = new SearchPostCollector(App.BaconMan, searchTerm, sort, times, subredditFilter, authorFilter, websiteFilter, selftextFilter, isSelfPost, isNsfw);
                _mCurrentPostCollector.OnCollectionUpdated    += CurrentPostCollector_OnCollectionUpdated;
                _mCurrentPostCollector.OnCollectorStateChange += CurrentPostCollector_OnCollectorStateChange;
                _mCurrentPostCollector.Update(true);
            }
        }
コード例 #2
0
ファイル: Search.xaml.cs プロジェクト: EricYan1/Baconit
        /// <summary>
        /// Creates a new collector and starts a search.
        /// </summary>
        /// <param name="searchTerm"></param>
        private void DoPostSearch(string searchTerm)
        {
            // Get all of the filters.
            PostSearchSorts sort = GetCurrentPostSort();
            PostSearchTimes times = GetCurrentPostTime();
            string subredditFilter = ui_postSubreddit.Text;
            string authorFilter = ui_postUserName.Text;
            string websiteFilter = ui_postWebsite.Text;
            string selftextFilter = ui_postSelfText.Text;
            string isSelfPost = ui_postIsSelf.SelectedIndex == 0 ? String.Empty : (ui_postIsSelf.SelectedIndex == 1 ? "yes" : "no");
            string isNsfw = ui_postIsNsfw.SelectedIndex == 0 ? String.Empty : (ui_postIsNsfw.SelectedIndex == 1 ? "yes" : "no");

            lock (this)
            {
                m_currentPostCollector = new SearchPostCollector(App.BaconMan, searchTerm, sort, times, subredditFilter, authorFilter, websiteFilter, selftextFilter, isSelfPost, isNsfw);
                m_currentPostCollector.OnCollectionUpdated += CurrentPostCollector_OnCollectionUpdated;
                m_currentPostCollector.OnCollectorStateChange += CurrentPostCollector_OnCollectorStateChange;
                m_currentPostCollector.Update(true);
            }
        }