Exemple #1
0
        /// <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);
            }
Exemple #2
0
        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--;
            }
        }
Exemple #3
0
        //------------------------------------------------------------------------------
        // 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;
            }
        }
Exemple #4
0
 public bool AskYN(string question)
 {
     return(UserNotificationServices.AskYN(question));
 }
Exemple #5
0
 public void ReportInfo(string title, string msg)
 {
     UserNotificationServices.ReportInfo(title, msg);
 }
Exemple #6
0
 public void ReportFatalError(string title, string msg)
 {
     UserNotificationServices.ReportFatalError(title, msg);
 }
Exemple #7
0
 public void ReportError(string msg)
 {
     UserNotificationServices.ReportError(msg);
 }
Exemple #8
0
 public void ReportError(Exception e)
 {
     UserNotificationServices.ReportError(e);
 }
Exemple #9
0
 public void ShowAboutBox()
 {
     UserNotificationServices.ShowAboutBox();
 }
Exemple #10
0
 public void ShowRequestFeatureDialog()
 {
     UserNotificationServices.ShowRequestFeatureDialog();
 }
Exemple #11
0
 public void ShowSubmitBugReportDialog()
 {
     UserNotificationServices.ShowSubmitBugReportDialog();
 }
Exemple #12
0
 public void ShowSendCommentDialog()
 {
     UserNotificationServices.ShowSendCommentDialog();
 }