Ejemplo n.º 1
0
    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);
        }
    }
Ejemplo n.º 2
0
 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);
     }
 }