Пример #1
0
        public void LicenseStatus_ReturnsStatusFromEdition()
        {
            _editionFactory = BuildValidEditionHelper();

            var viewModel = BuildViewModel(_editionFactory);

            viewModel.Edition.LicenseStatus = LicenseStatus.Blocked;

            Assert.AreEqual(LicenseStatus.Blocked, viewModel.LicenseStatus);
            Assert.AreEqual(EnumToStringValueHelper.GetStringValue(LicenseStatus.Blocked), viewModel.LicenseStatusText);
        }
Пример #2
0
        private void ViewModelOnActivationResponse(object sender, ActivationResponseEventArgs e)
        {
            if (!Dispatcher.CheckAccess())
            {
                Dispatcher.Invoke((Action)(() => ViewModelOnActivationResponse(sender, e)));
                return;
            }

            if (e.Edition.IsLicenseValid)
            {
                string title   = _translator.GetTranslation("LicenseTab", "ActivationSuccessful", "Activation successful");
                string message = _translator.GetTranslation("LicenseTab", "ActivationSuccessfulMessage", "The license has been activated successfully");

                MessageWindow.ShowTopMost(message, title, MessageWindowButtons.OK, MessageWindowIcon.PDFCreator);
            }
            else
            {
                string title   = _translator.GetTranslation("LicenseTab", "ActivationFailed", "Activation failed");
                string message = _translator.GetTranslation("LicenseTab", "ActivationFailedMessage", "The activation was not successful:");
                message += "\r\n"
                           + _translator?.GetTranslation("LicenseTab", "LicenseStatus." + e.Edition.LicenseStatus, EnumToStringValueHelper.GetStringValue(e.Edition.LicenseStatus));

                MessageWindow.ShowTopMost(message, title, MessageWindowButtons.OK, MessageWindowIcon.Error);
            }
        }