public ScriptUserControlViewModel(ITranslationUpdater translationUpdater, ISelectedProfileProvider provider, IOpenFileInteractionHelper openFileInteractionHelper, IScriptActionHelper scriptActionHelper, TokenHelper tokenHelper, ITokenViewModelFactory tokenViewModelFactory, IDispatcher dispatcher) : base(translationUpdater, provider, dispatcher) { _openFileInteractionHelper = openFileInteractionHelper; _scriptActionHelper = scriptActionHelper; if (tokenHelper != null) { TokenReplacer = tokenHelper.TokenReplacerWithPlaceHolders; var tokens = tokenHelper.GetTokenListWithFormatting(); ParameterTokenViewModel = tokenViewModelFactory.BuilderWithSelectedProfile() .WithSelector(p => p.Scripting.ParameterString) .WithTokenList(tokens) .WithTokenReplacerPreview(TokenReplacer) .Build(); ScriptFileTokenViewModel = tokenViewModelFactory.BuilderWithSelectedProfile() .WithSelector(p => p.Scripting.ScriptFile) .WithTokenList(tokens) .WithTokenReplacerPreview(TokenReplacer) .WithButtonCommand(SelectScriptFileAction) .Build(); ParameterTokenViewModel.TextChanged += TokenTextChanged; ScriptFileTokenViewModel.TextChanged += TokenTextChanged; TokenTextChanged(this, EventArgs.Empty); } }
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 FtpActionViewModel(TokenHelper tokenHelper, ITranslationUpdater translationUpdater, ICurrentSettingsProvider currentSettingsProvider, ICommandLocator commandLocator, ITokenViewModelFactory tokenViewModelFactory, IDispatcher dispatcher) : base(translationUpdater, currentSettingsProvider, dispatcher) { // TODO update on translation change! DirectoryTokenViewModel = tokenViewModelFactory .BuilderWithSelectedProfile() .WithSelector(p => p.Ftp.Directory) .WithDefaultTokenReplacerPreview(th => th.GetTokenListWithFormatting()) .Build(); if (currentSettingsProvider?.Settings != null) { _ftpAccounts = currentSettingsProvider.Settings.ApplicationSettings.Accounts.FtpAccounts; 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(); }
private void SetTokenViewModels(ITokenViewModelFactory tokenViewModelFactory) { SharedFolderTokenViewModel = tokenViewModelFactory .BuilderWithSelectedProfile() .WithSelector(p => p.DropboxSettings.SharedFolder) .WithDefaultTokenReplacerPreview(th => th.GetTokenListForDirectory()) .Build(); }
private void SetTokenViewModels(ITokenViewModelFactory tokenViewModelFactory, List <string> tokens) { StampUserControlTokenViewModel = tokenViewModelFactory .BuilderWithSelectedProfile() .WithSelector(p => p.Stamping.StampText) .WithTokenList(tokens) .WithTokenCustomPreview(TokenReplace) .Build(); }
public void SetTokenViewModels(ITokenViewModelFactory tokenViewModelFactory) { var builder = tokenViewModelFactory .BuilderWithSelectedProfile() .WithDefaultTokenReplacerPreview(th => th.GetTokenListForMetadata()); TitleTokenViewModel = builder.WithSelector(p => p.TitleTemplate).Build(); AuthorTokenViewModel = builder.WithSelector(p => p.AuthorTemplate).Build(); SubjectTokenViewModel = builder.WithSelector(p => p.SubjectTemplate).Build(); KeywordsTokenViewModel = builder.WithSelector(p => p.KeywordTemplate).Build(); UpdateMetadata(); }
private void SetTokenViewModels(ITokenViewModelFactory tokenViewModelFactory) { var builder = tokenViewModelFactory .BuilderWithSelectedProfile() .WithDefaultTokenReplacerPreview(th => th.GetTokenListForMetadata()); TitleTokenViewModel = builder.WithSelector(p => p.TitleTemplate).Build(); AuthorTokenViewModel = builder.WithSelector(p => p.AuthorTemplate).Build(); SubjectTokenViewModel = builder.WithSelector(p => p.SubjectTemplate).Build(); KeywordsTokenViewModel = builder.WithSelector(p => p.KeywordTemplate).Build(); RaisePropertyChanged(nameof(TitleTokenViewModel)); RaisePropertyChanged(nameof(AuthorTokenViewModel)); RaisePropertyChanged(nameof(SubjectTokenViewModel)); RaisePropertyChanged(nameof(KeywordsTokenViewModel)); }
private void SetTokenViewModel(ITokenViewModelFactory tokenViewModelFactory) { var builder = tokenViewModelFactory.BuilderWithSelectedProfile() .WithDefaultTokenReplacerPreview(th => th.GetTokenListForEmailRecipients()); RecipientsTokenViewModel = builder .WithSelector(p => p.EmailSmtpSettings.Recipients) .Build(); RecipientsCcTokenViewModel = builder .WithSelector(p => p.EmailSmtpSettings.RecipientsCc) .Build(); RecipientsBccTokenViewModel = builder .WithSelector(p => p.EmailSmtpSettings.RecipientsBcc) .Build(); }
public CoverUserControlViewModel(IOpenFileInteractionHelper openFileInteractionHelper, ITranslationUpdater translationUpdater, ISelectedProfileProvider selectedProfile, TokenHelper tokenHelper, ITokenViewModelFactory tokenViewModelFactory, IDispatcher dispatcher) : base(translationUpdater, selectedProfile, dispatcher) { _openFileInteractionHelper = openFileInteractionHelper; if (tokenHelper != null) { TokenReplacer = tokenHelper.TokenReplacerWithPlaceHolders; var tokens = tokenHelper.GetTokenListForExternalFiles(); CoverPageTokenViewModel = tokenViewModelFactory.BuilderWithSelectedProfile() .WithSelector(p => p.CoverPage.File) .WithTokenList(tokens) .WithTokenReplacerPreview(TokenReplacer) .WithButtonCommand(SelectCoverPageAction) .Build(); RaisePropertyChanged(nameof(CoverPageTokenViewModel)); } }
public override void MountView() { if (_tokenHelper != null) { TokenReplacer = _tokenHelper.TokenReplacerWithPlaceHolders; var tokens = _tokenHelper.GetTokenListForExternalFiles(); WatermarkTokenViewModel = _tokenViewModelFactory.BuilderWithSelectedProfile() .WithSelector(p => p.Watermark.File) .WithTokenList(tokens) .WithTokenReplacerPreview(TokenReplacer) .WithButtonCommand(SelectWatermarkFileAction) .Build(); RaisePropertyChanged(nameof(WatermarkTokenViewModel)); WatermarkTokenViewModel.MountView(); } CheckIfVersionIsPdf20(); base.MountView(); }
private void CreateTokenViewModels(ITokenViewModelFactory tokenViewModelFactory) { var builder = tokenViewModelFactory .BuilderWithSelectedProfile() .WithDefaultTokenReplacerPreview(th => th.GetTokenListForEmailRecipients()); RecipientsTokenViewModel = builder .WithSelector(p => p.EmailClientSettings.Recipients) .Build(); RecipientsCcTokenViewModel = builder .WithSelector(p => p.EmailClientSettings.RecipientsCc) .Build(); RecipientsBccTokenViewModel = builder .WithSelector(p => p.EmailClientSettings.RecipientsBcc) .Build(); RaisePropertyChanged(nameof(RecipientsTokenViewModel)); }
public FtpActionViewModel(ITranslationUpdater translationUpdater, ICurrentSettings <Conversion.Settings.Accounts> accountsProvider, ICurrentSettingsProvider currentSettingsProvider, ICommandLocator commandLocator, ITokenViewModelFactory tokenViewModelFactory, IDispatcher dispatcher, IGpoSettings gpoSettings) : base(translationUpdater, currentSettingsProvider, dispatcher) { _accountsProvider = accountsProvider; _commandLocator = commandLocator; _tokenViewModelFactory = tokenViewModelFactory; _gpoSettings = gpoSettings; _ftpAccounts = _accountsProvider?.Settings.FtpAccounts; if (_ftpAccounts != null) { FtpAccountsView = new ListCollectionView(_ftpAccounts); FtpAccountsView.SortDescriptions.Add(new SortDescription(nameof(FtpAccount.AccountInfo), ListSortDirection.Ascending)); FtpAccountsView.CurrentChanged += (sender, args) => RaisePropertyChanged(nameof(ShowAutosaveRequiresPasswords)); } AddAccountCommand = _commandLocator.CreateMacroCommand() .AddCommand <FtpAccountAddCommand>() .AddCommand(new DelegateCommand(o => SelectNewAccountInView())) .Build(); EditAccountCommand = _commandLocator.CreateMacroCommand() .AddCommand <FtpAccountEditCommand>() .AddCommand(new DelegateCommand(o => RefreshAccountsView())) .Build(); DirectoryTokenViewModel = _tokenViewModelFactory .BuilderWithSelectedProfile() .WithSelector(p => p.Ftp.Directory) .WithDefaultTokenReplacerPreview(th => th.GetTokenListWithFormatting()) .Build(); }
private void SetTokenViewModels(ITokenViewModelFactory tokenViewModelFactory) { var builder = tokenViewModelFactory .BuilderWithSelectedProfile() .WithDefaultTokenReplacerPreview(th => th.GetTokenListWithFormatting()); SignReasonTokenViewModel = builder .WithSelector(p => p.PdfSettings.Signature.SignReason) .Build(); SignContactTokenViewModel = builder .WithSelector(p => p.PdfSettings.Signature.SignContact) .Build(); SignLocationTokenViewModel = builder .WithSelector(p => p.PdfSettings.Signature.SignLocation) .Build(); RaisePropertyChanged(nameof(SignReasonTokenViewModel)); RaisePropertyChanged(nameof(SignContactTokenViewModel)); RaisePropertyChanged(nameof(SignLocationTokenViewModel)); }
private void SetTokenViewModels() { _tokenReplacer = _tokenHelper.TokenReplacerWithPlaceHolders; var builder = _tokenViewModelFactory .BuilderWithSelectedProfile(); FileNameViewModel = builder .WithTokenList(_tokenHelper.GetTokenListForFilename()) .WithTokenCustomPreview(PreviewForFileName) .WithSelector(p => p.FileNameTemplate) .Build(); FolderViewModel = builder .WithTokenList(_tokenHelper.GetTokenListForDirectory()) .WithTokenCustomPreview(PreviewForFolder) .WithSelector(p => p.TargetDirectory) .WithButtonCommand(_buttonFunctionProvider.GetBrowseFolderFunction(Translation.ChooseFolder)) .Build(); RaisePropertyChanged(nameof(FileNameViewModel)); RaisePropertyChanged(nameof(FolderViewModel)); }
private void SetTokenViewModel(ITokenViewModelFactory tokenViewModelFactory) { var builder = tokenViewModelFactory.BuilderWithSelectedProfile() .WithDefaultTokenReplacerPreview(th => th.GetTokenListForEmailRecipients()); RecipientsTokenViewModel = builder .WithSelector(p => p.EmailSmtpSettings.Recipients) .Build(); RecipientsCcTokenViewModel = builder .WithSelector(p => p.EmailSmtpSettings.RecipientsCc) .Build(); RecipientsBccTokenViewModel = builder .WithSelector(p => p.EmailSmtpSettings.RecipientsBcc) .Build(); AdditionalAttachmentsTokenViewModel = builder .WithSelector(p => AdditionalAttachmentsForTextBox) .WithButtonCommand(SelectAttachmentFileAction) .WithSecondaryButtonCommand(AddFilePathToAdditionalAttachments) .Build(); }