コード例 #1
0
 public NavigateProfileCheck(ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider, ICurrentSettings <Accounts> accountsProvider, IProfileChecker profileChecker, ISettingsChanged settingsChanged)
 {
     _profilesProvider = profilesProvider;
     _accountsProvider = accountsProvider;
     _profileChecker   = profileChecker;
     _settingsChanged  = settingsChanged;
 }
コード例 #2
0
        public PrinterViewModel(
            IPrinterProvider printerProvider,
            ISettingsProvider settingsProvider,
            ICurrentSettings <ObservableCollection <PrinterMapping> > printerMappingProvider,
            ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider,
            IPrinterActionsAssistant printerActionsAssistant,
            IOsHelper osHelper,
            ITranslationUpdater translationUpdater,
            IPrinterHelper printerHelper,
            IGpoSettings gpoSettings)
            : base(translationUpdater)
        {
            _osHelper                = osHelper;
            _printerHelper           = printerHelper;
            _gpoSettings             = gpoSettings;
            _printerActionsAssistant = printerActionsAssistant;
            _printerProvider         = printerProvider;
            _settingsProvider        = settingsProvider;
            _printerMappingProvider  = printerMappingProvider;
            ProfilesProvider         = profilesProvider;

            AddPrinterCommand        = new DelegateCommand(AddPrintercommandExecute);
            RenamePrinterCommand     = new DelegateCommand(RenamePrinterCommandExecute, ModifyPrinterCommandCanExecute);
            DeletePrinterCommand     = new DelegateCommand(DeletePrinterCommandExecute, ModifyPrinterCommandCanExecute);
            SetPrimaryPrinterCommand = new DelegateCommand(SetPrimaryPrinter);
        }
コード例 #3
0
 public SmtpAccountEditCommand(IInteractionRequest interactionRequest,
                               ICurrentSettings <Accounts> accountsProvider,
                               ITranslationUpdater translationUpdater) : base(translationUpdater)
 {
     _interactionRequest = interactionRequest;
     _accountsProvider   = accountsProvider;
 }
コード例 #4
0
 public SaveSettingsToIniCommand(
     IIniSettingsAssistant iniSettingsAssistant,
     ICurrentSettings <ApplicationSettings> appSettings
     )
 {
     _iniSettingsAssistant = iniSettingsAssistant;
     _appSettings          = appSettings;
 }
コード例 #5
0
 public TimeServerAccountAddCommand(IInteractionRequest interactionRequest,
                                    ICurrentSettings <Accounts> accountsProvider,
                                    ITranslationUpdater translationUpdater)
     : base(translationUpdater)
 {
     _interactionRequest = interactionRequest;
     _accountsProvider   = accountsProvider;
 }
