示例#1
0
        public void SaveWebLicense(string productName, WebProductLicense license)
        {
            if (string.IsNullOrEmpty(productName))
            {
                throw new ArgumentNullException("ProductName is null or empty.");
            }

            if (license != null && license.LicenseInfo == null)
            {
                throw new InvalidOperationException("ProductLicense is not valid and can't be saved.");
            }

            if (license == null)
            {
                _licenseStore.SaveUserPoolLicense(ActivationConstants.WebUsersPoolName, null);
            }
            else if (license.UsersPool != null)
            {
                _licenseStore.SaveUserPoolLicense(ActivationConstants.WebUsersPoolName, license.UsersPool);
            }
            _licenseStore.SaveLicense(productName, license?.LicenseInfo);
        }