Beispiel #1
0
        public ManagePrintJobsViewModel(IJobInfoQueue jobInfoQueue, DragAndDropEventHandler dragAndDrop, IJobInfoManager jobInfoManager, IDispatcher dispatcher, ITranslationUpdater translationUpdater, ApplicationNameProvider applicationNameProvider)
            : base(translationUpdater)
        {
            _jobInfoQueue               = jobInfoQueue;
            _dragAndDrop                = dragAndDrop;
            _jobInfoManager             = jobInfoManager;
            _dispatcher                 = dispatcher;
            _applicationNameProvider    = applicationNameProvider;
            _jobInfoQueue.OnNewJobInfo += OnNewJobInfo;

            ListSelectionChangedCommand = new DelegateCommand(ListSelectionChanged);
            DeleteJobCommand            = new DelegateCommand(ExecuteDeleteJob);
            MergeJobsCommand            = new DelegateCommand(ExecuteMergeJobs, CanExecuteMergeJobs);
            MergeAllJobsCommand         = new DelegateCommand(ExecuteMergeAllJobs, CanExecuteMergeAllJobs);
            DoNothingCommand            = new DelegateCommand(o => { }, CanExecuteMergeAllJobs);
            WindowClosedCommand         = new DelegateCommand(OnWindowClosed);
            WindowActivatedCommand      = new DelegateCommand(OnWindowActivated);
            DragEnterCommand            = new DelegateCommand <DragEventArgs>(OnDragEnter);
            DropCommand    = new DelegateCommand <DragEventArgs>(OnDrop);
            KeyDownCommand = new DelegateCommand <KeyEventArgs>(OnKeyDown);
            SortCommand    = new DelegateCommand(o => OnSortCommand(MergeSortingEnum.AlphabeticalDescending));
            SetupSortCommands();

            _synchronizedJobs       = new Helper.SynchronizedCollection <JobInfo>(_jobInfoQueue.JobInfos);
            _jobInfos               = _synchronizedJobs.ObservableCollection;
            JobInfos                = new CollectionView(_jobInfos);
            JobListSelectionChanged = new DelegateCommand(ListItemChange);
        }
Beispiel #2
0
        public ForgotPasswordResponse ForgotPassword(string emailAddress)
        {
            try
            {
                User          user  = User.GetByEmail(emailAddress, Database);
                PasswordReset reset = user.PasswordResetsByUserId.AddNew();
                reset.Token            = Guid.NewGuid().ToString();
                reset.DateTime         = new Instant();
                reset.ExpiresInMinutes = PasswordResetTokensExpireInThisManyMinutes;
                reset.WasReset         = false;

                user.Save(Database);

                PasswordResetEmailData data = new PasswordResetEmailData
                {
                    Title            = "Password Reset",
                    UserName         = user.UserName,
                    ApplicationName  = ApplicationNameProvider.GetApplicationName(),
                    PasswordResetUrl = GetPasswordResetUrl(reset.Token)
                };
                string subject = "Password Reset for {0}"._Format(data.ApplicationName);
                string email   = user.Email;
                ComposePasswordResetEmail(subject, data).To(email).Send();
                FireEvent(ForgotPasswordSucceeded);
                return(GetSuccess <ForgotPasswordResponse>(reset.Token, "Password email was sent to {0}"._Format(email)));
            }
            catch (Exception ex)
            {
                LastException = ex;
                FireEvent(ForgotPasswordFailed);
                return(GetFailure <ForgotPasswordResponse>(ex));
            }
        }
Beispiel #3
0
 public ProcessRuntimeDescriptor LoadRuntimeDescriptor(ProcessRuntimeDescriptor likeThis)
 {
     return(LoadRuntimeDescriptor(
                likeThis.FilePath,
                likeThis.CommandLine,
                likeThis.MachineName,
                string.IsNullOrEmpty(likeThis.ApplicationName) ? ApplicationNameProvider.GetApplicationName(): likeThis.ApplicationName));
 }
