public void ConfigureCallback() { try { var project = currentProjectFinder.GetCurrentProject(); if (UnsaveProjectChecker.HasUnsavedPendingChanges(project)) { return; } var projectReader = new ProjectReader(project.FullName); var model = new ConfigureWindowModel(); var defaulter = new Defaulter(); defaulter.ToModel(projectReader, model); var configureWindow = new ConfigureWindow(model); new WindowInteropHelper(configureWindow) { Owner = GetActiveWindow() }; if (configureWindow.ShowDialog().GetValueOrDefault()) { Configure(model, project); } } catch (COMException exception) { exceptionDialog.HandleException(exception); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
void CommandStatusCheck() { try { disableCommand.Enabled = true; configureCommand.Enabled = true; var project = currentProjectFinder.GetCurrentProject(); if (project == null) { disableCommand.Enabled = false; configureCommand.Enabled = false; return; } var xmlForProject = LoadXmlForProject(project); if (xmlForProject == null) { disableCommand.Enabled = false; configureCommand.Enabled = false; return; } disableCommand.Enabled = ContainsWeavingTask(xmlForProject); } catch (COMException exception) { exceptionDialog.HandleException(exception); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
public void DisableCallback() { try { var project = currentProjectFinder.GetCurrentProject(); if (UnsaveProjectChecker.HasUnsavedPendingChanges(project)) { return; } errorDisplayer.ShowInfo(string.Format("Costura: Removed from the project '{0}'. However no binary files will be removed in case they are being used by other projects.", project.Name)); new ProjectRemover(project.FullName); } catch (COMException exception) { exceptionDialog.HandleException(exception); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }