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); } } }
public void Setup() { _registry = Substitute.For <IRegistry>(); _portReader = Substitute.For <IPrinterPortReader>(); var edition = new Edition(); edition.ShowPlusHint = true; _plusHintHelper = new PlusHintHelper(_portReader, _registry, edition); }
private void OnJobFinished(object sender, EventArgs eventArgs) { var plushelper = new PlusHintHelper(); if (plushelper.DisplayHint()) { PlusHintWindow.ShowTopMost(plushelper.CurrentJobCounter); } }
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); }
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); }