Beispiel #4
0
        private LicenseCondition BuildCheckLicenseConditions()
        {
            var versionHelper = Substitute.For <IVersionHelper>();

            versionHelper.FormatWithThreeDigits().Returns(_versionWithTreeDigits);
            var applicationNameProvider = new ApplicationNameProvider("Free");

            return(new LicenseCondition(new TranslationFactory(), _licenseChecker, _interactionInvoker, versionHelper, applicationNameProvider, _gpoSettings));
        }
 public LicenseCondition(ISettingsManager settingsManager, ITranslator translator, IActivationHelper activationHelper, IInteractionInvoker interactionInvoker, IVersionHelper versionHelper, ApplicationNameProvider applicationNameProvider)
 {
     _settingsManager         = settingsManager;
     _translator              = translator;
     _activationHelper        = activationHelper;
     _interactionInvoker      = interactionInvoker;
     _versionHelper           = versionHelper;
     _applicationNameProvider = applicationNameProvider;
 }
 public TerminalServerNotAllowedCondition(ITerminalServerDetection terminalServerDetection, ITranslationFactory translationFactory,
                                          IInteractionInvoker interactionInvoker, IWebLinkLauncher webLinkLauncher, ApplicationNameProvider applicationNameProvider)
 {
     _terminalServerDetection = terminalServerDetection;
     _translation             = translationFactory.CreateTranslation <ProgramTranslation>();
     _interactionInvoker      = interactionInvoker;
     _webLinkLauncher         = webLinkLauncher;
     _applicationNameProvider = applicationNameProvider;
 }
Beispiel #7
0
 public LicenseCondition(ISettingsManager settingsManager, ProgramTranslation translation, ILicenseChecker licenseChecker, IInteractionInvoker interactionInvoker, IVersionHelper versionHelper, ApplicationNameProvider applicationNameProvider)
 {
     _settingsManager         = settingsManager;
     _translation             = translation;
     _licenseChecker          = licenseChecker;
     _interactionInvoker      = interactionInvoker;
     _versionHelper           = versionHelper;
     _applicationNameProvider = applicationNameProvider;
 }
 public AutoUpdateLauncher(ITranslationFactory translationFactory, IInteractionInvoker interactionInvoker, IHashUtil hashUtil, IThreadManager threadManager, ApplicationNameProvider applicationNameProvider)
 {
     UpdateTranslation(translationFactory);
     translationFactory.TranslationChanged += (sender, args) => UpdateTranslation(translationFactory);
     _interactionInvoker      = interactionInvoker;
     _hashUtil                = hashUtil;
     _threadManager           = threadManager;
     _applicationNameProvider = applicationNameProvider;
 }
 public LicenseCondition(ITranslationFactory translationFactory, ILicenseChecker licenseChecker, IInteractionInvoker interactionInvoker, IVersionHelper versionHelper, ApplicationNameProvider applicationNameProvider, IGpoSettings gpoSettings)
 {
     _translation             = translationFactory.CreateTranslation <ProgramTranslation>();
     _licenseChecker          = licenseChecker;
     _interactionInvoker      = interactionInvoker;
     _versionHelper           = versionHelper;
     _applicationNameProvider = applicationNameProvider;
     _gpoSettings             = gpoSettings;
 }
 public TerminalServerNotAllowedCondition(ITerminalServerDetection terminalServerDetection, ProgramTranslation translation,
                                          IInteractionInvoker interactionInvoker, IProcessStarter processStarter, ApplicationNameProvider applicationNameProvider)
 {
     _terminalServerDetection = terminalServerDetection;
     _translation             = translation;
     _interactionInvoker      = interactionInvoker;
     _processStarter          = processStarter;
     _applicationNameProvider = applicationNameProvider;
 }
 public UsageStatisticsManager(IUsageStatisticsSender sender, IOsHelper osHelper, IMachineIdGenerator machineIdGenerator,
                               ApplicationNameProvider applicationNameProvider, IVersionHelper versionHelper)
 {
     _sender                  = sender;
     _osHelper                = osHelper;
     _machineIdGenerator      = machineIdGenerator;
     _applicationNameProvider = applicationNameProvider;
     _versionHelper           = versionHelper;
     _processedJobCounter     = 0;
 }
        public StoreLicenseForAllUsersWindowViewModel(ApplicationNameProvider applicationNameProvider, IOsHelper osHelper, IUacAssistant uacAssistant, IInteractionInvoker interactionInvoker, ITranslator translator)
        {
            _osHelper           = osHelper;
            _uacAssistant       = uacAssistant;
            _interactionInvoker = interactionInvoker;
            _translator         = translator;
            ProductName         = applicationNameProvider.ApplicationName;

            StoreLicenseInLmCommand = new DelegateCommand(StoreLicenseInLmCommandExecute);
        }
