예제 #1
0
        public override async Task ExecuteAsync(MonitoringAdvancedViewModel model)
        {
            var confirmation = deleteInstanceConfirmation();

            confirmation.InstanceName = model.Name;
            if (windowManager.ShowDialog(confirmation) == true)
            {
                using (var progress = model.GetProgressObject("REMOVING " + model.Name))
                {
                    var reportCard = await Task.Run(() => installer.Delete(model.Name, confirmation.RemoveLogs, progress));

                    if (reportCard.HasErrors || reportCard.HasWarnings)
                    {
                        windowManager.ShowActionReport(reportCard, "ISSUES REMOVING INSTANCE", "Could not remove instance because of the following errors:", "There were some warnings while deleting the instance:");
                    }
                    else
                    {
                        model.TryClose(true);
                    }
                }
                eventAggregator.PublishOnUIThread(new ResetInstances());
            }
        }