예제 #1
0
        /// <summary>
        ///     Apply all Actions according to the configuration
        /// </summary>
        protected virtual void SetUpActions()
        {
            // it does not work yet...

            /*if (Profile.Stamping.Enable)
             * {
             *  StampPdfAction stamp = new StampPdfAction(Profile.Stamping.StampText, Profile.Stamping.FontName);
             *  JobActions.Add(stamp);
             * }*/

            if (Profile.Scripting.Enabled)
            {
                AddAction(new ScriptAction());
                Logger.Trace("Script-Action added");
            }

            if (Profile.OpenViewer)
            {
                var defaultViewerAction = new DefaultViewerAction(true);
                defaultViewerAction.RecommendPdfArchitect += OnRecommendPdfArchitect;
                AddAction(defaultViewerAction);

                Logger.Trace("Viewer-Action added");
            }

            if (Profile.Printing.Enabled)
            {
                AddAction(new PrintingAction(_ghostScript));
                Logger.Trace("Print-Action added");
            }

            if (Profile.EmailSmtp.Enabled)
            {
                var smtpMailAction = new SmtpMailAction(JobTranslations.EmailSignature);
                smtpMailAction.QueryRetypeSmtpPassword += OnRetypeSmtpPassword;
                AddAction(smtpMailAction);
                Logger.Trace("SMTP-Mail-Action added");
            }

            if (Profile.EmailClient.Enabled)
            {
                var eMailClientAction = new EMailClientAction(JobTranslations.EmailSignature);
                AddAction(eMailClientAction);
                Logger.Trace("EMail-Client-Action added");
            }

            if (Profile.Ftp.Enabled)
            {
                var ftpAction = new FtpAction();
                AddAction(ftpAction);
                Logger.Trace("Ftp-Action added");
            }

            /*if (Profile.AttachMe.Enable)
             * {
             *  var attachMeAction = new AttachMeAction();
             *  AddAction(attachMeAction);
             *  Logger.Trace("Attach.Me added");
             * }*/
        }
        public void SetUp()
        {
            _settings           = new PdfCreatorSettings();
            _fileAssoc          = Substitute.For <IFileAssoc>();
            _recommendArchitect = Substitute.For <IRecommendArchitect>();
            _pdfArchitectCheck  = Substitute.For <IPdfArchitectCheck>();
            _pdfArchitectCheck.GetInstallationPath().Returns(ArchitectPath);
            _settingsProvider = Substitute.For <ISettingsProvider>();
            _settingsProvider.Settings.Returns(_settings);
            _outputFormatHelper         = new OutputFormatHelper();
            _processStarter             = Substitute.For <IProcessStarter>();
            _defaultViewerCheck         = Substitute.For <IDefaultViewerCheck>();
            _defaultViewer              = new DefaultViewer();
            _defaultViewer.OutputFormat = OutputFormat.Pdf;
            _defaultViewer.Path         = DefaultViewerPath;
            _settings.DefaultViewers.Add(_defaultViewer);
            _job = new Job(new JobInfo(), new ConversionProfile(), new Accounts());

            _profile = new ConversionProfile();

            _defaultViewerAction = new DefaultViewerAction(_fileAssoc, _recommendArchitect, _pdfArchitectCheck, _settingsProvider, _outputFormatHelper, _processStarter, _defaultViewerCheck);
        }
 public QuickActionOpenWithPdfArchitectCommand(ITranslationUpdater translationUpdater, DefaultViewerAction action, IPdfArchitectCheck architectCheck, IRecommendArchitect recommendArchitect) : base(translationUpdater)
 {
     _action             = action;
     _architectCheck     = architectCheck;
     _recommendArchitect = recommendArchitect;
 }