Пример #1
0
        public VstPluginSettingsViewModel(Plugin plugin, IVstService vstService, IOpenFileService openFileService,
                                          ISelectDirectoryService selectDirectoryService, ILicenseService licenseService,
                                          IAdvancedMessageService messageService,
                                          ICommandManager commandManager,
                                          RemoteVstService remoteVstService,
                                          INativeInstrumentsResourceGeneratorService
                                          resourceGeneratorService)
        {
            Argument.IsNotNull(() => vstService);
            Argument.IsNotNull(() => openFileService);
            Argument.IsNotNull(() => selectDirectoryService);
            Argument.IsNotNull(() => licenseService);
            Argument.IsNotNull(() => resourceGeneratorService);
            Argument.IsNotNull(() => commandManager);

            Plugin = plugin;

            _openFileService          = openFileService;
            _commandManager           = commandManager;
            _selectDirectoryService   = selectDirectoryService;
            _licenseService           = licenseService;
            _vstService               = vstService;
            _resourceGeneratorService = resourceGeneratorService;
            _messageService           = messageService;
            _remoteVstService         = remoteVstService;

            OpenNKSFile               = new TaskCommand(OnOpenNKSFileExecute);
            ClearMappings             = new TaskCommand(OnClearMappingsExecute);
            AddAdditionalPresetFiles  = new TaskCommand(OnAddAdditionalPresetFilesExecute);
            AddAdditionalPresetFolder = new TaskCommand(OnAddAdditionalPresetFolderExecute);
            RemoveAdditionalBankFiles = new Command <object>(OnRemoveAdditionalBankFilesExecute);
            RemoveCategory            = new Command <object>(OnRemoveCategoryExecute);
            AddCategory               = new Command(OnAddCategoryExecute);

            ReplaceVBLogo    = new TaskCommand(OnReplaceVBLogoExecute);
            ReplaceVBArtwork = new TaskCommand(OnReplaceVBArtworkExecute);

            ReplaceMSTLogo    = new TaskCommand(OnReplaceMSTLogoExecute);
            ReplaceMSTArtwork = new TaskCommand(OnReplaceMSTArtworkExecute);
            ReplaceMSTPlugin  = new TaskCommand(OnReplaceMSTPluginExecute);

            ReplaceOSOLogo = new TaskCommand(OnReplaceOSOLogoExecute);

            SubmitResource             = new TaskCommand(OnSubmitResourceExecute);
            QueryOnlineResources       = new TaskCommand(OnQueryOnlineResourcesExecute);
            LoadSelectedOnlineResource = new TaskCommand(OnLoadSelectedOnlineResourceExecute);

            GenerateResources = new TaskCommand(OnGenerateResourcesExecute);


            Title = "Settings for " + Plugin.PluginName;


            GenerateControllerMappingModels();
            PluginLocations = (from pluginLocation in Plugin.PluginLocations
                               where pluginLocation.IsPresent
                               select pluginLocation).ToList();
        }
Пример #2
0
        protected AbstractScanPluginsCommandContainer(string command, ICommandManager commandManager,
                                                      IServiceLocator serviceLocator)
            : base(command, commandManager, serviceLocator)
        {
            _messageService             = ServiceLocator.ResolveType <IAdvancedMessageService>();
            _applicationService         = ServiceLocator.ResolveType <IApplicationService>();
            _dispatcherService          = ServiceLocator.ResolveType <IDispatcherService>();
            _commandManager             = commandManager;
            _dataPersisterService       = ServiceLocator.ResolveType <DataPersisterService>();
            _presetDataPersisterService = ServiceLocator.ResolveType <PresetDataPersisterService>();
            ;
            _resourceGeneratorService =
                ServiceLocator.ResolveType <INativeInstrumentsResourceGeneratorService>();
            _pluginService    = ServiceLocator.ResolveType <PluginService>();
            GlobalService     = ServiceLocator.ResolveType <GlobalService>();
            _remoteVstService = ServiceLocator.ResolveType <RemoteVstService>();

            GlobalService.Plugins.CollectionChanged += OnPluginsListChanged;
        }