public static Show ( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options ) : DialogResult | ||
text | string | |
caption | string | |
buttons | MessageBoxButtons | |
icon | MessageBoxIcon | |
defaultButton | MessageBoxDefaultButton | |
options | MessageBoxOptions | |
return | DialogResult |
public static DialogResult Show (string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
{
MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons,
icon, defaultButton, options, false);
return form.RunDialog ();
}
MessageBox::Show ( IWin32Window owner, string text ) : DialogResult | |
MessageBox::Show ( IWin32Window owner, string text, string caption ) : DialogResult | |
MessageBox::Show ( IWin32Window owner, string text, string caption, MessageBoxButtons buttons ) : DialogResult | |
MessageBox::Show ( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon ) : DialogResult | |
MessageBox::Show ( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton ) : DialogResult | |
MessageBox::Show ( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options ) : DialogResult | |
MessageBox::Show ( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath ) : DialogResult | |
MessageBox::Show ( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator ) : DialogResult | |
MessageBox::Show ( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param ) : DialogResult | |
MessageBox::Show ( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, string keyword ) : DialogResult | |
MessageBox::Show ( string text ) : DialogResult | |
MessageBox::Show ( string text, string caption ) : DialogResult | |
MessageBox::Show ( string text, string caption, MessageBoxButtons buttons ) : DialogResult | |
MessageBox::Show ( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon ) : DialogResult | |
MessageBox::Show ( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton ) : DialogResult | |
MessageBox::Show ( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, bool displayHelpButton ) : DialogResult | |
MessageBox::Show ( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath ) : DialogResult | |
MessageBox::Show ( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator ) : DialogResult | |
MessageBox::Show ( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param ) : DialogResult | |
MessageBox::Show ( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, string keyword ) : DialogResult |
private void SubmitScenarioButton_Click(object sender, RibbonControlEventArgs e) { // validate and show warnings #region validate var emptyInputs = ScenarioCore.ScenarioUICreator.Instance.GetEmptyEntrysCount(typeof(InputCell)); var emptyIntermediates = ScenarioCore.ScenarioUICreator.Instance.GetEmptyEntrysCount(typeof(IntermediateCell)); var emptyResults = ScenarioCore.ScenarioUICreator.Instance.GetEmptyEntrysCount(typeof(OutputCell)); if (emptyInputs > 0 | emptyIntermediates > 0 | emptyResults > 0) { // FIXME: q&d temporary fix without translations: Do not allow creating scenarios when not all cells are filled MessageBox.Show( Resources.tl_Scenario_Notallcellsfilled, Resources.tl_Scenario_CantCreate, MessageBoxButtons.OK); return; } if (ScenarioCore.ScenarioUICreator.Instance.NoValue(typeof(InputCell))) { //message for no result cell values MessageBox.Show(Resources.tl_Scenario_MinOneInput, Resources.tl_MessageBox_Error, MessageBoxButtons.OK); //back to the scenario editor return; } else if (ScenarioCore.ScenarioUICreator.Instance.NoValue(typeof(IntermediateCell)) && ScenarioCore.ScenarioUICreator.Instance.NoValue(typeof(OutputCell))) { //message for no input cell values MessageBox.Show(Resources.tl_Scenario_MinOneOutput, Resources.tl_MessageBox_Error, MessageBoxButtons.OK); //back to the scenario editor return; } //else if (emptyInputs > 0 | emptyIntermediates > 0 | emptyResults > 0) //{ // FIXME: Re-enable logic and remove hotfix once the issue has been solved (some inputs made by the user are missing in created scenarios when continuing with incomplete scenario) //// message for some empty fields //#region create message //var messageList = new List<Tuple<string, int>>(); //if (emptyInputs > 0) messageList.Add(new Tuple<string, int>("input cells", emptyInputs)); //if (emptyIntermediates > 0) messageList.Add(new Tuple<string, int>("intermediate cells", emptyIntermediates)); //if (emptyResults > 0) messageList.Add(new Tuple<string, int>("result cells", emptyResults)); //var message = new StringBuilder(); //message.Append("Maybe your scenario isn't complete. "); //message.Append("The scenario has "); //foreach (var p in messageList) //{ // message.Append(p.Item2 + " empty fields for " + p.Item1); // if (messageList.IndexOf(p) < messageList.Count - 2) // { // message.Append(", "); // } // else if (messageList.IndexOf(p) == messageList.Count - 2) // { // message.Append(" and "); // } //} //message.Append("."); //#endregion //var result = MessageBox.Show( // message.ToString(), // "warning", // MessageBoxButtons.OKCancel); ////back to the scenario editor //if (result == DialogResult.Cancel) return; //} #endregion // end scenario creation var newScenario = ScenarioCore.ScenarioUICreator.Instance.End(); if (newScenario != null) { DataModel.Instance.CurrentWorkbook.Scenarios.Add(newScenario); } // set button styles SetScenarioCreationButtonStyles(false); }