Пример #1
0
        public ImportCommand(
            IVBE vbe,
            IFileSystemBrowserFactory dialogFactory,
            IVbeEvents vbeEvents,
            IParseManager parseManager,
            IDeclarationFinderProvider declarationFinderProvider,
            IProjectsProvider projectsProvider,
            IModuleNameFromFileExtractor moduleNameFromFileExtractor,
            IEnumerable <IRequiredBinaryFilesFromFileNameExtractor> binaryFileExtractors,
            IFileSystem fileSystem,
            IMessageBox messageBox)
            : base(vbeEvents)
        {
            _vbe                         = vbe;
            _dialogFactory               = dialogFactory;
            _parseManager                = parseManager;
            _projectsProvider            = projectsProvider;
            _moduleNameFromFileExtractor = moduleNameFromFileExtractor;
            _fileSystem                  = fileSystem;

            _binaryFileExtractors = BinaryFileExtractors(binaryFileExtractors);

            MessageBox = messageBox;
            DeclarationFinderProvider = declarationFinderProvider;

            AddToCanExecuteEvaluation(SpecialEvaluateCanExecute);

            ComponentTypesForExtension = ComponentTypeExtensions.ComponentTypesForExtension(_vbe.Kind);

            AddToCanExecuteEvaluation(SpecialEvaluateCanExecute);
            AddToOnExecuteEvaluation(SpecialEvaluateCanExecute);
        }
Пример #2
0
 public ExportCommand(IFileSystemBrowserFactory dialogFactory, IMessageBox messageBox, IProjectsProvider projectsProvider)
     : base(LogManager.GetCurrentClassLogger())
 {
     _dialogFactory   = dialogFactory;
     MessageBox       = messageBox;
     ProjectsProvider = projectsProvider;
 }
        public ExportAllCommand(
            IVBE vbe,
            IFileSystemBrowserFactory folderBrowserFactory,
            IVbeEvents vbeEvents)
            : base(vbeEvents)
        {
            _vbe     = vbe;
            _factory = folderBrowserFactory;

            AddToCanExecuteEvaluation(SpecialEvaluateCanExecute);
        }
Пример #4
0
        public ExportCommand(IFileSystemBrowserFactory dialogFactory, IMessageBox messageBox, IProjectsProvider projectsProvider, IVBE vbe)
        {
            _dialogFactory   = dialogFactory;
            MessageBox       = messageBox;
            ProjectsProvider = projectsProvider;

            _exportableFileExtensions =
                vbe.Kind == VBEKind.Hosted
                    ? VBAExportableFileExtensions
                    : VB6ExportableFileExtensions;

            AddToCanExecuteEvaluation(SpecialEvaluateCanExecute);
        }
        public AddRemoveReferencesUserSettingsViewModel(IConfigProvider <ReferenceSettings> provider, IFileSystemBrowserFactory browserFactory)
        {
            _provider       = provider;
            _browserFactory = browserFactory;
            _clean          = _provider.Create();

            TransferSettingsToView(_clean);

            IncrementRecentReferencesTrackedCommand = new DelegateCommand(null, ExecuteIncrementRecentReferencesTracked, CanExecuteIncrementMaxConcatLines);
            DecrementReferencesTrackedCommand       = new DelegateCommand(null, ExecuteDecrementRecentReferencesTracked, CanExecuteDecrementMaxConcatLines);
            BrowseForPathCommand = new DelegateCommand(null, ExecuteBrowseForPath);
            RemoveSelectedPaths  = new DelegateCommand(null, ExecuteRemoveSelectedPaths);
        }
 public AddRemoveReferencesPresenterFactory(IVBE vbe,
                                            RubberduckParserState state,
                                            IConfigProvider <ReferenceSettings> settingsProvider,
                                            IRegisteredLibraryFinderService finder,
                                            IReferenceReconciler reconciler,
                                            IFileSystemBrowserFactory browser)
 {
     _vbe        = vbe;
     _state      = state;
     _settings   = settingsProvider;
     _finder     = finder;
     _reconciler = reconciler;
     _browser    = browser;
 }
 public UpdateFromFilesCommand(
     IVBE vbe,
     IFileSystemBrowserFactory dialogFactory,
     IVbeEvents vbeEvents,
     IParseManager parseManager,
     IDeclarationFinderProvider declarationFinderProvider,
     IProjectsProvider projectsProvider,
     IModuleNameFromFileExtractor moduleNameFromFileExtractor,
     IEnumerable <IRequiredBinaryFilesFromFileNameExtractor> binaryFileExtractors,
     IFileSystem fileSystem,
     IMessageBox messageBox)
     : base(vbe, dialogFactory, vbeEvents, parseManager, declarationFinderProvider, projectsProvider, moduleNameFromFileExtractor, binaryFileExtractors, fileSystem, messageBox)
 {
 }
        public IgnoredProjectsSettingsViewModel(
            IConfigurationService <IgnoredProjectsSettings> provider,
            IFileSystemBrowserFactory browserFactory,
            IConfigurationService <IgnoredProjectsSettings> service)
            : base(service)
        {
            _provider        = provider;
            _browserFactory  = browserFactory;
            _currentSettings = _provider.Read();

            TransferSettingsToView(_currentSettings);

            AddIgnoredFileCommand  = new DelegateCommand(null, ExecuteBrowseForFile);
            RemoveSelectedProjects = new DelegateCommand(null, ExecuteRemoveSelectedFileNames);
        }
        public AddRemoveReferencesUserSettingsViewModel(
            IConfigurationService <ReferenceSettings> provider,
            IFileSystemBrowserFactory browserFactory,
            IConfigurationService <ReferenceSettings> service,
            IFileSystem fileSystem)
            : base(service)
        {
            _provider       = provider;
            _browserFactory = browserFactory;
            _clean          = _provider.Read();
            _fileSystem     = fileSystem;

            TransferSettingsToView(_clean);

            IncrementRecentReferencesTrackedCommand = new DelegateCommand(null, ExecuteIncrementRecentReferencesTracked, CanExecuteIncrementMaxConcatLines);
            DecrementReferencesTrackedCommand       = new DelegateCommand(null, ExecuteDecrementRecentReferencesTracked, CanExecuteDecrementMaxConcatLines);
            BrowseForPathCommand = new DelegateCommand(null, ExecuteBrowseForPath);
            RemoveSelectedPaths  = new DelegateCommand(null, ExecuteRemoveSelectedPaths);
        }
