Пример #1
0
        private void ValidateUISpecToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result;
            string       filename = string.Empty;

            // are we on checkbox or square
            // TODO is there a better/easier way to handle this check
            if (!ValidateUISpecToolStripButton.Text.Equals(Strings.UISPECVALIDATE))
            {
                result = MessageBox.Show("Cancel UI Spec Validation in progress?", Strings.UISPECVALIDATE,
                                         MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result.Equals(DialogResult.Yes))
                {
                    pathRunnerBackgroundWorker.StopValidationInProgress();
                    ResetValidateSpecOptions();
                }
                return;
            }

            string currentFileName = System.IO.Path.GetFileName(visioControl.Src);

            ValidateForm uiSpec = new ValidateForm(visioControl, currentFileName, pathRunnerBackgroundWorker);

            uiSpec.ShowDialog();

            if (uiSpec.DialogResult == DialogResult.OK)
            {
                ValidateUISpecToolStripButton.Image   = Properties.Resources.icn_stop;
                ValidateUISpecToolStripMenuItem.Image = Properties.Resources.icn_stop;
                ValidateUISpecToolStripButton.Text    = Strings.UISPECCANCEL;
                ValidateUISpecToolStripMenuItem.Text  = Strings.UISPECCANCEL;
            }

            uiSpec.Dispose();
        }
        private void ValidateUISpecToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result;
            string filename = string.Empty;

            // are we on checkbox or square
            // TODO is there a better/easier way to handle this check
            if (!ValidateUISpecToolStripButton.Text.Equals(Strings.UISPECVALIDATE)) {
                result = MessageBox.Show("Cancel UI Spec Validation in progress?", Strings.UISPECVALIDATE,
                    MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result.Equals(DialogResult.Yes)){
                    pathRunnerBackgroundWorker.StopValidationInProgress();
                    ResetValidateSpecOptions();
                }
                return;
            }

            string currentFileName = System.IO.Path.GetFileName(visioControl.Src);

            ValidateForm uiSpec = new ValidateForm(visioControl, currentFileName, pathRunnerBackgroundWorker);
            uiSpec.ShowDialog();

            if (uiSpec.DialogResult == DialogResult.OK) {
                ValidateUISpecToolStripButton.Image = Properties.Resources.icn_stop;
                ValidateUISpecToolStripMenuItem.Image = Properties.Resources.icn_stop;
                ValidateUISpecToolStripButton.Text = Strings.UISPECCANCEL;
                ValidateUISpecToolStripMenuItem.Text = Strings.UISPECCANCEL;
            }

            uiSpec.Dispose();
        }