/// <summary> /// Validate the name is valid /// </summary> private void OKButton_Click(object sender, RoutedEventArgs e) { string?newName = ProfileName?.Trim(); var notifyService = new UserNotificationServices(_serviceProvider, _threadingService); if (string.IsNullOrEmpty(newName)) { notifyService.ShowError(PropertyPageResources.ProfileNameRequired); } else if (!_validator(newName !)) { notifyService.ShowError(PropertyPageResources.ProfileNameInvalid); }
public void ApplyLicense(bool nagUser = true) { try { SimultaneousLicenseEnforcements++; CountAppliedLicense++; string message; bool systemShouldNagUser; var compliant = DetermineLicenseCompliance(out systemShouldNagUser, out message); bool alreadyNaggedUser = false; if (systemShouldNagUser && nagUser) { UserInterfaceServices.ShowNagScreen(true, message); CountNagged++; alreadyNaggedUser = true; // Determine compliance again (as user may have activated software in the nag screen) compliant = DetermineLicenseCompliance(out systemShouldNagUser, out message); } if (!compliant && SimultaneousLicenseEnforcements == 1) { switch (Rights.FeatureRights) { case ProductFeatureRights.None: UserInterfaceServices.Exit(true); return; case ProductFeatureRights.Partial: if (!alreadyNaggedUser) { // If nagUser param is false, we still want to tell user feature set has been disabled. // We don't tell them if they've already been nagged with the actual nag screen. UserNotificationServices.ReportInfo("Feature set", "Feature set has been disabled"); } break; } } } finally { SimultaneousLicenseEnforcements--; } }
//------------------------------------------------------------------------------ // Validate the name is valid //------------------------------------------------------------------------------ private void OKButton_Click(object sender, RoutedEventArgs e) { string newName = ProfileName; newName = newName?.Trim(); var notifyService = new UserNotificationServices(_serviceProvider, _threadingService); if (string.IsNullOrEmpty(newName)) { notifyService.ShowMessageBox(PropertyPageResources.ProfileNameRequired, null, OLEMSGICON.OLEMSGICON_CRITICAL, OLEMSGBUTTON.OLEMSGBUTTON_OK, OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); } else if (!_validator(newName)) { notifyService.ShowMessageBox(PropertyPageResources.ProfileNameInvalid, null, OLEMSGICON.OLEMSGICON_CRITICAL, OLEMSGBUTTON.OLEMSGBUTTON_OK, OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); } else { ProfileName = newName; DialogResult = true; } }
public bool AskYN(string question) { return(UserNotificationServices.AskYN(question)); }
public void ReportInfo(string title, string msg) { UserNotificationServices.ReportInfo(title, msg); }
public void ReportFatalError(string title, string msg) { UserNotificationServices.ReportFatalError(title, msg); }
public void ReportError(string msg) { UserNotificationServices.ReportError(msg); }
public void ReportError(Exception e) { UserNotificationServices.ReportError(e); }
public void ShowAboutBox() { UserNotificationServices.ShowAboutBox(); }
public void ShowRequestFeatureDialog() { UserNotificationServices.ShowRequestFeatureDialog(); }
public void ShowSubmitBugReportDialog() { UserNotificationServices.ShowSubmitBugReportDialog(); }
public void ShowSendCommentDialog() { UserNotificationServices.ShowSendCommentDialog(); }