Class emulates long process which runs in worker thread and makes synchronous user UI operations.
Inheritance: IDisposable
コード例 #1
0
        public void AddNewLyricSearch(string artist, string title, string strippedArtistName, int row)
        {
            if (lyricsSites.Length > 0 && !string.IsNullOrEmpty(artist) && !string.IsNullOrEmpty(title))
            {
                ++m_noOfCurrentSearches;

                // create worker thread instance
                ThreadStart threadInstance = delegate
                {
                    LyricSearch lyricSearch = new LyricSearch(this, artist, title,
                                                              strippedArtistName,
                                                              row,
                                                              m_allowAllToComplete,
                                                              m_automaticUpdate);
                    lyricSearch.Run();
                };

                Thread lyricSearchThread = new Thread(threadInstance);
                lyricSearchThread.Name         = "BasicSearch for " + artist + " - " + title; // looks nice in Output window
                lyricSearchThread.IsBackground = true;
                lyricSearchThread.Start();
                threadList.Add(lyricSearchThread);
            }
            else
            {
                return;
            }
        }
コード例 #2
0
ファイル: Wiki.cs プロジェクト: MediaPortal/MPTagThat
 public Wiki(LyricSearch lyricSearch)
 {
     this.lyricSearch = lyricSearch;
     lyricWiki = new LyricWiki();
 }
コード例 #3
0
        public void AddNewLyricSearch(string artist, string title, string strippedArtistName, int row)
        {
            if (lyricsSites.Length > 0 && !string.IsNullOrEmpty(artist) && !string.IsNullOrEmpty(title))
            {
                ++m_noOfCurrentSearches;

                // create worker thread instance
                ThreadStart threadInstance = delegate
                {
                    LyricSearch lyricSearch = new LyricSearch(this, artist, title,
                                                              strippedArtistName,
                                                              row,
                                                              m_allowAllToComplete,
                                                              m_automaticUpdate);
                    lyricSearch.Run();
                };

                Thread lyricSearchThread = new Thread(threadInstance);
                lyricSearchThread.Name = "BasicSearch for " + artist + " - " + title; // looks nice in Output window
                lyricSearchThread.IsBackground = true;
                lyricSearchThread.Start();
                threadList.Add(lyricSearchThread);
            }
            else
            {
                return;
            }
        }