Beispiel #13
0
 public UpdateDownloadWindowViewModel(
     ITranslationUpdater translationUpdater, IReadableFileSizeFormatter readableFileSizeFormatter, ApplicationNameProvider applicationNameProvider, IUpdateDownloader updateDownloader, IDispatcher dispatcher)
     : base(translationUpdater)
 {
     _readableFileSizeFormatter = readableFileSizeFormatter;
     _applicationNameProvider   = applicationNameProvider;
     _updateDownloader          = updateDownloader;
     Dispatcher    = dispatcher;
     CancelCommand = new DelegateCommand(ExecuteCancel);
 }
Beispiel #14
0
        public LicenseWindowViewModel(LicenseTabViewModel licenseTabViewModel, ApplicationNameProvider applicationNameProvider, IVersionHelper versionHelper, IUserGuideHelper userGuideHelper)
        {
            LicenseTabViewModel = licenseTabViewModel;
            _userGuideHelper    = userGuideHelper;
            Title = applicationNameProvider.ApplicationName + " " + versionHelper.FormatWithThreeDigits();

            ShowHelpCommand = new DelegateCommand <KeyEventArgs>(ShowHelpCommandExecute);

            licenseTabViewModel.CloseLicenseWindowEvent += CloseWhenLicenseValid;
        }
        public void SetUp()
        {
            _osHelper                = Substitute.For <IOsHelper>();
            _versionHelper           = Substitute.For <IVersionHelper>();
            _usageStatisticsSender   = Substitute.For <IUsageStatisticsSender>();
            _machineIdGenerator      = Substitute.For <IMachineIdGenerator>();
            _applicationNameProvider = new ApplicationNameProvider("testedition");

            _usageStatisticsManager = new UsageStatisticsManager(_usageStatisticsSender, _osHelper, _machineIdGenerator, _applicationNameProvider, _versionHelper);
        }
        public WelcomeViewModel(ICommandLocator commandLocator, ITranslationUpdater translationUpdater,
                                EditionHelper editionHelper, IVersionHelper versionHelper, ApplicationNameProvider applicationNameProvider)
            : base(translationUpdater)
        {
            _editionHelper           = editionHelper;
            _versionHelper           = versionHelper;
            _applicationNameProvider = applicationNameProvider;

            WhatsNewCommand        = commandLocator.GetInitializedCommand <ShowUserGuideCommand, HelpTopic>(HelpTopic.WhatsNew);
            PrioritySupportCommand = commandLocator.GetCommand <IPrioritySupportUrlOpenCommand>();
        }
Beispiel #17
0
        public WelcomeViewModel(ICommandLocator commandLocator, ITranslationUpdater translationUpdater,
                                EditionHelper editionHelper, IVersionHelper versionHelper, ApplicationNameProvider applicationNameProvider)
            : base(translationUpdater)
        {
            _versionHelper           = versionHelper;
            _applicationNameProvider = applicationNameProvider;
            AllowPrioritySupport     = !editionHelper?.ShowOnlyForPlusAndBusiness ?? true;

            WhatsNewCommand        = commandLocator.GetInitializedCommand <ShowUserGuideCommand, HelpTopic>(HelpTopic.WhatsNew);
            PrioritySupportCommand = commandLocator.GetCommand <PrioritySupportUrlOpenCommand>();
        }
        public void Setup()
        {
            _osHelper     = Substitute.For <IOsHelper>();
            _uacAssistant = Substitute.For <IUacAssistant>();
            var applicationNameProvider = new ApplicationNameProvider(ProductName);

            _interactionInvoker = Substitute.For <IInteractionInvoker>();
            _storeLicenseForAllUsersWindowViewModel = new StoreLicenseForAllUsersWindowViewModel(applicationNameProvider, _osHelper, _uacAssistant, _interactionInvoker, new StoreLicenseForAllUsersWindowTranslation());
            var interaction = new StoreLicenseForAllUsersInteraction("", "");

            _interactionHelper = new InteractionHelper <StoreLicenseForAllUsersInteraction>(_storeLicenseForAllUsersWindowViewModel, interaction);
        }
