Example #1
0
        public UpdateViewModel(
            ICompressedFileManager compressedFileManager,
            IDirectoryManager directoryManager,
            IFileManager fileManager,
            IProcessHelper processHelper,
            IVersionHelper versionHelper,
            IMessagePublisher messagePublisher)
        {
            this.compressedFileManager = compressedFileManager;
            this.directoryManager      = directoryManager;
            this.fileManager           = fileManager;
            this.processHelper         = processHelper;
            this.messagePublisher      = messagePublisher;

            // Setup update information
            this.latestVersion = versionHelper.LatestVersion;

            var latestReleaseInfo = versionHelper.GetLatestReleaseInfo();

            if (latestReleaseInfo == null)
            {
                return;
            }

            this.downloadUrl = latestReleaseInfo.DownloadUrl;
            this.Changes     = latestReleaseInfo.Changes;

            this.web.DownloadProgressChanged += WebDownloadProgressChanged;
            this.web.DownloadFileCompleted   += WebDownloadFileCompleted;

            this.ButtonsEnabled = true;
        }
        public void Setup()
        {
            _versionHelper = new VersionHelper(new Version(1, 2, 3, 4));
            _gpoSettings   = Substitute.For <IGpoSettings>();

            _registry = Substitute.For <IRegistry>();
        }
        public UpdateHintViewModel(
            IUpdateHelper updateHelper,
            ITranslationUpdater translationUpdater,
            IEventAggregator eventAggregator,
            IVersionHelper versionHelper,
            IUpdateLauncher updateLauncher,
            IDispatcher dispatcher,
            IOnlineVersionHelper onlineVersionHelper,
            IAssemblyHelper assemblyHelper)
            :
            base(translationUpdater)
        {
            _updateHelper        = updateHelper;
            _eventAggregator     = eventAggregator;
            _updateLauncher      = updateLauncher;
            _dispatcher          = dispatcher;
            _onlineVersionHelper = onlineVersionHelper;
            _assemblyHelper      = assemblyHelper;

            SetCurrentDateFormat();

            AvailableVersionText = Translation.GetNewUpdateMessage(_onlineVersionHelper.GetOnlineVersion().Version.ToString(3),
                                                                   versionHelper.ApplicationVersion.ToString(3),
                                                                   CurrentVersionDate);
        }
Example #4
0
 public void SetUp()
 {
     _versionHelper          = Substitute.For <IVersionHelper>();
     _savedActivation        = new Activation();
     _savedActivation.Exists = true; //must be set for LicenseStillValid/ActivationStillValid
     _licensedProduct        = null;
 }
 public DownloadUpdateStartupAction(IVersionHelper versionHelper, IOnlineVersionHelper onlineVersionHelper, IUpdateHelper updateHelper, IUpdateDownloader updateDownloader)
 {
     _versionHelper       = versionHelper;
     _onlineVersionHelper = onlineVersionHelper;
     _updateHelper        = updateHelper;
     _updateDownloader    = updateDownloader;
 }
Example #6
0
 public SettingsManager(SettingsProvider settingsProvider, ISettingsLoader loader, IInstallationPathProvider installationPathProvider,
                        IVersionHelper versionHelper)
 {
     _settingsProvider         = settingsProvider;
     _loader                   = loader;
     _installationPathProvider = installationPathProvider;
     _versionHelper            = versionHelper;
 }
Example #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;
 }
Example #8
0
 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 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 OnlineBannerManager(BannerOptions options, IDirectory directory, IProcessStarter processStarter, IVersionHelper versionHelper, ILanguageProvider languageProvider, IHashUtil hashUtil, IUsageStatisticsSender usageStatisticsSender, IBannerMetricFactory bannerMetricFactory)
        {
            var cache = new FileCache(options);

            _versionHelper    = versionHelper;
            _languageProvider = languageProvider;
            _bannerLoader     = new BannerLoader(directory, cache, processStarter, usageStatisticsSender, bannerMetricFactory);
            _bannerDownloader = new BannerDownloader(cache, options, hashUtil, new WebClientDownloader());
        }
Example #11
0
 public SettingsManager(SettingsProvider settingsProvider, ISettingsLoader loader, IInstallationPathProvider installationPathProvider,
                        IVersionHelper versionHelper, IEnumerable <IFirstTimeCommand> firstTimeCommands)
 {
     _settingsProvider         = settingsProvider;
     _loader                   = loader;
     _installationPathProvider = installationPathProvider;
     _versionHelper            = versionHelper;
     _firstTimeCommands        = firstTimeCommands;
 }
        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);
        }
Example #13
0
 public SearchModel(IProjectAppService projectAppService,
                    IDocumentAppService documentAppService,
                    HtmlEncoder encoder,
                    IVersionHelper versionHelper)
 {
     _projectAppService  = projectAppService;
     _documentAppService = documentAppService;
     _encoder            = encoder;
     _versionHelper      = versionHelper;
 }
Example #14
0
 public TestPageHelper(IVersionHelper versionHelper, IOsHelper osHelper, ISpoolerProvider spoolerProvider,
                       IJobInfoQueue jobInfoQueue, IJobInfoManager jobInfoManager, ApplicationNameProvider applicationNameProvider)
 {
     _versionHelper           = versionHelper;
     _osHelper                = osHelper;
     _jobInfoQueue            = jobInfoQueue;
     _jobInfoManager          = jobInfoManager;
     _applicationNameProvider = applicationNameProvider;
     _spoolFolder             = spoolerProvider.SpoolFolder;
 }
 public UsageStatisticsManager(IUsageStatisticsSender sender, IOsHelper osHelper, IMachineIdGenerator machineIdGenerator,
                               ApplicationNameProvider applicationNameProvider, IVersionHelper versionHelper)
 {
     _sender                  = sender;
     _osHelper                = osHelper;
     _machineIdGenerator      = machineIdGenerator;
     _applicationNameProvider = applicationNameProvider;
     _versionHelper           = versionHelper;
     _processedJobCounter     = 0;
 }
