Esempio n. 1
0
        /// <summary>
        /// Handles <see cref="SearchCommand"/>.
        /// </summary>
        public virtual void Search()
        {
            AdvancedFindIsOpen = false;

            if (m_searching || m_searcher.Searching)
            {
                // We are in the middle of searching so we
                // need to set up a pending search and
                // cancel the current search operation
                m_pendingSearch = m_searchText;
                m_cancelSearch  = true;
                m_searcher.Cancel();
            }
            else if (!string.IsNullOrEmpty(m_pendingSearch) || !string.IsNullOrEmpty(m_searchText))
            {
                // Begin the search
                SetCurrentPageNumber(1);
                ItemsKeys = new List <Guid>();
                Load();
                BeginSearching();
            }
            else
            {
                // Search text is empty so show all
                m_pendingSearch = null;
                SetCurrentPageNumber(1);
                ItemsKeys = AllKeys;
                Load();
            }
        }