コード例 #6
0
        public SignatureUserControlViewModel(
            IOpenFileInteractionHelper openFileInteractionHelper, EditionHelper editionHelper,
            ICurrentSettings <Conversion.Settings.Accounts> accountsProvider, ITranslationUpdater translationUpdater,
            ICurrentSettingsProvider currentSettingsProvider,
            ICommandLocator commandLocator, ISignaturePasswordCheck signaturePasswordCheck,
            IFile file, ITokenViewModelFactory tokenViewModelFactory, IDispatcher dispatcher,
            IGpoSettings gpoSettings, ISigningPositionToUnitConverterFactory signingPositionToUnitConverter,
            ICurrentSettings <ApplicationSettings> applicationSettings)
            : base(translationUpdater, currentSettingsProvider, dispatcher)
        {
            _openFileInteractionHelper = openFileInteractionHelper;
            _commandLocator            = commandLocator;

            _signaturePasswordCheck = signaturePasswordCheck;
            _file        = file;
            _gpoSettings = gpoSettings;

            _signingPositionToUnitConverter = signingPositionToUnitConverter;
            ApplicationSettings             = applicationSettings;
            UnitConverter = _signingPositionToUnitConverter?.CreateSigningPositionToUnitConverter(UnitOfMeasurement.Centimeter);

            translationUpdater.RegisterAndSetTranslation(tf => SetTokenViewModels(tokenViewModelFactory));
            currentSettingsProvider.SelectedProfileChanged += (sender, args) => SetTokenViewModels(tokenViewModelFactory);

            if (editionHelper != null)
            {
                OnlyForPlusAndBusiness = editionHelper.ShowOnlyForPlusAndBusiness;
            }

            _timeServerAccounts = accountsProvider?.Settings.TimeServerAccounts;
            if (_timeServerAccounts != null)
            {
                TimeServerAccountsView = new ListCollectionView(_timeServerAccounts);
                TimeServerAccountsView.SortDescriptions.Add(new SortDescription(nameof(TimeServerAccount.AccountInfo), ListSortDirection.Ascending));
            }

            ChooseCertificateFileCommand = new DelegateCommand(ChooseCertificateFileExecute);

            ChangeUnitConverterCommand = new DelegateCommand(ChangeUnitConverterExecute);

            if (Signature != null)
            {
                AskForPasswordLater = string.IsNullOrEmpty(Password);
            }

            _timeServerAccountEditCommand = _commandLocator.GetCommand <TimeServerAccountEditCommand>();

            AddTimeServerAccountCommand = _commandLocator.CreateMacroCommand()
                                          .AddCommand <TimeServerAccountAddCommand>()
                                          .AddCommand(new DelegateCommand(o => SelectNewAccountInView()))
                                          .Build();

            EditTimeServerAccountCommand = _commandLocator.CreateMacroCommand()
                                           .AddCommand(_timeServerAccountEditCommand)
                                           .AddCommand(new DelegateCommand(o => RefreshAccountsView()))
                                           .Build();
        }
コード例 #7
0
 public SwitchLayoutCommand(IRegionManager regionManager, IInteractionRequest interactionRequest, ICurrentSettings <ObservableCollection <ConversionProfile> > profiles, IActionOrderHelper actionOrderHelper, ITranslationUpdater translationUpdater, ICurrentSettingsProvider currentSettingsProvider, IEventAggregator eventAggregator) : base(translationUpdater)
 {
     _regionManager           = regionManager;
     _interactionRequest      = interactionRequest;
     _profiles                = profiles;
     _actionOrderHelper       = actionOrderHelper;
     _currentSettingsProvider = currentSettingsProvider;
     _eventAggregator         = eventAggregator;
 }
コード例 #8
0
 public SmtpAccountRemoveCommand(IInteractionRequest interactionRequest,
                                 ICurrentSettings <Accounts> accountsProvider,
                                 ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider,
                                 ITranslationUpdater translationUpdater) : base(translationUpdater)
 {
     _interactionRequest = interactionRequest;
     _accountsProvider   = accountsProvider;
     _profilesProvider   = profilesProvider;
 }
コード例 #9
0
        public PrintJobViewModel(
            ISettingsProvider settingsProvider,
            ITranslationUpdater translationUpdater,
            IJobInfoQueue jobInfoQueue,
            ICommandLocator commandLocator,
            IEventAggregator eventAggregator,
            ISelectedProfileProvider selectedProfileProvider,
            ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider,
            IGpoSettings gpoSettings,
            ITargetFilePathComposer targetFilePathComposer,
            IJobInfoManager jobInfoManager,
            IChangeJobCheckAndProceedCommandBuilder changeJobCheckAndProceedCommandBuilder,
            IBrowseFileCommandBuilder browseFileCommandBuilder,
            IDispatcher dispatcher,
            IJobDataUpdater jobDataUpdater)
            : base(translationUpdater)
        {
            GpoSettings              = gpoSettings;
            _settingsProvider        = settingsProvider;
            _commandLocator          = commandLocator;
            _eventAggregator         = eventAggregator;
            _selectedProfileProvider = selectedProfileProvider;
            _profilesProvider        = profilesProvider;
            _targetFilePathComposer  = targetFilePathComposer;
            _jobInfoManager          = jobInfoManager;

            _changeJobCheckAndProceedCommandBuilder = changeJobCheckAndProceedCommandBuilder;
            _dispatcher     = dispatcher;
            _jobDataUpdater = jobDataUpdater;
            _changeJobCheckAndProceedCommandBuilder.Init(() => Job, CallFinishInteraction, () => _lastConfirmedFilePath, s => _lastConfirmedFilePath = s);

            SetOutputFormatCommand = new DelegateCommand <OutputFormat>(SetOutputFormatExecute);

            browseFileCommandBuilder.Init(() => Job, UpdateUiForJobOutputFileTemplate, () => _lastConfirmedFilePath, s => _lastConfirmedFilePath = s);
            BrowseFileCommand = browseFileCommandBuilder.BuildCommand();
            SetupEditProfileCommand(_commandLocator, eventAggregator);

            SetupSaveCommands(translationUpdater);

            EmailCommand = _changeJobCheckAndProceedCommandBuilder.BuildCommand(EnableEmailSettings);
            SetupSendDropDownCommands(translationUpdater);

            MergeCommand = new DelegateCommand(MergeExecute);
            var mergeAllAsyncCommand = new AsyncCommand(MergeAllExecuteAsync, o => jobInfoQueue.Count > 1);

            MergeDropDownCommands = new CommandCollection <PrintJobViewTranslation>(translationUpdater);
            MergeDropDownCommands.AddCommand(mergeAllAsyncCommand, t => t.MergeAll);
            CancelCommand          = new DelegateCommand(CancelExecute);
            CancelDropDownCommands = new CommandCollection <PrintJobViewTranslation>(translationUpdater);
            CancelDropDownCommands.AddCommand(new DelegateCommand(CancelAllExecute, o => jobInfoQueue.Count > 1), t => t.CancelAll);

            DisableSaveTempOnlyCommand = new DelegateCommand(DisableSaveFileTemporary);

            jobInfoQueue.OnNewJobInfo += (sender, args) => UpdateNumberOfPrintJobsHint(jobInfoQueue.Count);
            _jobInfoQueue              = jobInfoQueue;
            UpdateNumberOfPrintJobsHint(jobInfoQueue.Count);
        }
コード例 #10
0
 public BannerViewModel(FrequentTipsControlViewModel frequentTipsControlViewModel, ICurrentSettings <ApplicationSettings> applicationSettings, IGpoSettings gpoSettings)
 {
     FrequentTipsControlViewModel = frequentTipsControlViewModel;
     _applicationSettings         = applicationSettings;
     _gpoSettings = gpoSettings;
     applicationSettings.SettingsChanged += (sender, args) =>
     {
         RaisePropertyChanged(nameof(FrequentBannerIsVisible));
     };
 }
コード例 #11
0
 public ForwardToFurtherProfileViewModel(ITranslationUpdater translationUpdater,
                                         ISelectedProfileProvider selectedProfileProvider,
                                         IDispatcher dispatcher,
                                         ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider,
                                         EditionHelper editionHelper)
     : base(translationUpdater, selectedProfileProvider, dispatcher)
 {
     IsBusinessEdition = !editionHelper.IsFreeEdition;
     _profilesProvider = profilesProvider;
 }
コード例 #12
0
 public AddActionCommand(ISelectedProfileProvider selectedProfileProvider, IInteractionRequest interactionRequest, IEventAggregator eventAggregator,
                         ICurrentSettings <ApplicationSettings> settingsProvider, IActionOrderHelper actionOrderHelper, EditionHelper editionHelper)
 {
     _selectedProfileProvider = selectedProfileProvider;
     _interactionRequest      = interactionRequest;
     _eventAggregator         = eventAggregator;
     _settingsProvider        = settingsProvider;
     _actionOrderHelper       = actionOrderHelper;
     _editionHelper           = editionHelper;
 }