Example #16
0
        public override void Initialize()
        {
            _warehouseVersion = new VersionHelper.TFSUsersAdapterVersion();

            _tpcDatabase = Infra.TFSUtils.RetrieveTPCConectionString(this.RequestContext);

            _tfsLogUsageConnString = _tpcDatabase.ConnectionString.Replace(_tpcDatabase.DatabaseName, "TFS_CustomDataWarehouse");

            _adapterState = AdapterState.Stopped;
        }
Example #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>();
        }
Example #18
0
        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>();
        }
Example #19
0
        public PrioritySupportUrlOpenCommand(IProcessStarter processStarter, IVersionHelper versionHelper,
                                             ILicenseChecker licenseChecker, LicenseKeySyntaxChecker licenseKeySyntaxChecker, Configuration config)
            : base(processStarter)
        {
            _versionHelper = versionHelper;
            var edition = LicenseValidator.Interface.Tools.StringValueAttribute.GetStringValue(config.Product);
            var key     = licenseChecker.GetSavedLicenseKey().ValueOr("");
            var normKey = licenseKeySyntaxChecker.NormalizeLicenseKey(key);

            Url = BuildUrl(edition, normKey);
        }
Example #20
0
 public UpdateAssistant(ISettingsProvider settingsProvider, IInteractionInvoker interactionInvoker, UpdateManagerTranslation translation, IThreadManager threadManager, IVersionHelper versionHelper, IInstallationPathProvider installationPathProvider, IUpdateLauncher updateLauncher, UpdateInformationProvider updateInformationProvider)
 {
     _settingsProvider          = settingsProvider;
     _interactionInvoker        = interactionInvoker;
     _translation               = translation;
     _threadManager             = threadManager;
     _versionHelper             = versionHelper;
     _updateLauncher            = updateLauncher;
     _updateInformationProvider = updateInformationProvider;
     _skipVersionRegistryPath   = @"HKEY_CURRENT_USER\" + installationPathProvider.ApplicationRegistryPath;
 }
Example #21
0
 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;
 }
Example #22
0
        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);
        }
        public void SetVersionInfo(IVersionHelper versionHelper)
        {
            CopyrightLabel = versionHelper.Copyright;
            VersionLabel   = string.Format("Version {0}", versionHelper.CurrentVersion);

            IsNewVersionAvailable = versionHelper.IsNewVersionAvailable;
            IsLatestVersion       = !IsNewVersionAvailable;

            NewVersionLabel = versionHelper.IsNewVersionAvailable
                ? string.Format(TextResources.Label_NewVersion, versionHelper.LatestVersion.Version)
                : TextResources.Label_IsLatestVersion;
        }
        public void Setup()
        {
            var commandLocator = Substitute.For <ICommandLocator>();

            _whatsNewCommand = Substitute.For <ICommand>();
            commandLocator.GetInitializedCommand <ShowUserGuideCommand, HelpTopic>(HelpTopic.WhatsNew).Returns(_whatsNewCommand);
            _prioritySupportCommand = Substitute.For <ICommand>();
            _versionHelper          = Substitute.For <IVersionHelper>();
            commandLocator.GetCommand <PrioritySupportUrlOpenCommand>().Returns(_prioritySupportCommand);

            _welcomeViewModel = new WelcomeViewModel(commandLocator, new DesignTimeTranslationUpdater(),
                                                     new EditionHelper(false, false), _versionHelper, new DesignTimeApplicationNameProvider());
        }
Example #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;
 }
        public MenuViewModel(IApplication application, IVersionHelper versionHelper)
        {
            HomepageLink    = "http://wun.codeplex.com";
            UpdateStateText = TextResources.ToolTip_NothingFound;
            SetVersionInfo(versionHelper);

            OpenDownloadPageCommand = new SimpleCommand(application.OpenDownloadPage);
            OpenHomepageCommand     = new SimpleCommand(_OpenHomepage);
            OpenSettingsCommand     = new SimpleCommand(application.OpenSettings);
            OpenWindowsUpdateControlPanelCommand = new SimpleCommand(application.OpenWindowsUpdateControlPanel);
            SearchForUpdatesCommand = new SimpleCommand(application.SearchForUpdates);
            ShutdownCommand         = new SimpleCommand(application.Shutdown);
        }
        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);
        }
Example #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>();
        }
Example #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);
        }
Example #30
0
 public UpdateAssistant(ISettingsProvider settingsProvider,
                        ITranslationUpdater translationUpdater, IThreadManager threadManager, IVersionHelper versionHelper,
                        IInstallationPathProvider installationPathProvider, IUpdateLauncher updateLauncher, UpdateInformationProvider updateInformationProvider,
                        IGpoSettings gpoSettings, IEventAggregator eventAggregator)
 {
     _settingsProvider = settingsProvider;
     translationUpdater.RegisterAndSetTranslation(tf => _translation = tf.UpdateOrCreateTranslation(_translation));
     _threadManager             = threadManager;
     _versionHelper             = versionHelper;
     _updateLauncher            = updateLauncher;
     _updateInformationProvider = updateInformationProvider;
     _gpoSettings             = gpoSettings;
     _eventAggregator         = eventAggregator;
     _skipVersionRegistryPath = @"HKEY_CURRENT_USER\" + installationPathProvider.ApplicationRegistryPath;
     OnlineVersion            = new ApplicationVersion(new Version(), "", "");
 }