Exemple #1
0
 //to process hotkeys
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     //ctrl+l = clear console
     if (keyData == (Keys.Control | Keys.L))
     {
         console.Clear();
         return(true);
     }
     //ctrl+r = build index
     if (keyData == (Keys.Control | Keys.R))
     {
         console.Log("(Re)building index...");
         lucene.BuildIndex(Mp3Tags.CollectTags(this.bgWorker));
         console.Log("Index successfully created");
         return(true);
     }
     //ctrl+p = create playlists from displayed songs
     if (keyData == (Keys.Control | Keys.P))
     {
         console.Log("creating playlist...");
         createPlaylist((IEnumerable <Result>)lstSongs.DataSource);
         console.Log("playlist created.");
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
Exemple #2
0
 private void bgWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     lucene.BuildIndex(Mp3Tags.CollectTags(this.bgWorker));
     //we're finished
     bgWorker.ReportProgress(100);
 }