public ICommand CreateCommand() { ICommand ret = null; // bool add = false; // add = true; string title = "Add A Fog"; using (AddFogDialog dlg = new AddFogDialog(title, app)) { dlg.Cx = app.Config.FogColorDefault; dlg.NearFog = app.Config.FogNearDefault; dlg.FarFog = app.Config.FogFarDefault; bool showAgain = false; DialogResult result; do { result = dlg.ShowDialog(); showAgain = false; if (result == DialogResult.OK) { // do validation here // if validation fails, set showAgain to true showAgain = ((result == DialogResult.OK) && (!dlg.okButton_validating())); } } while (showAgain); if (result == DialogResult.OK) { ret = new AddFogCommand(app, parent, dlg.Cx, dlg.NearFog, dlg.FarFog); } return(ret); } }
public ICommand CreateCommand() { ICommand ret = null; // bool add = false; // add = true; string title = "Add A Fog"; using (AddFogDialog dlg = new AddFogDialog(title, app)) { dlg.Cx = app.Config.FogColorDefault; dlg.NearFog = app.Config.FogNearDefault; dlg.FarFog = app.Config.FogFarDefault; bool showAgain = false; DialogResult result; do { result = dlg.ShowDialog(); showAgain = false; if (result == DialogResult.OK) { // do validation here // if validation fails, set showAgain to true showAgain = ((result == DialogResult.OK) && (!dlg.okButton_validating())); } } while (showAgain); if (result == DialogResult.OK) { ret = new AddFogCommand(app, parent, dlg.Cx, dlg.NearFog, dlg.FarFog); } return ret; } }