private void btnStart_Click(object sender, EventArgs e) { IFontConverter converter = (IFontConverter)cmbConverters.SelectedItem; List<FileInfo> files = new List<FileInfo>(); foreach(object item in lbInput.Items) { files.Add((FileInfo)item); } ProgressMonitor progress = new ProgressMonitor(); ParameterizedThreadStart threadStart = new ParameterizedThreadStart(Convert); progress.Parameter = new object[]{converter, files}; progress.ThreadStart = threadStart; progress.Text = "Please Wait"; progress.Description = "Font generating in progress."; progress.ShowDialog(this); }
private void btnStart_Click(object sender, EventArgs e) { if (txtInput.Text == string.Empty) errorProvider.SetError(txtInput, "Input file is required"); else errorProvider.SetError(txtInput, string.Empty); if (txtOutput.Text == string.Empty) errorProvider.SetError(txtOutput, "Output path is required"); else errorProvider.SetError(txtOutput, string.Empty); if (cblScripts.CheckedIndices.Count == 0) errorProvider.SetError(cblScripts, "At least 1 script block need to be selected."); else errorProvider.SetError(cblScripts, string.Empty); if (errorProvider.GetError(txtInput) != string.Empty || errorProvider.GetError(txtOutput) != string.Empty || errorProvider.GetError(cblScripts) != string.Empty) return; LinkedList<string> scripts = new LinkedList<string>(); foreach (object item in cblScripts.CheckedItems) scripts.AddLast(item.ToString()); ParameterizedThreadStart threadStart = new ParameterizedThreadStart(StartConvert); ProgressMonitor progress = new ProgressMonitor(); progress.Parameter = scripts; progress.ThreadStart = threadStart; progress.ProgressBarStyle = ProgressBarStyle.Blocks; progress.Description = "Glyph images generating is in progress ..."; progress.Text = "Please wait"; progress.ShowDialog(this); }