コード例 #13
0
 public LanguageSelectionSettingsViewModel(IGpoSettings gpoSettings, ICurrentSettings <ApplicationSettings> appSettingsProvider, ICurrentSettingsProvider currentSettingsProvider, ILanguageProvider languageProvider, ITranslationHelper translationHelper, ITranslationUpdater translationUpdater, ICommandLocator commandLocator) :
     base(translationUpdater, currentSettingsProvider, gpoSettings)
 {
     _appSettingsProvider              = appSettingsProvider;
     _translationHelper                = translationHelper;
     _commandLocator                   = commandLocator;
     Languages                         = languageProvider.GetAvailableLanguages().ToList();
     VisitWebsiteCommand               = _commandLocator.GetInitializedCommand <UrlOpenCommand, string>(Urls.PdfforgeTranslationUrl);
     SettingsProvider.SettingsChanged += (sender, args) => RaisePropertyChanged(nameof(CurrentLanguage));
 }
コード例 #14
0
 public ProfileRenameCommand(
     IInteractionRequest interactionRequest,
     ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider,
     ICurrentSettingsProvider currentSettingsProvider,
     ITranslationUpdater translationUpdater,
     IDispatcher dispatcher)
     : base(interactionRequest, currentSettingsProvider, profilesProvider, translationUpdater)
 {
     _dispatcher = dispatcher;
     CurrentSettingsProvider.SelectedProfileChanged += CurrentSettingsProviderOnSelectedProfileChanged;
 }
コード例 #15
0
ファイル: UpdateHelper.cs プロジェクト: ravisayal/PDFCreator
 public UpdateHelper(ICurrentSettings <ApplicationSettings> applicationSettingsProvider,
                     IVersionHelper versionHelper, IInstallationPathProvider installationPathProvider, IGpoSettings gpoSettings,
                     IEventAggregator eventAggregator, IOnlineVersionHelper onlineVersionHelper)
 {
     _settingsProvider        = applicationSettingsProvider;
     _versionHelper           = versionHelper;
     _gpoSettings             = gpoSettings;
     _eventAggregator         = eventAggregator;
     _onlineVersionHelper     = onlineVersionHelper;
     _skipVersionRegistryPath = installationPathProvider.RegistryHive + "\\" + installationPathProvider.ApplicationRegistryPath;
 }
コード例 #16
0
 public QuickActionViewModel(ITranslationUpdater translationUpdater, ICommandLocator commandLocator, IReadableFileSizeFormatter readableFileSizeHelper,
                             ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider, ICurrentSettingsProvider currentSettingsProvider) : base(translationUpdater)
 {
     _commandLocator          = commandLocator;
     _readableFileSizeHelper  = readableFileSizeHelper;
     _profilesProvider        = profilesProvider;
     _currentSettingsProvider = currentSettingsProvider;
     StartQuickActionCommand  = new DelegateCommand(StartQuickActionCommandExecute);
     FinishCommand            = new DelegateCommand(OnFinish);
     InitList();
 }
コード例 #17
0
 protected ProfileCommandBase(IInteractionRequest interactionRequest,
                              ICurrentSettingsProvider currentSettingsProvider,
                              ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider,
                              ITranslationUpdater translationUpdater)
     : base(translationUpdater)
 {
     InteractionRequest      = interactionRequest;
     CurrentSettingsProvider = currentSettingsProvider;
     _profilesProvider       = profilesProvider;
     translationUpdater.RegisterAndSetTranslation(this);
 }
コード例 #18
0
        public ProfilesViewModel(ISelectedProfileProvider selectedProfileProvider, ITranslationUpdater translationUpdater, ICommandLocator commandLocator, ISettingsProvider settingsProvider, ICurrentSettings <ObservableCollection <ConversionProfile> > profileProvider, IGpoSettings gpoSettings)
            : base(translationUpdater)
        {
            _settingsProvider       = settingsProvider;
            _profileProvider        = profileProvider;
            GpoSettings             = gpoSettings;
            SelectedProfileProvider = selectedProfileProvider;

            ProfileAddCommand    = commandLocator.GetCommand <ProfileAddCommand>();
            ProfileRenameCommand = commandLocator.GetCommand <ProfileRenameCommand>();
            ProfileRemoveCommand = commandLocator.GetCommand <ProfileRemoveCommand>();
        }
