Ejemplo n.º 1
0
        public void DisplayHint_IfCounterAndDateDifferencesAreNotEnough_ReturnsFalse(int currentCounter, int lastCounter, int days)
        {
            _portReader.ReadPrinterPort("pdfcmon").Returns(new PrinterPort {
                JobCounter = lastCounter
            });

            _registry.GetValue(RegistryKeyForHintSettings, RegistryKeyForCounter, 0).Returns(lastCounter);
            _registry.GetValue(RegistryKeyForHintSettings, RegistryKeyForDate, "").Returns(DateTime.Now.AddDays(days));

            Assert.IsFalse(_plusHintHelper.DisplayHint());
        }
Ejemplo n.º 2
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);
                }
            }
        }
Ejemplo n.º 3
0
        private void OnJobFinished(object sender, EventArgs eventArgs)
        {
            var plushelper = new PlusHintHelper();

            if (plushelper.DisplayHint())
            {
                PlusHintWindow.ShowTopMost(plushelper.CurrentJobCounter);
            }
        }
Ejemplo n.º 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);
        }