Canguro.Commands.Model.NewModelWizard.Run C# (CSharp) Method

Run() public method

Executes the command. Asks to save changes if needed and Resets the current Model.
public Run ( Canguro services ) : void
services Canguro CommandServices object to interact with the system
return void
        public override void Run(Canguro.Controller.CommandServices services)
        {
            try
            {
                if (services.Model.Modified)
                {
                    DialogResult dr = MessageBox.Show(Culture.Get("askSaveChangesAndExit"), Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
                    if (dr == DialogResult.Cancel)
                        return;
                    else if (dr == DialogResult.Yes)
                        services.Run(new SaveModelCmd());
                }

                services.Model.Reset();
            }
            catch (Exception)
            {
                MessageBox.Show("Error creating new file.");
            }
        }
NewModelWizard