Beispiel #19
0
        public StoreLicenseForAllUsersWindowViewModel(ApplicationNameProvider applicationNameProvider, IOsHelper osHelper, IUacAssistant uacAssistant, IInteractionRequest interactionRequest, ITranslationUpdater translationUpdater)
        {
            _osHelper           = osHelper;
            _uacAssistant       = uacAssistant;
            _interactionRequest = interactionRequest;
            ProductName         = applicationNameProvider.ApplicationNameWithEdition;

            StoreLicenseInLmCommand = new DelegateCommand(StoreLicenseInLmCommandExecute);
            CloseCommand            = new DelegateCommand(o => FinishInteraction());

            translationUpdater.RegisterAndSetTranslation(tf => Translation = tf.UpdateOrCreateTranslation(Translation));
        }
Beispiel #20
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);
        }
Beispiel #21
0
 public AutoUpdateLauncher(ITranslationFactory translationFactory, IInteractionInvoker interactionInvoker, IInteractionRequest interactionRequest, IHashUtil hashUtil, IThreadManager threadManager, ApplicationNameProvider applicationNameProvider, IUpdateDownloader updateDownloader, IEventAggregator EventAggregator)
 {
     UpdateTranslation(translationFactory);
     translationFactory.TranslationChanged += (sender, args) => UpdateTranslation(translationFactory);
     _interactionRequest      = interactionRequest;
     _interactionInvoker      = interactionInvoker;
     _hashUtil                = hashUtil;
     _threadManager           = threadManager;
     _applicationNameProvider = applicationNameProvider;
     _updateDownloader        = updateDownloader;
     _eventAggregator         = EventAggregator;
 }
        public void SetUp()
        {
            _mailSignatureHelper = Substitute.For <IMailSignatureHelper>();
            _jobInfo             = new JobInfo();
            _settings            = new PdfCreatorSettings();
            _conversionProfile   = new ConversionProfile();
            _settings.ConversionProfiles.Add(_conversionProfile);

            _versionHelper = Substitute.For <IVersionHelper>();
            _versionHelper.FormatWithThreeDigits().Returns(Version);
            _applicationNameProvider = new ApplicationNameProvider(EditionName);
        }
Beispiel #23
0
        public void Setup()
        {
            _osHelper     = Substitute.For <IOsHelper>();
            _uacAssistant = Substitute.For <IUacAssistant>();
            var applicationNameProvider = new ApplicationNameProvider(EditionName);

            _interactionRequest = new UnitTestInteractionRequest();
            _storeLicenseForAllUsersWindowViewModel = new StoreLicenseForAllUsersWindowViewModel(applicationNameProvider, _osHelper, _uacAssistant, _interactionRequest, new DesignTimeTranslationUpdater());
            var interaction = new StoreLicenseForAllUsersInteraction("", "");

            _interactionHelper = new InteractionHelper <StoreLicenseForAllUsersInteraction>(_storeLicenseForAllUsersWindowViewModel, interaction);
        }
        public UpdateDownloadWindowViewModel(IDirectory directory, IFile file, ITempFolderProvider tempFolderProvider,
                                             ITranslationUpdater translationUpdater, IReadableFileSizeFormatter readableFileSizeFormatter, ApplicationNameProvider applicationNameProvider)
            : base(translationUpdater)
        {
            _directory                 = directory;
            _file                      = file;
            _tempFolderProvider        = tempFolderProvider;
            _readableFileSizeFormatter = readableFileSizeFormatter;
            _applicationNameProvider   = applicationNameProvider;
            _dispatcher                = Dispatcher.CurrentDispatcher;

            CancelCommand = new DelegateCommand(ExecuteCancel);
        }