コード例 #19
0
        protected UsageStatisticsViewModelBase(IOsHelper osHelper,
                                               ICurrentSettingsProvider currentSettingsProvider, IGpoSettings gpoSettings,
                                               ITranslationUpdater translationUpdater, ICurrentSettings <Conversion.Settings.UsageStatistics> usageStatisticsProvider, ICommandLocator commandLocator, ApplicationNameProvider applicationNameProvider)
            : base(translationUpdater, currentSettingsProvider, gpoSettings)
        {
            OsHelper = osHelper;
            UsageStatisticsProvider  = usageStatisticsProvider;
            _applicationNameProvider = applicationNameProvider;

            ShowUserGuideCommand = commandLocator.GetInitializedCommand <ShowUserGuideCommand, HelpTopic>(HelpTopic);
            VisitWebsiteCommand  = commandLocator.GetInitializedCommand <UrlOpenCommand, string>(Urls.PrivacyPolicyUrl);
        }
コード例 #20
0
        public LoggingSettingViewModel(IInteractionInvoker invoker, IFile fileWrap,
                                       ITranslationUpdater translationUpdater, IGpoSettings gpoSettings, ICommandLocator commandLocator, ICurrentSettings <ApplicationSettings> applicationSettings)
            : base(translationUpdater, gpoSettings)
        {
            _fileWrap           = fileWrap;
            ApplicationSettings = applicationSettings;
            _quickActionOpenExplorerLocationCommand = commandLocator.GetCommand <QuickActionOpenExplorerLocationCommand>();
            _invoker = invoker;

            ShowLogFileCommand  = new DelegateCommand(ShowLogFileExecute);
            ClearLogFileCommand = new DelegateCommand(ClearLogFileExecute);
        }
コード例 #21
0
 public ProfileAddCommand(
     IInteractionRequest interactionRequest,
     ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider,
     ICurrentSettingsProvider currentSettingsProvider,
     ITranslationUpdater translationUpdater)
     : base(
         interactionRequest,
         currentSettingsProvider,
         profilesProvider,
         translationUpdater)
 {
 }
コード例 #22
0
        public DefaultPrinterSettingsViewModel(ITranslationUpdater translationUpdater, ICurrentSettingsProvider settingsProvider, IGpoSettings gpoSettings, ICurrentSettings <CreatorAppSettings> applicationSettingsProvider) : base(translationUpdater, settingsProvider, gpoSettings)
        {
            CreatorSettingsProvider = applicationSettingsProvider;

            _switchPrinterAsk = new AskSwitchPrinter(Translation.Ask, true);
            _switchPrinterYes = new AskSwitchPrinter(Translation.Yes, false);
            translationUpdater.RegisterAndSetTranslation(tf =>
            {
                _switchPrinterAsk.Name = Translation.Ask;
                _switchPrinterYes.Name = Translation.Yes;
            });
        }
コード例 #23
0
 public DropboxAccountRemoveCommand(IInteractionRequest interactionRequest,
                                    ICurrentSettings <Conversion.Settings.Accounts> accountsProvider,
                                    ICurrentSettings <ObservableCollection <ConversionProfile> > profilesProvider,
                                    IDropboxService dropboxService,
                                    ITranslationUpdater translationUpdater)
     : base(translationUpdater)
 {
     _interactionRequest = interactionRequest;
     _accountsProvider   = accountsProvider;
     _profilesProvider   = profilesProvider;
     _dropboxService     = dropboxService;
 }
コード例 #24
0
 public DropboxAccountAddCommand(
     IInteractionRequest interactionRequest,
     ICurrentSettings <Accounts> accountsProvider,
     ITranslationUpdater translationUpdater,
     IDropboxUserInfoManager dropboxUserInfoManager
     )
     : base(translationUpdater)
 {
     _interactionRequest     = interactionRequest;
     _accountsProvider       = accountsProvider;
     _dropboxUserInfoManager = dropboxUserInfoManager;
 }
コード例 #25
0
 public DropboxAccountAddCommand(
     IInteractionInvoker interactionInvoker,
     IInteractionRequest interactionRequest,
     ICurrentSettings <Conversion.Settings.Accounts> accountsProvider,
     ITranslationUpdater translationUpdater
     )
     : base(translationUpdater)
 {
     _interactionInvoker = interactionInvoker;
     _interactionRequest = interactionRequest;
     _accountsProvider   = accountsProvider;
 }
