public BrowseFileCommandBuilder(IDirectoryHelper directoryHelper, IFileNameQuery fileNameQuery, IInteractionRequest interactionRequest, ITranslationFactory translationFactory)
 {
     _directoryHelper    = directoryHelper;
     _fileNameQuery      = fileNameQuery;
     _interactionRequest = interactionRequest;
     _translationFactory = translationFactory;
 }
Beispiel #2
0
        private void MockSaveFileDialog(bool success)
        {
            _saveFileQuery = Substitute.For <IFileNameQuery>();
            var outputFilenameResult            = new OutputFilenameResult(_filepathFromSaveDialog, OutputFormat.Pdf);
            var queryResultOutputFilenameResult = new QueryResult <OutputFilenameResult>(success, outputFilenameResult);

            _saveFileQuery.GetFileName(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <OutputFormat>())
            .Returns(queryResultOutputFilenameResult);
        }
Beispiel #3
0
        public PrintJobViewModel(
            ISettingsProvider settingsProvider,
            ITranslationUpdater translationUpdater,
            IJobInfoQueue jobInfoQueue,
            IFileNameQuery saveFileQuery,
            IInteractionRequest interactionRequest,
            IProfileChecker profileChecker,
            ErrorCodeInterpreter errorCodeInterpreter,
            ICommandLocator commandsLocator,
            IEventAggregator eventAggregator,
            ISelectedProfileProvider selectedProfileProvider,
            ITempFolderProvider tempFolderProvider,
            IPathUtil pathUtil,
            IFile file,
            IGpoSettings gpoSettings)
            : base(translationUpdater)
        {
            GpoSettings              = gpoSettings;
            _settingsProvider        = settingsProvider;
            _saveFileQuery           = saveFileQuery;
            _profileChecker          = profileChecker;
            _interactionRequest      = interactionRequest;
            _errorCodeInterpreter    = errorCodeInterpreter;
            _selectedProfileProvider = selectedProfileProvider;
            _file = file;
            _tempFolderProvider = tempFolderProvider;
            _pathUtil           = pathUtil;

            SaveCommand            = new DelegateCommand(SaveExecute);
            SendByEmailCommand     = new DelegateCommand(EmailExecute);
            MergeCommand           = new DelegateCommand(MergeExecute);
            CancelCommand          = new DelegateCommand(CancelExecute);
            SetOutputFormatCommand = new DelegateCommand <OutputFormat>(SetOutputFormatExecute);
            BrowseFileCommand      = new DelegateCommand(BrowseFileExecute);

            SetupEditProfileCommand(commandsLocator, eventAggregator);

            var settings = settingsProvider.Settings?.CopyAndPreserveApplicationSettings();

            Profiles = settings?.ConversionProfiles;

            jobInfoQueue.OnNewJobInfo += (sender, args) => UpdateNumberOfPrintJobsHint(jobInfoQueue.Count);
            UpdateNumberOfPrintJobsHint(jobInfoQueue.Count);

            var profileListView = CollectionViewSource.GetDefaultView(Profiles);

            if (profileListView != null)
            {
                profileListView.CurrentChanged += (sender, args) =>
                {
                    if (Job != null)
                    {
                        OutputFormat = ((ConversionProfile)profileListView.CurrentItem).OutputFormat;
                    }
                };
            }
        }
Beispiel #4
0
 public InteractiveTargetFileNameComposer(IFileNameQuery fileNameQuery, IInteractionInvoker interactionInvoker, IPathUtil pathUtil, ITempFolderProvider tempFolderProvider, IJobDataUpdater jobDataUpdater, IOutputFilenameComposer outputFilenameComposer)
 {
     _fileNameQuery          = fileNameQuery;
     _interactionInvoker     = interactionInvoker;
     _pathUtil               = pathUtil;
     _tempFolderProvider     = tempFolderProvider;
     _jobDataUpdater         = jobDataUpdater;
     _outputFilenameComposer = outputFilenameComposer;
 }
Beispiel #5
0
        public InteractiveWorkflow(IShellManager shellManager, ITargetFileNameComposer targetFileNameComposer, IJobDataUpdater jobDataUpdater, IPathSafe pathSafe, IErrorNotifier errorNotifier, ISettingsProvider settingsProvider, IFileNameQuery saveFileQuery, ICommandLocator commandLocator)
        {
            _shellManager           = shellManager;
            _pathSafe               = pathSafe;
            _errorNotifier          = errorNotifier;
            _settingsProvider       = settingsProvider;
            _saveFileQuery          = saveFileQuery;
            _commandLocator         = commandLocator;
            _targetFileNameComposer = targetFileNameComposer;

            JobDataUpdater          = jobDataUpdater;
            _targetFileNameComposer = targetFileNameComposer;
        }
        public void Setup()
        {
            _pdfProfile = new ConversionProfile
            {
                Name             = "PDF Profile",
                OutputFormat     = OutputFormat.Pdf,
                FileNameTemplate = "X:\\test.pdf"
            };

            _saveFileQuery = Substitute.For <IFileNameQuery>();

            var outputFilenameResult            = new OutputFilenameResult(_filepathFromSaveDialog, OutputFormat.Jpeg);
            var queryResultOutputFilenameResult = new QueryResult <OutputFilenameResult>(true, outputFilenameResult);

            _saveFileQuery.GetFileName(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <OutputFormat>())
            .Returns(queryResultOutputFilenameResult);
        }
Beispiel #7
0
 public SkipPrintDialogCommand(IFileNameQuery saveFileQuery)
 {
     _saveFileQuery = saveFileQuery;
 }