private void toolStripMenuItemToolsValidate_Click(object sender, EventArgs e)
{
DocModelView docView = null;
if (this.m_filterviews != null && this.m_filterviews.Length > 0)
{
docView = this.m_filterviews[0];
}
using (FormValidate form = new FormValidate(this.m_project, docView, this.m_filterexchange))
{
DialogResult res = form.ShowDialog();
if (res != DialogResult.OK || String.IsNullOrEmpty(Properties.Settings.Default.ValidateFile))
return;
this.m_filterviews = new DocModelView[] {form.SelectedView};
this.m_filterexchange = form.SelectedExchange;
using (this.m_formProgress = new FormProgress())
{
this.m_formProgress.Text = "Validating File";
this.m_formProgress.Description = "Validating file...";
this.backgroundWorkerValidate.RunWorkerAsync();
res = this.m_formProgress.ShowDialog();
if (res != DialogResult.OK)
{
this.backgroundWorkerValidate.CancelAsync();
}
}
if (this.m_exception != null)
{
MessageBox.Show(this, this.m_exception.Message, "Error");
this.m_exception = null;
return;
}
// show window
this.splitContainerEdit.Panel2Collapsed = false;
this.InitInstanceList();
}
#if false
DialogResult res = this.openFileDialogValidate.ShowDialog();
if (res != DialogResult.OK)
return;
using(FormSelectView form = new FormSelectView(this.m_project, "Select the model view for validating the file."))
{
if(form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK && form.Selection != null)
{
this.m_filterviews = form.Selection;
using (FormSelectExchange formExchange = new FormSelectExchange(this.m_filterviews[0]))
{
if (formExchange.ShowDialog(this) == System.Windows.Forms.DialogResult.OK && formExchange.Selection != null)
{
this.m_filterexchange = formExchange.Selection;
using (this.m_formProgress = new FormProgress())
{
this.m_formProgress.Text = "Validating File";
this.m_formProgress.Description = "Validating file...";
this.backgroundWorkerValidate.RunWorkerAsync();
res = this.m_formProgress.ShowDialog();
if (res != DialogResult.OK)
{
this.backgroundWorkerValidate.CancelAsync();
}
}
}
}
if (this.m_exception != null)
{
MessageBox.Show(this, this.m_exception.Message, "Error");
this.m_exception = null;
return;
}
// show window
this.splitContainerEdit.Panel2Collapsed = false;
this.InitInstanceList();
}
}
#endif
}