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 ScriptUserControlViewModel(ITranslationUpdater translationUpdater, ISelectedProfileProvider provider, IOpenFileInteractionHelper openFileInteractionHelper, IScriptActionHelper scriptActionHelper, TokenHelper tokenHelper) : base(translationUpdater, provider) { _openFileInteractionHelper = openFileInteractionHelper; _scriptActionHelper = scriptActionHelper; if (tokenHelper != null) { TokenReplacer = tokenHelper.TokenReplacerWithPlaceHolders; var tokens = new List <string>(TokenReplacer.GetTokenNames(true)); ParameterTokenViewModel = new TokenViewModel(x => CurrentProfile.Scripting.ParameterString = x, () => CurrentProfile?.Scripting.ParameterString, tokens, ReplaceTokens); ScriptFileTokenViewModel = new TokenViewModel(x => CurrentProfile.Scripting.ScriptFile = x, () => CurrentProfile?.Scripting.ScriptFile, tokens, ReplaceTokens, SelectScriptFileAction); ParameterTokenViewModel.OnTextChanged += TokenTextChanged; ScriptFileTokenViewModel.OnTextChanged += TokenTextChanged; TokenTextChanged(this, EventArgs.Empty); } }
public ScriptActionViewModel(ScriptActionSettingsAndActionTranslation translation, IOpenFileInteractionHelper openFileInteractionHelper, IScriptActionHelper scriptActionHelper, TokenHelper tokenHelper) { _openFileInteractionHelper = openFileInteractionHelper; _scriptActionHelper = scriptActionHelper; Translation = translation; TokenReplacer = tokenHelper.TokenReplacerWithPlaceHolders; DisplayName = Translation.DisplayName; Description = Translation.Description; var tokens = new List <string>(TokenReplacer.GetTokenNames(true)); ParameterTokenViewModel = new TokenViewModel(x => CurrentProfile.Scripting.ParameterString = x, () => CurrentProfile?.Scripting.ParameterString, tokens); ScriptFileTokenViewModel = new TokenViewModel(x => CurrentProfile.Scripting.ScriptFile = x, () => CurrentProfile?.Scripting.ScriptFile, tokens); ParameterTokenViewModel.OnTextChanged += TokenTextChanged; ScriptFileTokenViewModel.OnTextChanged += TokenTextChanged; }
public ActionFacadeDescriptionHelper(ICurrentSettings <Accounts> accountSettingsProvider, ISelectedProfileProvider selectedProfileProvider, IScriptActionHelper scriptActionHelper, ITokenHelper tokenHelper, ITranslationFactory translationFactory, ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider) { _accountSettingsProvider = accountSettingsProvider; _selectedProfileProvider = selectedProfileProvider; _translationFactory = translationFactory; _profilesProvider = profilesProvider; _scriptActionHelper = scriptActionHelper; if (tokenHelper != null) { TokenReplacer = tokenHelper.TokenReplacerWithPlaceHolders; } _descriptions = new Dictionary <Type, Func <IProfileSetting, string> > { { typeof(CoverPage), GetCoverActionDescription }, { typeof(BackgroundPage), GetBackgroundActionDescription }, { typeof(AttachmentPage), GetAttachmentActionDescription }, { typeof(Stamping), GetStampActionDescription }, { typeof(Printing), GetPrintActionDescription }, { typeof(Ftp), GetFtpActionDescription }, { typeof(EmailSmtpSettings), GetSmtpActionDescription }, { typeof(DropboxSettings), GetDropboxActionDescription }, { typeof(HttpSettings), GetHttpActionDescription }, { typeof(Signature), GetSignatureActionDescription }, { typeof(EmailClientSettings), GetEmailActionDescription }, { typeof(Security), GetEncryptionActionDescription }, { typeof(Scripting), GetSecurityActionDescription }, { typeof(CustomScript), GetCustomScriptDescription }, { typeof(UserTokens), GetUserTokenDescription }, { typeof(ForwardToFurtherProfile), GetForwardToFurtherProfileDescription }, { typeof(Watermark), GetWatermarkActionDescription }, { typeof(OpenViewer), GetOpenViewerDescription } }; }