예제 #1
0
        private void BGWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            if (BGWorker.CancellationPending)
            {
                e.Cancel = true;
            }
            else
            {
                M3uData msg = e.Argument as M3uData;
                for (int i = 0; i < msg.listbox.CheckedItems.Count; i++)
                {
                    if (!msg.mngr.Copy_File(msg.listbox.CheckedItems[i].ToString(), msg.folder))
                    {
                        BGWorker.CancelAsync();
                    }

                    int percentComplete = (int)((i + 1) * 100) / msg.listbox.CheckedItems.Count;
                    BGWorker.ReportProgress(percentComplete);
                }
            }
        }
예제 #2
0
 public Progress(M3uManager m, string f, CheckedListBox clb)
 {
     InitializeComponent();
     msg = new M3uData(m, f, clb);
 }