{\r
this.info = new SharedInfo();\r
this.files = this.info;\r
- this.progressBar1.Maximum = this.files.Count();\r
this.op = new ShrredFiles();\r
}\r
catch (IOException)\r
this.op = new ShrredFiles();\r
this.files = args;\r
}\r
+ this.progressBar1.Maximum = this.files.Count();\r
this.op.Progressing += new ProgressingEventHandler(op_Progressing);\r
this.op.Progressed += new ProgressedEventHandler(op_Progressed);\r
}\r
\r
this.tokenSource = new CancellationTokenSource();\r
\r
- this.progressBar1.Maximum = 1000;\r
- this.task = Task.Factory.StartNew(() =>\r
+ this.task = new Task(() =>\r
{\r
op.Execute(this.files);\r
});\r
this.task.ContinueWith((t) =>\r
{\r
- this.Invoke(new Action(() =>\r
+ this.BeginInvoke(new Action(() =>\r
{\r
this.Close();\r
}));\r
});\r
+ this.task.Start();\r
}\r
\r
void op_Progressing(object sender, ProgressingEventArgs e)\r
{\r
- this.Invoke(new Action(() =>\r
+ this.BeginInvoke(new Action(() =>\r
{\r
if (e.fileName == null)\r
this.label2.Text = Resources.FINAL_PROCESS;\r
\r
if (e.ex == null)\r
{\r
- this.Invoke(new Action(() => { if (this.progressBar1.Value < this.progressBar1.Maximum) this.progressBar1.Value++; }));\r
+ this.BeginInvoke(new Action(() => { if (this.progressBar1.Value < this.progressBar1.Maximum) this.progressBar1.Value++; }));\r
}else if(e.ex is IOException){\r
DialogResult result = MessageBox.Show(e.ex.Message, "", MessageBoxButtons.AbortRetryIgnore);\r
switch (result)\r