public void Terminate() { if (m_Searcher != null) { m_Searcher.Terminate(); m_Thread.Join(); m_Searcher = null; m_Thread = null; } }
public QuickSearch(DataModel dataModel) { m_DataModel = dataModel; SearchResults = new ObservableCollection<IndexedLibraryItem>(); m_DataModel.ServerSession.PropertyChanged += new PropertyChangedEventHandler(OnServerSessionPropertyChanged); m_Searcher = new QuickSearchThread(this, m_DataModel.Database); m_Thread = new Thread(new ThreadStart(m_Searcher.Start)); m_Thread.Name = "QuickSearch thread"; m_Thread.Start(); }
public QuickSearch(DataModel dataModel) { m_DataModel = dataModel; SearchResults = new ObservableCollection <MusicCollectionItem>(); m_DataModel.ServerSession.PropertyChanged += new PropertyChangedEventHandler(OnServerSessionPropertyChanged); m_Searcher = new QuickSearchThread(this, m_DataModel.Database); m_Thread = new Thread(new ThreadStart(m_Searcher.Start)); m_Thread.Name = "QuickSearch thread"; m_Thread.Start(); }
public void Terminate() { if (m_Searcher != null) { m_Searcher.Terminate(); m_Thread.Join(); m_Searcher = null; m_Thread = null; } }