Example #1
0
        private void SelectCoverExecute(object obj)
        {
            var title  = Translation.SelectCoverFile;
            var filter = Translation.PDFFiles
                         + @" (*.pdf)|*.pdf|"
                         + Translation.AllFiles
                         + @" (*.*)|*.*";

            CurrentProfile.CoverPage.File = _openFileInteractionHelper.StartOpenFileInteraction(CurrentProfile.CoverPage.File, title, filter);
            RaisePropertyChanged(nameof(CurrentProfile));
        }
        private Option <string> SelectFileAction(string currentAttachment)
        {
            var title  = Translation.SelectFile;
            var filter = Interaction.Filter ?? Translation.AllFiles + " " + @"(*.*)|*.*";

            var interactionResult = _openFileInteractionHelper.StartOpenFileInteraction(currentAttachment, title, filter);

            interactionResult.MatchSome(s => { AdditionalAttachmentsTokenViewModel.RaiseTextChanged(); });

            return(interactionResult);
        }
        private void SelectBackgroundExecute(object obj)
        {
            var titel  = Translator.GetTranslation("BackgroundSettings", "SelectBackgroundFile");
            var filter = Translator.GetTranslation("BackgroundSettings", "PDFFiles")
                         + @" (*.pdf)|*.pdf|"
                         + Translator.GetTranslation("BackgroundSettings", "AllFiles")
                         + @" (*.*)|*.*";

            CurrentProfile.BackgroundPage.File = _openFileInteractionHelper.StartOpenFileInteraction(CurrentProfile.BackgroundPage.File, titel, filter);
            RaisePropertyChanged(nameof(CurrentProfile));
        }
Example #4
0
        private void ChooseCertificateFileExecute(object obj)
        {
            var title  = Translator.GetTranslation("ProfileSettingsWindow", "SelectCertFile");
            var filter = Translator.GetTranslation("ProfileSettingsWindow", "PfxP12Files")
                         + @" (*.pfx, *.p12)|*.pfx;*.p12|"
                         + Translator.GetTranslation("ProfileSettingsWindow", "AllFiles")
                         + @" (*.*)|*.*";

            Signature.CertificateFile = _openFileInteractionHelper.StartOpenFileInteraction(Signature.CertificateFile, title, filter);
            RaisePropertyChanged(nameof(Signature));
        }
Example #5
0
        private void ChooseCertificateFileExecute(object obj)
        {
            var title  = Translation.SelectCertFile;
            var filter = Translation.PfxP12Files
                         + @" (*.pfx, *.p12)|*.pfx;*.p12|"
                         + Translation.AllFiles
                         + @" (*.*)|*.*";

            Signature.CertificateFile = _openFileInteractionHelper.StartOpenFileInteraction(Signature.CertificateFile, title, filter);
            RaisePropertyChanged(nameof(Signature));
        }
        private void SelectAttatchmentExecute(object obj)
        {
            var title  = Translator.GetTranslation("AttachmentSettings", "SelectAttachmentFile");
            var filter = Translator.GetTranslation("AttachmentSettings", "PDFFiles")
                         + @" (*.pdf)|*.pdf|"
                         + Translator.GetTranslation("AttachmentSettings", "AllFiles")
                         + @" (*.*)|*.*";

            CurrentProfile.AttachmentPage.File = _openFileInteractionHelper.StartOpenFileInteraction(CurrentProfile.AttachmentPage.File, title, filter);
            RaisePropertyChanged(nameof(CurrentProfile));
        }
        private void BrowseScriptExecute(object obj)
        {
            var title  = Translator.GetTranslation("ScriptActionSettings", "SelectScriptTitle");
            var filter = Translator.GetTranslation("ScriptActionSettings", "ExecutableFiles")
                         + @" (*.exe, *.bat, *.cmd)|*.exe;*.bat;*.cmd|"
                         + Translator.GetTranslation("ScriptActionSettings", "AllFiles")
                         + @"(*.*)|*.*";

            var result = _openFileInteractionHelper.StartOpenFileInteraction(CurrentProfile.Scripting.ScriptFile, title, filter);

            ScriptFileTokenViewModel.Text = result;
            ScriptFileTokenViewModel.RaiseTextChanged();
        }
        public void ExecuteFindPath(object data)
        {
            var model  = (DefaultViewer)data;
            var filter = Translation.ExecutableFiles
                         + @" (*.exe, *.bat, *.cmd)|*.exe;*.bat;*.cmd|"
                         + Translation.AllFiles
                         + @"(*.*)|*.*";

            var interactionResult = _fileInteractionHelper.StartOpenFileInteraction("", "", filter);

            interactionResult.MatchSome(s =>
            {
                model.Path = s;
                RaisePropertyChanged(nameof(DefaultViewers));
            });
        }
        private void SelectBackgroundExecute(object obj)
        {
            var titel  = Translation.SelectBackgroundFile;
            var filter = Translation.PDFFiles
                         + @" (*.pdf)|*.pdf|"
                         + Translation.AllFiles
                         + @" (*.*)|*.*";

            var interactionResult = _openFileInteractionHelper.StartOpenFileInteraction(CurrentProfile.BackgroundPage.File, titel, filter);

            interactionResult.MatchSome(s =>
            {
                CurrentProfile.BackgroundPage.File = s;
                RaisePropertyChanged(nameof(CurrentProfile));
            });
        }
