public ActionResult ProfileCheck(ConversionProfile profile, Accounts accounts, CheckLevel checkLevel)
        {
            var actionResult = new ActionResult();

            actionResult.AddRange(CheckTargetDirectory(profile, checkLevel));
            actionResult.AddRange(CheckFileNameTemplate(profile, checkLevel));

            foreach (var action in _actions)
            {
                if (!(action is ICheckable checkable))
                {
                    continue;
                }

                if (!checkable.IsEnabled(profile))
                {
                    continue;
                }

                var result = checkable.Check(profile, accounts, checkLevel);
                actionResult.AddRange(result);
            }

            return(actionResult);
        }
Beispiel #2
0
        public ActionResult CheckDefaultViewers(ApplicationSettings appSettings)
        {
            var result = new ActionResult();

            foreach (var defaultViewer in appSettings.DefaultViewers)
            {
                result.AddRange(_defaultViewerCheck.Check(defaultViewer));
            }

            return(result);
        }
        public ActionResult CheckDefaultViewers(IEnumerable <DefaultViewer> defaultViewers)
        {
            var result = new ActionResult();

            foreach (var defaultViewer in defaultViewers)
            {
                result.AddRange(_defaultViewerCheck.Check(defaultViewer));
            }

            return(result);
        }
Beispiel #4
0
        public void DefaultViewerWithMultipleErrors_ReturnsError()
        {
            _defaultViewer.OutputFormat = OutputFormat.Pdf;
            _defaultViewer.Path         = "";
            var checkResult = new ActionResult();

            checkResult.AddRange(new[] { ErrorCode.DefaultViewer_Not_Found, ErrorCode.DefaultViewer_PathIsEmpty_for_Pdf });
            _defaultViewerCheck.Check(_defaultViewer).Returns(checkResult);

            var result = _appSettingsChecker.CheckDefaultViewers(_applicationSettings);

            Assert.Contains(ErrorCode.DefaultViewer_Not_Found, result, "Did not detect error.");
            Assert.Contains(ErrorCode.DefaultViewer_PathIsEmpty_for_Pdf, result, "Did not detect error.");
        }
Beispiel #5
0
        public ActionResult ProfileCheck(ConversionProfile profile, Accounts accounts)
        {
            var actionResult = new ActionResult();

            actionResult.AddRange(CheckAutosaveSettings(profile));
            actionResult.AddRange(CheckSaveSettings(profile));
            actionResult.AddRange(CheckCoverPageSettings(profile));
            actionResult.AddRange(CheckAttachmentPageSettings(profile));
            actionResult.AddRange(CheckStampingSettings(profile));
            actionResult.AddRange(CheckEncryptionSettings(profile));
            actionResult.AddRange(CheckBackgroundpageSettings(profile));
            actionResult.AddRange(CheckSignatureSettings(profile, accounts));

            foreach (var actionCheck in _actionChecks)
            {
                actionResult.AddRange(actionCheck.Check(profile, accounts));
            }

            return(actionResult);
        }
Beispiel #6
0
        private ActionResult ProfileCheck(ConversionProfile profile, Accounts accounts, CheckLevel checkLevel)
        {
            var actionResult = new ActionResult();

            actionResult.AddRange(CheckTargetDirectory(profile, checkLevel));
            actionResult.AddRange(CheckFileNameTemplate(profile, checkLevel));
            actionResult.AddRange(CheckCoverPageSettings(profile, checkLevel));
            actionResult.AddRange(CheckAttachmentPageSettings(profile, checkLevel));
            actionResult.AddRange(CheckBackgroundPageSettings(profile, checkLevel));
            actionResult.AddRange(CheckStampingSettings(profile));
            actionResult.AddRange(CheckEncryptionSettings(profile));
            actionResult.AddRange(CheckSignatureSettings(profile, accounts, checkLevel));

            foreach (var actionCheck in _actionChecks)
            {
                var result = actionCheck.Check(profile, accounts, checkLevel);
                actionResult.AddRange(result);
            }

            return(actionResult);
        }
        public SettingsCheckResult CheckSettings()
        {
            var result = new ActionResult();

            foreach (var defaultViewer in _defaultViewerSettings.Settings)
            {
                result.AddRange(_defaultViewerCheck.Check(defaultViewer));
            }

            var resultDict = new ActionResultDict
            {
                { _translation.DefaultViewer, result }
            };

            return(new SettingsCheckResult(resultDict, false));
        }
Beispiel #8
0
        public static ActionResult ProfileCheck(ConversionProfile profile)
        {
            var actionResult = new ActionResult();

            actionResult.AddRange(CheckAutosaveSettings(profile));
            actionResult.AddRange(CheckSaveSettings(profile));
            actionResult.AddRange(CheckCoverPageSettings(profile));
            actionResult.AddRange(CheckAttachmentPageSettings(profile));
            actionResult.AddRange(CheckStampingSettings(profile));
            actionResult.AddRange(CheckEncryptionSettings(profile));
            actionResult.AddRange(CheckBackgroundpageSettings(profile));
            actionResult.AddRange(CheckSignatureSettings(profile));

            var ftpAction = new FtpAction();

            actionResult.AddRange(ftpAction.Check(profile));
            var scriptAction = new ScriptAction();

            actionResult.AddRange(scriptAction.Check(profile));
            var smtpMailAction = new SmtpMailAction("");

            actionResult.AddRange(smtpMailAction.Check(profile));

            return(actionResult);
        }