Пример #1
0
        private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            TranslationHelper.Instance.TranslatorInstance.Translate(this);

            ApplicationNameText.Text = "PDFCreator " + VersionHelper.Instance.FormatWithTwoDigits();

            // Apply company name for customized setups
            ApplyCustomization();

            if (!EditionFactory.Instance.Edition.ShowWelcomeWindow)
            {
                return;
            }

            var welcomeSettingsHelper = new WelcomeSettingsHelper();

            if (welcomeSettingsHelper.IsFirstRun())
            {
                welcomeSettingsHelper.SetCurrentApplicationVersionAsWelcomeVersionInRegistry();
                WelcomeWindow.ShowDialogTopMost();
            }
            else
            {
                var plushelper = new PlusHintHelper();
                if (plushelper.DisplayHint())
                {
                    PlusHintWindow.ShowTopMost(plushelper.CurrentJobCounter);
                }
            }
        }
Пример #2
0
        public void Setup()
        {
            _registry   = Substitute.For <IRegistry>();
            _portReader = Substitute.For <IPrinterPortReader>();
            var edition = new Edition();

            edition.ShowPlusHint = true;
            _plusHintHelper      = new PlusHintHelper(_portReader, _registry, edition);
        }
Пример #3
0
        private void OnJobFinished(object sender, EventArgs eventArgs)
        {
            var plushelper = new PlusHintHelper();

            if (plushelper.DisplayHint())
            {
                PlusHintWindow.ShowTopMost(plushelper.CurrentJobCounter);
            }
        }
Пример #4
0
        public void DisplayHint_DisabledShowPlusHintInEdition_ReturnsFalse()
        {
            var edition = new Edition();

            edition.ShowPlusHint = false;
            _plusHintHelper      = new PlusHintHelper(_portReader, _registry, edition);
            var result = _plusHintHelper.DisplayHint();

            Assert.IsFalse(result);
        }
Пример #5
0
        public void Setup()
        {
            _registry = Substitute.For <IRegistry>();
            _registry.GetValue(RegistryKeyForHintSettings, RegistryKeyForCounter, 0).Returns(0);
            _registry.GetValue(RegistryKeyForHintSettings, RegistryKeyForDate, "").Returns("");

            _portReader = Substitute.For <IPrinterPortReader>();

            var installationPathProvider = Substitute.For <IInstallationPathProvider>();

            installationPathProvider.ApplicationRegistryPath.Returns(RegistryKeyForHintSettings.Replace(@"HKEY_CURRENT_USER\", ""));

            _plusHintHelper = new PlusHintHelper(_portReader, _registry, installationPathProvider);
        }