Пример #10
0
        public SettingsForm(IGeneralConfigService configService,
                            IOperatingSystem operatingSystem,
                            IMessageBox messageBox,
                            IVbeSettings vbeSettings,
                            IConfigProvider <ReferenceSettings> referencesProvider,
                            IFileSystemBrowserFactory browserFactory,
                            SettingsViews activeView = SettingsViews.GeneralSettings) : this()
        {
            var config = configService.LoadConfiguration();

            ViewModel = new SettingsControlViewModel(messageBox, configService,
                                                     config,
                                                     new SettingsView
            {
                // FIXME inject types marked as ExperimentalFeatures

                /*
                 * These ExperimentalFeatureTypes were originally obtained by directly calling into the IoC container
                 * (since only it knows, which Assemblies have been loaded as Plugins). The code is preserved here for easy access.
                 * RubberduckIoCInstaller.AssembliesToRegister()
                 *     .SelectMany(s => s.DefinedTypes)
                 *     .Where(w => Attribute.IsDefined(w, typeof(ExperimentalAttribute)))
                 */
                Control = new GeneralSettings(new GeneralSettingsViewModel(config, operatingSystem, messageBox, vbeSettings, new List <Type>())),
                View    = SettingsViews.GeneralSettings
            },
                                                     new SettingsView
            {
                Control = new TodoSettings(new TodoSettingsViewModel(config)),
                View    = SettingsViews.TodoSettings
            },
                                                     new SettingsView
            {
                Control = new InspectionSettings(new InspectionSettingsViewModel(config)),
                View    = SettingsViews.InspectionSettings
            },
                                                     new SettingsView
            {
                Control = new UnitTestSettings(new UnitTestSettingsViewModel(config)),
                View    = SettingsViews.UnitTestSettings
            },
                                                     new SettingsView
            {
                Control = new IndenterSettings(new IndenterSettingsViewModel(config)),
                View    = SettingsViews.IndenterSettings
            },
                                                     new SettingsView
            {
                Control = new AutoCompleteSettings(new AutoCompleteSettingsViewModel(config)),
                View    = SettingsViews.AutoCompleteSettings
            },
                                                     new SettingsView
            {
                Control = new WindowSettings(new WindowSettingsViewModel(config)),
                View    = SettingsViews.WindowSettings
            },
                                                     new SettingsView
            {
                Control = new AddRemoveReferencesUserSettings(new AddRemoveReferencesUserSettingsViewModel(referencesProvider, browserFactory)),
                View    = SettingsViews.ReferenceSettings
            },
                                                     activeView);

            ViewModel.OnWindowClosed += ViewModel_OnWindowClosed;
        }
 private static IgnoredProjectsSettingsViewModel GetSettingsViewModel(IConfigurationService <IgnoredProjectsSettings> provider, IFileSystemBrowserFactory fileSystem)
 {
     return(new IgnoredProjectsSettingsViewModel(provider, fileSystem, null));
 }
        private static IgnoredProjectsSettingsViewModel GetSettingsViewModel(IFileSystemBrowserFactory fileSystem, IgnoredProjectsSettings initialSettings = null)
        {
            var providerMock = ConfigProviderMock(initialSettings);

            return(GetSettingsViewModel(providerMock.Object, fileSystem));
        }
Пример #13
0
 public RemoveCommand(IFileSystemBrowserFactory dialogFactory, IMessageBox messageBox, IProjectsProvider projectsProvider)
     : base(dialogFactory, messageBox, projectsProvider)
 {
 }
Пример #14
0
 public ImportCommand(IVBE vbe, IFileSystemBrowserFactory dialogFactory)
 {
     _vbe           = vbe;
     _dialogFactory = dialogFactory;
 }
Пример #15
0
 public ExportAllCommand(IVBE vbe, IFileSystemBrowserFactory folderBrowserFactory) : base(LogManager.GetCurrentClassLogger())
 {
     _vbe     = vbe;
     _factory = folderBrowserFactory;
 }