示例#1
0
 protected override void Execute(object sender, EventArgs args)
 {
     if (CommandTarget.AskSaveModifiedRecipe() == false)
     {
         return;
     }
     RecipeFactory.NewRecipe(string.Empty);
 }
示例#2
0
        protected override void Execute(object sender, EventArgs args)
        {
            if (CommandTarget.AskSaveModifiedRecipe())
            {
                var dlg = new OpenFileDialog {
                    Filter = Constants.RECIPE_FILE_FILTER,
                    Title  = "Open Recipe"
                };

                if (DialogResult.OK == dlg.ShowDialog(FindMainWindow()))
                {
                    CommandTarget.Status = "Loading " + dlg.FileName + "...";
                    CommandTarget.Cursor = Cursors.WaitCursor;
                    RecipeFactory.Load(dlg.FileName);
                    CommandTarget.Cursor = Cursors.Default;
                    CommandTarget.Status = "Ready";
                }
            }
        }