Beispiel #25
0
 public PdfCreatorUsageStatisticsManager(IUsageStatisticsSender sender, IOsHelper osHelper, IMachineIdGenerator machineIdGenerator,
                                         ApplicationNameProvider applicationNameProvider, IVersionHelper versionHelper,
                                         ISettingsProvider settingsProvider, IGpoSettings gpoSettings, IThreadManager threadManager)
 {
     _sender                  = sender;
     _osHelper                = osHelper;
     _machineIdGenerator      = machineIdGenerator;
     _applicationNameProvider = applicationNameProvider;
     _versionHelper           = versionHelper;
     _settingsProvider        = settingsProvider;
     _gpoSettings             = gpoSettings;
     _threadManager           = threadManager;
 }
        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);
        }
        public PrintJobShellViewModel(ApplicationNameProvider applicationNameProvider, IInteractionRequest interactionRequest, ITranslationUpdater updater, IEventAggregator eventAggregator, DragAndDropEventHandler dragAndDrop) : base(updater)
        {
            ApplicationName    = applicationNameProvider;
            InteractionRequest = interactionRequest;

            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <ShowLockLayerEvent>().Subscribe(() => ShowLockLayer = true);
                eventAggregator.GetEvent <HideLockLayerEvent>().Subscribe(() => ShowLockLayer = false);
            }

            DragEnterCommand = new DelegateCommand <DragEventArgs>(dragAndDrop.HandleDragEnter);
            DragDropCommand  = new DelegateCommand <DragEventArgs>(dragAndDrop.HandleDropEvent);
        }
Beispiel #28
0
        public AboutViewModel(IVersionHelper versionHelper
                              , ITranslationUpdater translationUpdater
                              , ICommandLocator commandLocator, ApplicationNameProvider applicationNameProvider, EditionHelper editionHelper) : base(translationUpdater)
        {
            ApplicationNameProvider = applicationNameProvider;
            VersionText             = versionHelper.FormatWithBuildNumber();

            ShowManualCommand  = commandLocator.GetInitializedCommand <ShowUserGuideCommand, HelpTopic>(HelpTopic.General);
            ShowLicenseCommand = commandLocator.GetInitializedCommand <ShowUserGuideCommand, HelpTopic>(HelpTopic.License);

            PdfforgeWebsiteCommand = commandLocator.GetInitializedCommand <UrlOpenCommand, string>(Urls.PdfforgeWebsiteUrl);
            IsLicensedVersion      = !editionHelper?.ShowOnlyForPlusAndBusiness ?? true;
            PrioritySupportCommand = commandLocator.GetCommand <PrioritySupportUrlOpenCommand>();
        }
Beispiel #29
0
        public AboutViewModel(IVersionHelper versionHelper
                              , ButtonDisplayOptions buttonDisplayOptions, ITranslationUpdater translationUpdater
                              , ICommandLocator commandLocator, ApplicationNameProvider applicationNameProvider) : base(translationUpdater)
        {
            ApplicationNameProvider = applicationNameProvider;
            HideSocialMediaButtons  = buttonDisplayOptions.HideSocialMediaButtons;
            VersionText             = versionHelper.FormatWithBuildNumber();

            ShowManualCommand  = commandLocator.GetInitializedCommand <ShowUserGuideCommand, HelpTopic>(HelpTopic.General);
            ShowLicenseCommand = commandLocator.GetInitializedCommand <ShowUserGuideCommand, HelpTopic>(HelpTopic.License);

            PdfforgeWebsiteCommand = commandLocator.GetInitializedCommand <UrlOpenCommand, string>(Urls.PdfforgeWebsiteUrl);
            FacebookCommand        = commandLocator.GetInitializedCommand <UrlOpenCommand, string>(Urls.Facebook);
            GooglePlusCommand      = commandLocator.GetInitializedCommand <UrlOpenCommand, string>(Urls.GooglePlus);
        }
        public AboutWindowViewModel(IProcessStarter processStarter, ApplicationNameProvider applicationNameProvider, IVersionHelper versionHelper, IUserGuideHelper userGuideHelper, ButtonDisplayOptions buttonDisplayOptions)
        {
            _processStarter       = processStarter;
            _userGuideHelper      = userGuideHelper;
            _buttonDisplayOptions = buttonDisplayOptions;

            _applicationNameProvider = applicationNameProvider;
            VersionText = versionHelper.FormatWithBuildNumber();

            ShowManualCommand      = new DelegateCommand(ShowManualCommandExecute);
            ShowLicenseCommand     = new DelegateCommand(ShowLicenseCommandExecute);
            DonateCommand          = new DelegateCommand(DonateCommandExecute);
            PdfforgeWebsiteCommand = new DelegateCommand(PdfforgeWebsiteCommandExecute);
            FacebookCommand        = new DelegateCommand(FacebookCommandExecute);
            GooglePlusCommand      = new DelegateCommand(GooglePlusCommandExecute);
        }