protected ADebugSettingsItemControlModel(ISettingsManager settingsManager, ITranslationUpdater translationUpdater, ICurrentSettingsProvider settingsProvider, IGpoSettings gpoSettings) : base(translationUpdater) { GpoSettings = gpoSettings; SettingsManager = settingsManager; SettingsProvider = settingsProvider; ApplicationSettings = settingsProvider.Settings.ApplicationSettings; }
public AccountsViewModel(ICurrentSettingsProvider currentSettingsProvider, ICommandLocator commandLocator, ITranslationUpdater translationUpdater, IDispatcher dispatcher, IGpoSettings gpoSettings) : base(translationUpdater) { _currentSettingsProvider = currentSettingsProvider; _dispatcher = dispatcher; _gpoSettings = gpoSettings; ConflateAllAccounts(_currentSettingsProvider.Settings); FtpAccountAddCommand = commandLocator.GetCommand <FtpAccountAddCommand>(); FtpAccountRemoveCommand = commandLocator.GetCommand <FtpAccountRemoveCommand>(); FtpAccountEditCommand = commandLocator.GetCommand <FtpAccountEditCommand>(); SmtpAccountAddCommand = commandLocator.GetCommand <SmtpAccountAddCommand>(); SmtpAccountRemoveCommand = commandLocator.GetCommand <SmtpAccountRemoveCommand>(); SmtpAccountEditCommand = commandLocator.GetCommand <SmtpAccountEditCommand>(); HttpAccountAddCommand = commandLocator.GetCommand <HttpAccountAddCommand>(); HttpAccountRemoveCommand = commandLocator.GetCommand <HttpAccountRemoveCommand>(); HttpAccountEditCommand = commandLocator.GetCommand <HttpAccountEditCommand>(); DropboxAccountAddCommand = commandLocator.GetCommand <DropboxAccountAddCommand>(); DropboxAccountRemoveCommand = commandLocator.GetCommand <DropboxAccountRemoveCommand>(); TimeServerAccountAddCommand = commandLocator.GetCommand <TimeServerAccountAddCommand>(); TimeServerAccountRemoveCommand = commandLocator.GetCommand <TimeServerAccountRemoveCommand>(); TimeServerAccountEditCommand = commandLocator.GetCommand <TimeServerAccountEditCommand>(); if (_currentSettingsProvider != null) { _currentSettingsProvider.SelectedProfileChanged += CurrentSettingsProviderOnSelectedProfileChanged; } }
public UsageStatisticsViewModel(IOsHelper osHelper, ICommandLocator commandLocator, ICurrentSettingsProvider currentSettingsProvider, IGpoSettings gpoSettings, IUsageMetricFactory usageMetricFactory, ICurrentSettings <Conversion.Settings.UsageStatistics> usageStatisticsProvider, ITranslationUpdater translationUpdater, ApplicationNameProvider applicationNameProvider) : base(osHelper, currentSettingsProvider, gpoSettings, translationUpdater, usageStatisticsProvider, commandLocator, applicationNameProvider) { _usageMetricFactory = usageMetricFactory; }
public LanguageSelectionSettingsViewModel(IGpoSettings gpoSettings, ICurrentSettingsProvider settingsProvider, ILanguageProvider languageProvider, ITranslationHelper translationHelper, ITranslationUpdater translationUpdater) : base(translationUpdater, settingsProvider, gpoSettings) { PreviewTranslationCommand = new DelegateCommand(ExecutePreviewTranslation); _translationHelper = translationHelper; Languages = languageProvider.GetAvailableLanguages().ToList(); }
public SaveAndContinueEvaluationCommand(IInteractionRequest interactionRequest, ICurrentSettingsProvider settingsProvider, ISettingsProvider mainSettingsProvider, ITranslationUpdater translationUpdater) : base(translationUpdater) { _interactionRequest = interactionRequest; _settingsProvider = settingsProvider; _mainSettingsProvider = mainSettingsProvider; }
protected ProfileCommandBase(IInteractionRequest interactionRequest, ICurrentSettingsProvider currentSettingsProvider, ITranslationUpdater translationUpdater) : base(translationUpdater) { InteractionRequest = interactionRequest; CurrentSettingsProvider = currentSettingsProvider; translationUpdater.RegisterAndSetTranslation(this); }
public SaveApplicationSettingsChangesCommand(ICurrentSettingsProvider currentSettingsProvider, ISettingsProvider settingsProvider, ISettingsLoader settingsLoader, ILanguageProvider languageProvider) { _currentSettingsProvider = currentSettingsProvider; _settingsProvider = settingsProvider; _settingsLoader = settingsLoader; _languageProvider = languageProvider; }
public SmtpAccountEditCommand(IInteractionRequest interactionRequest, ICurrentSettingsProvider currentSettingsProvider, ITranslationUpdater translationUpdater) : base(translationUpdater) { _interactionRequest = interactionRequest; _smtpAccounts = currentSettingsProvider.Settings?.ApplicationSettings?.Accounts?.SmtpAccounts ?? new ObservableCollection <SmtpAccount>(); _smtpAccounts.CollectionChanged += (sender, args) => RaiseCanExecuteChanged(); }
public FtpActionViewModel(ITranslationUpdater translationUpdater, ICurrentSettings <Conversion.Settings.Accounts> accountsProvider, ICurrentSettingsProvider currentSettingsProvider, ICommandLocator commandLocator, ITokenViewModelFactory tokenViewModelFactory, IDispatcher dispatcher, IGpoSettings gpoSettings) : base(translationUpdater, currentSettingsProvider, dispatcher) { _gpoSettings = gpoSettings; DirectoryTokenViewModel = tokenViewModelFactory .BuilderWithSelectedProfile() .WithSelector(p => p.Ftp.Directory) .WithDefaultTokenReplacerPreview(th => th.GetTokenListWithFormatting()) .Build(); _ftpAccounts = accountsProvider?.Settings.FtpAccounts; if (_ftpAccounts != null) { FtpAccountsView = new ListCollectionView(_ftpAccounts); FtpAccountsView.SortDescriptions.Add(new SortDescription(nameof(FtpAccount.AccountInfo), ListSortDirection.Ascending)); } AddAccountCommand = commandLocator.CreateMacroCommand() .AddCommand <FtpAccountAddCommand>() .AddCommand(new DelegateCommand(o => SelectNewAccountInView())) .Build(); EditAccountCommand = commandLocator.CreateMacroCommand() .AddCommand <FtpAccountEditCommand>() .AddCommand(new DelegateCommand(o => RefreshAccountsView())) .Build(); }
public HttpActionViewModel(ITranslationUpdater translationUpdater, ICurrentSettings <Conversion.Settings.Accounts> accountsProvider, ICurrentSettingsProvider currentSettingsProvider, ICommandLocator commandLocator, IDispatcher dispatcher, IGpoSettings gpoSettings) : base(translationUpdater, currentSettingsProvider, dispatcher) { _gpoSettings = gpoSettings; _httpAccounts = accountsProvider?.Settings.HttpAccounts; if (_httpAccounts != null) { HttpAccountsView = new ListCollectionView(_httpAccounts); HttpAccountsView.SortDescriptions.Add(new SortDescription(nameof(HttpAccount.AccountInfo), ListSortDirection.Ascending)); } AddAccountCommand = commandLocator.CreateMacroCommand() .AddCommand <HttpAccountAddCommand>() .AddCommand(new DelegateCommand(o => SelectNewAccountInView())) .Build(); EditAccountCommand = commandLocator.CreateMacroCommand() .AddCommand <HttpAccountEditCommand>() .AddCommand(new DelegateCommand(o => RefreshAccountsView())) .Build(); }
public SignUserControlViewModel(IInteractionRequest interactionRequest, IFile file, IOpenFileInteractionHelper openFileInteractionHelper, EditionHintOptionProvider editionHintOptionProvider, ITranslationUpdater translationUpdater, ISelectedProfileProvider selectedProfile, ICurrentSettingsProvider currentSettingsProvider, ICommandLocator commandLocator) : base(translationUpdater, selectedProfile) { _file = file; _openFileInteractionHelper = openFileInteractionHelper; _interactionRequest = interactionRequest; _currentSettingsProvider = currentSettingsProvider; if (editionHintOptionProvider != null) { OnlyForPlusAndBusiness = editionHintOptionProvider.ShowOnlyForPlusAndBusinessHint; } if (currentSettingsProvider?.Settings != null) { _timeServerAccounts = currentSettingsProvider.Settings.ApplicationSettings.Accounts.TimeServerAccounts; TimeServerAccountsView = new ListCollectionView(_timeServerAccounts); TimeServerAccountsView.SortDescriptions.Add(new SortDescription(nameof(TimeServerAccount.AccountInfo), ListSortDirection.Ascending)); } ChooseCertificateFileCommand = new DelegateCommand(ChooseCertificateFileExecute); SignaturePasswordCommand = new DelegateCommand(SignaturePasswordExecute); AddTimeServerAccountCommand = commandLocator.GetMacroCommand() .AddCommand <TimeServerAccountAddCommand>() .AddCommand(new DelegateCommand(o => SelectNewAccountInView())); EditTimeServerAccountCommand = commandLocator.GetMacroCommand() .AddCommand <TimeServerAccountEditCommand>() .AddCommand(new DelegateCommand(o => RefreshAccountsView())); }
public LastSaveDirectoryHelper(ICurrentSettingsProvider currentSettingsProvider, ISettingsManager settingsManager, ITempFolderProvider tempFolderProvider, IPathUtil pathUtil) { _currentSettingsProvider = currentSettingsProvider; _settingsManager = settingsManager; _tempFolderProvider = tempFolderProvider; _pathUtil = pathUtil; }
public DropboxUserControlViewModel(ITranslationUpdater translationUpdater, ICurrentSettings <Conversion.Settings.Accounts> accountsProvider, ICurrentSettingsProvider currentSettingsProvider, ICommandLocator commandLocator, ITokenViewModelFactory tokenViewModelFactory, IDispatcher dispatcher, IGpoSettings gpoSettings) : base(translationUpdater, currentSettingsProvider, dispatcher) { _translationUpdater = translationUpdater; _tokenViewModelFactory = tokenViewModelFactory; _gpoSettings = gpoSettings; AddDropboxAccountCommand = commandLocator.CreateMacroCommand() .AddCommand <DropboxAccountAddCommand>() .AddCommand(new DelegateCommand(SelectNewAccountInView)) .Build(); DropboxAccounts = accountsProvider?.Settings.DropboxAccounts; _translationUpdater.RegisterAndSetTranslation(tf => { SharedFolderTokenViewModel = _tokenViewModelFactory .BuilderWithSelectedProfile() .WithSelector(p => p.DropboxSettings.SharedFolder) .WithDefaultTokenReplacerPreview(th => th.GetTokenListForDirectory()) .Build(); }); }
public SaveSettingsCommand(ICurrentSettingsProvider currentSettingsProvider, ISettingsProvider settingsProvider, ISettingsLoader settingsLoader) { _currentSettingsProvider = currentSettingsProvider; _settingsProvider = settingsProvider; _settingsLoader = settingsLoader; }
public SaveChangedSettingsCommand(ICurrentSettingsProvider currentSettingsProvider, ISettingsManager settingsManager, ISettingsChanged settingsChanged) { _currentSettingsProvider = currentSettingsProvider; _settingsManager = settingsManager; _settingsChanged = settingsChanged; }
public HomeViewSettingsViewModel(ITranslationUpdater translationUpdater, ICurrentSettingsProvider settingsProvider, IGpoSettings gpoSettings, ICurrentSettings <RssFeed> rssFeedProvider, ICurrentSettings <ApplicationSettings> applicationsSettingsProvider) : base(translationUpdater, settingsProvider, gpoSettings) { _rssFeedProvider = rssFeedProvider; _applicationSettingsProvider = applicationsSettingsProvider; }
public AccountsViewModel( ICurrentSettingsProvider currentSettingsProvider, ICurrentSettings <Conversion.Settings.Accounts> accountProvider, ICommandLocator commandLocator, ITranslationUpdater translationUpdater, IDispatcher dispatcher, IGpoSettings gpoSettings) : base(translationUpdater) { _currentSettingsProvider = currentSettingsProvider; _dispatcher = dispatcher; _gpoSettings = gpoSettings; _accountsProvider = accountProvider; _commandLocator = commandLocator; ConflateAllAccounts(); FtpAccountAddCommand = _commandLocator.GetCommand <FtpAccountAddCommand>(); SmtpAccountAddCommand = _commandLocator.GetCommand <SmtpAccountAddCommand>(); HttpAccountAddCommand = _commandLocator.GetCommand <HttpAccountAddCommand>(); DropboxAccountAddCommand = _commandLocator.GetCommand <DropboxAccountAddCommand>(); TimeServerAccountAddCommand = _commandLocator.GetCommand <TimeServerAccountAddCommand>(); RemoveSelectedAccountCommand = new DelegateCommand(OnRemoveSelectedCommand, CanRemoveSelectedCommand); EditSelectedAccountCommand = new DelegateCommand(OnEditSelectedCommand, CanEditSelectedCommand); AddAccountsToken = new List <AccountToken> { new AccountToken(SmtpAccountAddCommand, () => Translation.AddSmtpAccount, "EmailIcon"), new AccountToken(DropboxAccountAddCommand, () => Translation.AddDropboxAccount, "DropboxIcon"), new AccountToken(FtpAccountAddCommand, () => Translation.AddFtpAccount, "FtpIcon"), new AccountToken(HttpAccountAddCommand, () => Translation.AddHttpAccount, "HttpIcon"), new AccountToken(TimeServerAccountAddCommand, () => Translation.AddTimeServerAccount, "TimeServerIcon") }; }
public ProfileRemoveCommand(IInteractionRequest interactionRequest, ICurrentSettingsProvider currentSettingsProvider, ITranslationUpdater translationUpdater, IDispatcher dispatcher) : base(interactionRequest, currentSettingsProvider, translationUpdater) { _dispatcher = dispatcher; CurrentSettingsProvider.SelectedProfileChanged += CurrentSettingsProviderOnSelectedProfileChanged; }
public SmtpActionViewModel(IInteractionRequest interactionRequest, ISmtpTest smtpTest, ITranslationUpdater updater, ICurrentSettingsProvider currentSettingsProvider, ICommandLocator commandLocator, ITokenViewModelFactory tokenViewModelFactory, IDispatcher dispatcher) : base(updater, currentSettingsProvider, dispatcher) { _interactionRequest = interactionRequest; _smtpTest = smtpTest; _currentSettingsProvider = currentSettingsProvider; SetTokenViewModel(tokenViewModelFactory); if (currentSettingsProvider?.Settings != null) { _smtpAccounts = currentSettingsProvider.Settings.ApplicationSettings.Accounts.SmtpAccounts; SmtpAccountsView = new ListCollectionView(_smtpAccounts); SmtpAccountsView.SortDescriptions.Add(new SortDescription(nameof(SmtpAccount.AccountInfo), ListSortDirection.Ascending)); } AddAccountCommand = commandLocator.CreateMacroCommand() .AddCommand <SmtpAccountAddCommand>() .AddCommand(new DelegateCommand(o => SelectNewAccountInView())) .Build(); EditAccountCommand = commandLocator.CreateMacroCommand() .AddCommand <SmtpAccountEditCommand>() .AddCommand(new DelegateCommand(o => RefreshAccountsView())) .Build(); EditMailTextCommand = new DelegateCommand(EditMailTextExecute); TestSmtpCommand = new DelegateCommand(TextSmtpExecute); }
public CheckProfileCommand(IProfileChecker profileChecker, ICurrentSettingsProvider currentSettingsProvider, IInteractionRequest interactionRequest, ErrorCodeInterpreter errorCodeInterpreter) { _profileChecker = profileChecker; _currentSettingsProvider = currentSettingsProvider; _interactionRequest = interactionRequest; _errorCodeInterpreter = errorCodeInterpreter; CanExecuteChanged?.Invoke(this, EventArgs.Empty); }
public SettingsActionComponent AddSettings <TSettings>(ICurrentSettingsProvider currentSettingsProvider, Type settingType, Expression <Func <ConversionProfile, TSettings> > getSettingFunction) where TSettings : IProfileSetting { var settings = new SettingsActionComponent(currentSettingsProvider, settingType); settings.Init <TSettings>(getSettingFunction); _components.Add(settings); return(settings); }
public LanguageSelectionSettingsViewModel(IGpoSettings gpoSettings, ICurrentSettingsProvider settingsProvider, ILanguageProvider languageProvider, ITranslationHelper translationHelper, ITranslationUpdater translationUpdater) : base(translationUpdater, settingsProvider, gpoSettings) { PreviewTranslationCommand = new DelegateCommand(ExecutePreviewTranslation); _translationHelper = translationHelper; Languages = languageProvider.GetAvailableLanguages().ToList(); SettingsProvider.SettingsChanged += (sender, args) => RaisePropertyChanged(nameof(CurrentLanguage)); }
public MetadataViewModel(ITranslationUpdater translationUpdater, ICurrentSettingsProvider currentSettingsProvider, TokenHelper tokenHelper) : base(translationUpdater) { _currentSettingsProvider = currentSettingsProvider; _tokenHelper = tokenHelper; translationUpdater.RegisterAndSetTranslation(SetTokenViewModels); _currentSettingsProvider.SelectedProfileChanged += (sender, args) => SetTokenViewModels(); }
public SettingsChanged(ICurrentSettingsProvider currentSettingsProvider, ISettingsProvider settingsProvider, ILanguageProvider languageProvider, IGpoSettings gpoSettings) { _currentSettingsProvider = currentSettingsProvider; _settingsProvider = settingsProvider; _languageProvider = languageProvider; _gpoSettings = gpoSettings; }
public SignatureUserControlViewModel( IOpenFileInteractionHelper openFileInteractionHelper, EditionHelper editionHelper, ICurrentSettings <Conversion.Settings.Accounts> accountsProvider, ITranslationUpdater translationUpdater, ICurrentSettingsProvider currentSettingsProvider, ICommandLocator commandLocator, ISignaturePasswordCheck signaturePasswordCheck, IFile file, ITokenViewModelFactory tokenViewModelFactory, IDispatcher dispatcher, IGpoSettings gpoSettings, ISigningPositionToUnitConverterFactory signingPositionToUnitConverter, ICurrentSettings <ApplicationSettings> applicationSettings) : base(translationUpdater, currentSettingsProvider, dispatcher) { _openFileInteractionHelper = openFileInteractionHelper; _commandLocator = commandLocator; _signaturePasswordCheck = signaturePasswordCheck; _file = file; _gpoSettings = gpoSettings; _signingPositionToUnitConverter = signingPositionToUnitConverter; ApplicationSettings = applicationSettings; UnitConverter = _signingPositionToUnitConverter?.CreateSigningPositionToUnitConverter(UnitOfMeasurement.Centimeter); translationUpdater.RegisterAndSetTranslation(tf => SetTokenViewModels(tokenViewModelFactory)); currentSettingsProvider.SelectedProfileChanged += (sender, args) => SetTokenViewModels(tokenViewModelFactory); if (editionHelper != null) { OnlyForPlusAndBusiness = editionHelper.ShowOnlyForPlusAndBusiness; } _timeServerAccounts = accountsProvider?.Settings.TimeServerAccounts; if (_timeServerAccounts != null) { TimeServerAccountsView = new ListCollectionView(_timeServerAccounts); TimeServerAccountsView.SortDescriptions.Add(new SortDescription(nameof(TimeServerAccount.AccountInfo), ListSortDirection.Ascending)); } ChooseCertificateFileCommand = new DelegateCommand(ChooseCertificateFileExecute); ChangeUnitConverterCommand = new DelegateCommand(ChangeUnitConverterExecute); if (Signature != null) { AskForPasswordLater = string.IsNullOrEmpty(Password); } _timeServerAccountEditCommand = _commandLocator.GetCommand <TimeServerAccountEditCommand>(); AddTimeServerAccountCommand = _commandLocator.CreateMacroCommand() .AddCommand <TimeServerAccountAddCommand>() .AddCommand(new DelegateCommand(o => SelectNewAccountInView())) .Build(); EditTimeServerAccountCommand = _commandLocator.CreateMacroCommand() .AddCommand(_timeServerAccountEditCommand) .AddCommand(new DelegateCommand(o => RefreshAccountsView())) .Build(); }
public QuickActionViewModel(ITranslationUpdater translationUpdater, ICommandLocator commandLocator, IReadableFileSizeFormatter readableFileSizeHelper, ICurrentSettingsProvider currentSettingsProvider) : base(translationUpdater) { _commandLocator = commandLocator; _readableFileSizeHelper = readableFileSizeHelper; _currentSettingsProvider = currentSettingsProvider; StartQuickActionCommand = new DelegateCommand(StartQuickActionCommandExecute); FinishCommand = new DelegateCommand(OnFinish); InitList(); }
public TimeServerAccountEditCommand(IInteractionRequest interactionRequest, ICurrentSettingsProvider currentSettingsProvider, ITranslationUpdater translationUpdater) : base(translationUpdater) { _interactionRequest = interactionRequest; _currentSettingsProvider = currentSettingsProvider; TimeServerAccounts.CollectionChanged += (sender, args) => RaiseCanExecuteChanged(); }
private MetadataViewModel BuildViewModel() { _currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>(); _currentSettingsProvider.SelectedProfile.Returns(_profile); var translationUpdater = new TranslationUpdater(_translationFactory, Substitute.For <IThreadManager>()); return(new MetadataViewModel(translationUpdater, _currentSettingsProvider, new TokenHelper(new DesignTimeTranslationUpdater()))); }
public void BuildViewModel_PropertiesAreSet() { _settingsProvider = null; var viewModel = BuildViewModel(); Assert.AreEqual(viewModel.SampleText, "Microsoft Word - Sample Text.doc"); Assert.AreEqual(viewModel.ReplacedSampleText, "Microsoft Word - Sample Text.doc"); Assert.NotNull(viewModel.Translation); }
public SwitchLayoutCommand(IRegionManager regionManager, IInteractionRequest interactionRequest, ICurrentSettings <ObservableCollection <ConversionProfile> > profiles, IActionOrderHelper actionOrderHelper, ITranslationUpdater translationUpdater, ICurrentSettingsProvider currentSettingsProvider, IEventAggregator eventAggregator) : base(translationUpdater) { _regionManager = regionManager; _interactionRequest = interactionRequest; _profiles = profiles; _actionOrderHelper = actionOrderHelper; _currentSettingsProvider = currentSettingsProvider; _eventAggregator = eventAggregator; }