Exemplo n.º 1
0
 public InjectionConfigurationViewModelFactory(
     DomainActionBuilder actionBuilder,
     ComponentViewModelFactory componentViewModelFactory,
     IFindFirstLaunchTimeQuery findFirstLaunchTimeQuery,
     IFindGamePackageByIdQuery findGamePackageByIdQuery,
     IFindGamesQuery findGamesQuery,
     IFindLastEditedGamePackageQuery findLastEditedGamePackageQuery,
     IDirectoryPicker directoryPicker,
     IEqualityComparer <ProxySettings> stateEqualityComparer,
     IEventPublisher eventPublisher,
     IFilePicker filePicker,
     IPluginFactory pluginFactory,
     INavigationService navigationService,
     ITaskRunner runner)
 {
     _actionBuilder                  = actionBuilder;
     _componentViewModelFactory      = componentViewModelFactory;
     _findFirstLaunchTimeQuery       = findFirstLaunchTimeQuery;
     _findGamePackageByIdQuery       = findGamePackageByIdQuery;
     _findGamesQuery                 = findGamesQuery;
     _findLastEditedGamePackageQuery = findLastEditedGamePackageQuery;
     _directoryPicker                = directoryPicker;
     _stateEqualityComparer          = stateEqualityComparer;
     _eventPublisher                 = eventPublisher;
     _filePicker        = filePicker;
     _pluginFactory     = pluginFactory;
     _navigationService = navigationService;
     _runner            = runner;
 }
Exemplo n.º 2
0
        public InjectionConfigurationViewModel(
            DomainActionBuilder actionBuilder,
            ComponentViewModelFactory componentViewModelFactory,
            IFindFirstLaunchTimeQuery findFirstLaunchTimeQuery,
            IFindGamePackageByIdQuery findGamePackageByIdQuery,
            IFindGamesQuery findGamesQuery,
            IFindLastEditedGamePackageQuery findLastEditedGamePackageQuery,
            IDirectoryPicker directoryPicker,
            IEqualityComparer <ProxySettings> stateEqualityComparer,
            IEventPublisher publisher,
            IFilePicker filePicker,
            IPluginFactory pluginFactory,
            INavigationService navigationService,
            IProcessable processable,
            ITaskRunner runner)
        {
            _actionBuilder                  = actionBuilder;
            _componentViewModelFactory      = componentViewModelFactory;
            _findFirstLaunchTimeQuery       = findFirstLaunchTimeQuery;
            _findGamePackageByIdQuery       = findGamePackageByIdQuery;
            _findGamesQuery                 = findGamesQuery;
            _findLastEditedGamePackageQuery = findLastEditedGamePackageQuery;
            _directoryPicker                = directoryPicker;
            _stateEqualityComparer          = stateEqualityComparer;
            _publisher         = publisher;
            _filePicker        = filePicker;
            _pluginFactory     = pluginFactory;
            _navigationService = navigationService;
            _processable       = processable;
            _runner            = runner;

            _publisher.Register <ApplicationActionEvent>(this);
            _publisher.Register <ApplicationMinimizedEvent>(this);
            _publisher.Register <ApplicationRestoredEvent>(this);

            ActionCommand             = new ActionCommand(() => _queue.QueueTask(ExecuteActionAsync), IsActionEnabled);
            ActivationState           = new StateViewModel(_runner);
            AddGameProfileCommand     = new ActionCommand(() => _queue.QueueTask(AddGameProfileAsync), () => true);
            ChangedCommand            = new ActionCommand(async() => await UpdateGameProfileAsync(), () => true);
            ClearGameFilePathCommand  = new ActionCommand(async() => await ClearApplicationFilePathAsync(), () => !GameFilePath.IsNullOrEmpty());
            EditGameProfileCommand    = new ActionCommand(() => _queue.QueueAction(EditPluginMainSettings), () => true);
            MoveToGameFilePathCommand = new ActionCommand(MoveToApplicationPath, () => !GameFilePath.IsNullOrEmpty());
            MoveToConfigurationDirectoryPathCommand = new ActionCommand(MoveToConfigurationDirectoryPath, () => !GameFilePath.IsNullOrEmpty());
            MoveToLogsDirectoryPathCommand          = new ActionCommand(MoveToLogsDirectoryPath, () => !GameFilePath.IsNullOrEmpty());
            SwitchModeCommand                 = new ActionCommand(async() => await SwapModeAsync(), () => true);
            PickGameFilePathCommand           = new ActionCommand(async() => await PickApplicationFilePathAsync(), () => true);
            PickPluginSettingsEditViewCommand = new GenericActionCommand <IComponentViewModel>(EditPluginComponent, () => true);
            RemoveGameProfileCommand          = new ActionCommand(async() => await RemoveGameProfileAsync(), () => _package?.Game.Profiles.Count > 1);
            RenameGameProfileCommand          = new ActionCommand(async() => await RenameGameProfileAsync(), () => true);
            ValidationTriggeredCommand        = new GenericActionCommand <ValidationResultEventArgs>(eventArgs => _queue.QueueAction(Validate), () => true);
        }