Exemplo n.º 1
0
 public SettingsCommand(WindowDisplayer windowDisplayer, ISettingsViewFactory settingsViewFactory,
                        ISettingsViewModelFactory settingsViewModelFactory)
 {
     this.windowDisplayer          = windowDisplayer;
     this.settingsViewFactory      = settingsViewFactory;
     this.settingsViewModelFactory = settingsViewModelFactory;
 }
Exemplo n.º 2
0
        public SettingsForm(IGeneralConfigService configService,
                            IMessageBox messageBox,
                            ISettingsViewModelFactory viewModelFactory,
                            SettingsViews activeView = SettingsViews.GeneralSettings)
            : this()
        {
            var config = configService.LoadConfiguration();

            ViewModel = new SettingsControlViewModel(messageBox, configService,
                                                     config,
                                                     new SettingsView
            {
                Control = new GeneralSettings(viewModelFactory.Create <Rubberduck.Settings.GeneralSettings>(config)),
                View    = SettingsViews.GeneralSettings
            },
                                                     new SettingsView
            {
                Control = new TodoSettings(viewModelFactory.Create <ToDoListSettings>(config)),
                View    = SettingsViews.TodoSettings
            },
                                                     new SettingsView
            {
                Control = new InspectionSettings(viewModelFactory.Create <CodeInspectionSettings>(config)),
                View    = SettingsViews.InspectionSettings
            },
                                                     new SettingsView
            {
                Control = new UnitTestSettings(viewModelFactory.Create <Rubberduck.UnitTesting.Settings.UnitTestSettings>(config)),
                View    = SettingsViews.UnitTestSettings
            },
                                                     new SettingsView
            {
                Control = new IndenterSettings(viewModelFactory.Create <SmartIndenter.IndenterSettings>(config)),
                View    = SettingsViews.IndenterSettings
            },
                                                     new SettingsView
            {
                Control = new AutoCompleteSettings(viewModelFactory.Create <Rubberduck.Settings.AutoCompleteSettings>(config)),
                View    = SettingsViews.AutoCompleteSettings
            },
                                                     new SettingsView
            {
                Control = new WindowSettings(viewModelFactory.Create <Rubberduck.Settings.WindowSettings>(config)),
                View    = SettingsViews.WindowSettings
            },
                                                     new SettingsView
            {
                Control = new AddRemoveReferencesUserSettings(viewModelFactory.Create <ReferenceSettings>()),
                View    = SettingsViews.ReferenceSettings
            },
                                                     activeView);

            ViewModel.OnWindowClosed += ViewModel_OnWindowClosed;
        }
Exemplo n.º 3
0
        public ShellViewModel(IEventAggregator eventAggregator, IWindowManager windowManager, ITailListenerService service,
                              ILogger logger, IStreamConfigurationViewModelFactory streamConfigurationFactory, IStreamViewModelFactory streamFactory,
                              ISettingsViewModelFactory settingsFactory, AboutViewModel aboutViewModel)
        {
            // Subscribe for events.
            eventAggregator.Subscribe(this);

            _windowManager = windowManager;
            _service       = service;
            _logger        = logger;
            _streamConfigurationFactory = streamConfigurationFactory;
            _streamFactory   = streamFactory;
            _settingsFactory = settingsFactory;
            _aboutViewModel  = aboutViewModel;
            _mappings        = new List <ViewModelMapping>();

            // Set the display name.
            DisplayName = "Tail";
        }