コード例 #26
0
        protected UsageStatisticsViewModelBase(IVersionHelper versionHelper, IOsHelper osHelper,
                                               ICurrentSettingsProvider currentSettingsProvider, IGpoSettings gpoSettings, IProcessStarter processStarter,
                                               ITranslationUpdater translationUpdater, ICurrentSettings <UsageStatistics> usageStatisticsProvider, ApplicationNameProvider applicationNameProvider, ICommandLocator commandLocator)
            : base(translationUpdater, currentSettingsProvider, gpoSettings)
        {
            VersionHelper            = versionHelper;
            OsHelper                 = osHelper;
            _processStarter          = processStarter;
            UsageStatisticsProvider  = usageStatisticsProvider;
            _applicationNameProvider = applicationNameProvider;

            ShowUserGuideCommand = commandLocator.GetInitializedCommand <ShowUserGuideCommand, HelpTopic>(HelpTopic);
        }
コード例 #27
0
        public TitleReplacementsViewModel(ITranslationUpdater translationUpdater, ICurrentSettings <ObservableCollection <TitleReplacement> > titleReplacementProvider, ICurrentSettingsProvider settingsProvider, ICommandLocator commandLocator, IGpoSettings gpoSettings) : base(translationUpdater)
        {
            _titleReplacementProvider = titleReplacementProvider;
            _settingsProvider         = settingsProvider;
            GpoSettings        = gpoSettings;
            TitleAddCommand    = commandLocator.GetCommand <TitleReplacementAddCommand>();
            TitleDeleteCommand = commandLocator.GetCommand <TitleReplacementRemoveCommand>();
            TitleEditCommand   = commandLocator.GetCommand <TitleReplacementEditCommand>();

            if (TitleReplacements != null)
            {
                UpdateTitleReplacements();
            }
        }
コード例 #28
0
        public HomeViewSettingsViewModel(ITranslationUpdater translationUpdater, ICurrentSettingsProvider settingsProvider,
                                         IGpoSettings gpoSettings, ICurrentSettings <RssFeed> rssFeedProvider, ICurrentSettings <ApplicationSettings> applicationsSettingsProvider)
            : base(translationUpdater, settingsProvider, gpoSettings)
        {
            _rssFeedProvider             = rssFeedProvider;
            _applicationSettingsProvider = applicationsSettingsProvider;

            // TODO: Use IMountable in AGeneralSettingsItemControlModel
            _applicationSettingsProvider.SettingsChanged += (sender, args) =>
            {
                RaisePropertyChanged(nameof(RssFeedEnabled));
                RaisePropertyChanged(nameof(TipsEnabled));
            };
        }
コード例 #29
0
        public void Setup()
        {
            _settings                             = new PdfCreatorSettings();
            _applicationSettings                  = new ApplicationSettings();
            _settings.ApplicationSettings         = _applicationSettings;
            _titleReplacements                    = new ObservableCollection <TitleReplacement>();
            _applicationSettings.TitleReplacement = _titleReplacements;
            _settingsProvider                     = Substitute.For <ICurrentSettings <ObservableCollection <TitleReplacement> > >();
            _settingsProvider.Settings.Returns(_titleReplacements);

            _interactionRequest = new UnitTestInteractionRequest();

            _command = new TitleReplacementAddCommand(_interactionRequest, _settingsProvider);
        }
コード例 #30
0
        private void InitViewModel()
        {
            var settingsProvider = Substitute.For <ICurrentSettingsProvider>();
            var settings         = Substitute.For <ICurrentSettings <Accounts> >();

            _accountsProvider = Substitute.For <ICurrentSettings <Accounts> >();
            _accountsProvider.Settings.Returns(_accounts);
            settings.Settings.Returns(_accounts);

            var translationUpdater = new TranslationUpdater(new TranslationFactory(), new ThreadManager());

            _viewModel = new AccountsViewModel(settingsProvider, _accountsProvider, _commandLocator, translationUpdater, new InvokeImmediatelyDispatcher(), null);
            _viewModel.MountView();
        }