private void Rename(Window window) { var wnd = new ExecutionOrderNameView(ExecutionPlans.CurrentPlan.PlanName) { Owner = window }; var choice = wnd.ShowDialog(); if (!choice.HasValue || !choice.Value) { return; } ExecutionPlans.CurrentPlan.PlanName = wnd.NewName; ExecutionOrderProvider.SavePlan(ExecutionPlans.CurrentPlan); }
private void AddNew(Window window) { var wnd = new ExecutionOrderNameView(originalName: "") { Owner = window }; var choice = wnd.ShowDialog(); if (!choice.HasValue || !choice.Value) { return; } var newPlan = new Plan() { PlanId = ExecutionPlans.Plans.Max(r => r.PlanId) + 1, PlanName = wnd.NewName, }; newPlan.ExecutionOrder.AddRange(Plugins.GetPlugins <IPostDbRestore>().Select(r => r.Value.PluginName)); ExecutionPlans.Plans.Add(newPlan); ExecutionPlans.CurrentPlan = newPlan; ExecutionOrderProvider.SavePlan(newPlan); }