Class emulates long process which runs in worker thread and makes synchronous user UI operations.
Inheritance: IDisposable
        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;
            }
        }
Beispiel #2
0
 public Wiki(LyricSearch lyricSearch)
 {
     this.lyricSearch = lyricSearch;
     lyricWiki = new LyricWiki();
 }
        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;
            }
        }