Beispiel #1
0
        public CliPatcherVm(
            IPatcherIdProvider idProvider,
            IPatcherNameVm nameVm,
            IPathToExecutableInputVm pathToExecutableInputVm,
            IProfileDisplayControllerVm selPatcher,
            IConfirmationPanelControllerVm confirmation,
            IShowHelpSetting showHelpSetting,
            ILifetimeScope scope,
            PatcherRenameActionVm.Factory renameFactory,
            CliPatcherSettings?settings = null)
            : base(scope, nameVm, selPatcher, confirmation, idProvider, renameFactory, settings)
        {
            ExecutableInput = pathToExecutableInputVm;
            ShowHelpSetting = showHelpSetting;

            _state = pathToExecutableInputVm.WhenAnyValue(x => x.Picker.ErrorState)
                     .Select(e =>
            {
                return(new ConfigurationState()
                {
                    IsHaltingError = !e.Succeeded,
                    RunnableState = e
                });
            })
                     .ToGuiProperty <ConfigurationState>(this, nameof(State), new ConfigurationState(ErrorResponse.Fail("Evaluating"))
            {
                IsHaltingError = false
            }, deferSubscription: true);
        }
Beispiel #2
0
 public CliPatcherNameVm(
     ICliNameConverter cliNameConverter,
     IPathToExecutableInputVm pathToExecutableInputVm)
 {
     _cliNameConverter = cliNameConverter;
     _Name             = pathToExecutableInputVm.WhenAnyValue(x => x.Picker.TargetPath)
                         .Select(x => _cliNameConverter.Convert(x))
                         .CombineLatest(
         this.WhenAnyValue(x => x.Nickname),
         (auto, nickname) => nickname.IsNullOrWhitespace() ? auto : nickname)
                         .ToGuiProperty <string>(this, nameof(Name), string.Empty, deferSubscription: true);
 }
Beispiel #3
0
 public CliPatcherInitVm(
     IPatcherNameVm nameVm,
     IPatcherInitializationVm init,
     IShowHelpSetting showHelpSetting,
     IPathToExecutableInputVm executableInputVm,
     IPatcherFactory factory)
 {
     _init                     = init;
     Factory                   = factory;
     NameVm                    = nameVm;
     ShowHelpSetting           = showHelpSetting;
     ExecutableInput           = executableInputVm;
     _canCompleteConfiguration = executableInputVm.WhenAnyValue(x => x.Picker.ErrorState)
                                 .Cast <ErrorResponse, ErrorResponse>()
                                 .ToGuiProperty(this, nameof(CanCompleteConfiguration), ErrorResponse.Success);
 }