Exemplo n.º 1
0
        private void backgroundWorkerLoading_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            RenderMethods.ImportModel(m_SourceFileName, m_DestFileName, (percent, error) =>
            {
                try
                {
                    worker.ReportProgress((int)(percent * 100), error);
                    e.Result = error;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                return(!worker.CancellationPending);
            });
        }