public static bool EnsureProductIsLicensed(IServices services, int nagAtDays) { services.GetService <ILicenseService>().WaitForValidLicenseInformation(); IMessageDisplayService service = services.GetService <IMessageDisplayService>(); bool flag; switch (LicensingDialogHelper.DialogToDisplay(services, nagAtDays)) { case LicenseDialogPopup.NoDialog: flag = true; break; case LicenseDialogPopup.LicenseDialog: flag = LicensingDialogHelper.ShowLicensingDialog(services, (CommonDialogCreator) new LicensingDialogCreator(services)); break; case LicenseDialogPopup.TrialExpiredDialog: flag = LicensingDialogHelper.ShowTrialExpiredDialog(services, (CommonDialogCreator) new TrialExpiredDialogCreator(services)); break; case LicenseDialogPopup.ActivationGraceExpiredDialog: flag = LicensingDialogHelper.ShowActivationGraceExpiredDialog(services, (CommonDialogCreator) new ActivationGraceExpiredDialogCreator(services)); break; case LicenseDialogPopup.ProductSkuNotInstalled: MessageBoxArgs args1 = new MessageBoxArgs() { Message = StringTable.LicensingProductSkuLicenseNotInstalledMessage, Button = MessageBoxButton.OK, Image = MessageBoxImage.Hand }; if (service != null) { int num1 = (int)service.ShowMessage(args1); } flag = false; break; default: MessageBoxArgs args2 = new MessageBoxArgs() { Message = StringTable.LicensingInitializationFailureMessage, Button = MessageBoxButton.OK, Image = MessageBoxImage.Hand }; if (service != null) { int num2 = (int)service.ShowMessage(args2); } flag = false; break; } return(flag); }
public static LicenseDialogPopup DialogToDisplay(IServices services) { return(LicensingDialogHelper.DialogToDisplay(services, 30)); }