Example #10
0
        private Option <string> SelectBackgroundAction(string s1)
        {
            var titel  = Translation.SelectBackgroundFile;
            var filter = Translation.PDFFiles
                         + @" (*.pdf)|*.pdf|"
                         + Translation.AllFiles
                         + @" (*.*)|*.*";

            var interactionResult = _openFileInteractionHelper.StartOpenFileInteraction(CurrentProfile.BackgroundPage.File, titel, filter);

            interactionResult.MatchSome(s =>
            {
                BackgroundTokenViewModel.Text = s;
                BackgroundTokenViewModel.RaiseTextChanged();
            });

            return(interactionResult);
        }
        private Option <string> SelectScriptFileAction(string s1)
        {
            var title  = Translation.SelectScriptTitle;
            var filter = Translation.ExecutableFiles
                         + @" (*.exe, *.bat, *.cmd)|*.exe;*.bat;*.cmd|"
                         + Translation.AllFiles
                         + @"(*.*)|*.*";

            var interactionResult = _openFileInteractionHelper.StartOpenFileInteraction(CurrentProfile.Scripting.ScriptFile, title, filter);

            interactionResult.MatchSome(s =>
            {
                ScriptFileTokenViewModel.Text = s;
                ScriptFileTokenViewModel.RaiseTextChanged();
            });

            return(interactionResult);
        }
        private Option <string> SelectAttatchmentAction(string s1)
        {
            var title  = Translation.SelectAttachmentFile;
            var filter = Translation.PDFFiles
                         + @" (*.pdf)|*.pdf|"
                         + Translation.AllFiles
                         + @" (*.*)|*.*";

            var interactionResult = _openFileInteractionHelper.StartOpenFileInteraction(CurrentProfile.AttachmentPage.File, title, filter);

            interactionResult.MatchSome(s =>
            {
                AttachmentFileTokenViewModel.Text = s;
                AttachmentFileTokenViewModel.RaiseTextChanged();
            });

            return(interactionResult);
        }
        private Option <string> SelectPrivateKeyFile(string arg)
        {
            var titel  = Translation.SelectKeyFile;
            var filter = Translation.KeyFiles
                         + @" (*.ppk;*.key)|*.ppk;*.key|"
                         + Translation.AllFiles
                         + @" (*.*)|*.*";

            var interactionResult = _openFileInteractionHelper.StartOpenFileInteraction(FtpAccount.PrivateKeyFile, titel, filter);

            interactionResult.MatchSome(s =>
            {
                FtpAccountTokenViewModel.Text = s;
                FtpAccountTokenViewModel.RaiseTextChanged();
                SaveCommand.RaiseCanExecuteChanged();
            });

            return(interactionResult);
        }
Example #14
0
        private Option <string> SelectCoverPageAction(string s1)
        {
            var title  = Translation.SelectCoverFile;
            var filter = Translation.PDFFiles
                         + @" (*.pdf)|*.pdf|"
                         + Translation.AllFiles
                         + @" (*.*)|*.*";

            var interactionResult = _openFileInteractionHelper.StartOpenFileInteraction(CurrentProfile.CoverPage.File, title, filter);

            interactionResult.MatchSome(s =>
            {
                CoverPageTokenViewModel.Text = s;
                CoverPageTokenViewModel.RaiseTextChanged();
            });

            CheckIfVersionIsPdf20();

            return(interactionResult);
        }
Example #15
0
        protected Option <string> SelectAttachmentFileAction(string s1)
        {
            var title  = Translation.SelectAttachmentTitle;
            var filter = Translation.AllFiles + " " + @"(*.*)|*.*";

            var interactionResult = _openFileInteractionHelper.StartOpenFileInteraction("", title, filter);

            interactionResult.MatchSome(s =>
            {
                if (!AdditionalAttachmentsDictionary.ContainsKey(s))
                {
                    AdditionalAttachments.Add(s);
                }

                RaisePropertyChanged(nameof(AdditionalAttachmentsForTextBox));
                RaisePropertyChanged(nameof(AdditionalAttachmentsDictionary));
                RaisePropertyChanged(nameof(AdditionalAttachments));

                AdditionalAttachmentsTokenViewModel.RaiseTextChanged();
            });

            return(Option.Some(AdditionalAttachmentsForTextBox ?? ""));
        }
 public Func <string, Option <string> > GetBrowseFileFunction(string title, string filter)
 {
     return(s => _openFileInteractionHelper.StartOpenFileInteraction(s, title, filter));
 }