ToModel() public méthode

public ToModel ( ProjectReader, projectReader, ConfigureWindowModel, configureWindowModel ) : void
projectReader ProjectReader,
configureWindowModel ConfigureWindowModel,
Résultat void
    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);
        }
    }
Exemple #2
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);
        }
    }