Exemplo n.º 1
0
        private void NewScenarioButton_Click(object sender, RibbonControlEventArgs e)
        {
            string title = null;

            var inputDialog = new CustomInputDialog(
                Resources.tl_NewScenarioDialog_Question,
                Resources.tl_NewScenarioDialog_Title,
                Resources.tl_NewScenarioDialog_DefaultAnswer);

            if (inputDialog.ShowDialog() == true)
            {
                title = inputDialog.Answer;
            }

            // If the user did not cancel the dialog, proceed with the scenario creation process
            if (!string.IsNullOrEmpty(title))
            {
                // set scenario buttons styles
                SetScenarioCreationButtonStyles(true);

                // start scenario creation
                ScenarioUICreator.Instance.Start(DataModel.Instance.CurrentWorkbook, title);
            }
        }
Exemplo n.º 2
0
        private void NewScenarioButton_Click(object sender, RibbonControlEventArgs e)
        {
            string title = null;

            CustomInputDialog inputDialog = new CustomInputDialog(
                Resources.tl_NewScenarioDialog_Question,
                Resources.tl_NewScenarioDialog_Title,
                Resources.tl_NewScenarioDialog_DefaultAnswer);
            if (inputDialog.ShowDialog() == true)
            {
                title = inputDialog.Answer;
            }

            // If the user did not can the dialog, proceed with the scenario creation process
            if (title != null)
            {
                // set scenario buttons styles
                SetScenarioCreationButtonStyles(true);

                // start scenario creation
                ScenarioCore.ScenarioUICreator.Instance.Start(DataModel.Instance.CurrentWorkbook, title);
            }
        }