private void SetLicenseCapibilites() { LicenseCapability capibilities = null; if (cboLicenseKeyType.SelectedValue != null) { switch ((KeyGeneratorTypes)cboLicenseKeyType.SelectedValue) { case KeyGeneratorTypes.StaticSmall: IKeyGenerator keygen = ObjectLocator.GetInstance <IKeyGenerator>(InstanceNames.SmallKeyGenerator); capibilities = keygen.GetLicenseCapability(); chkIsLicenseSetUpgradeOnly.IsChecked = false; chkIsLicenseSetUpgradeOnly.IsEnabled = false; break; case KeyGeneratorTypes.StaticLarge: IKeyGenerator keygenLarge = ObjectLocator.GetInstance <IKeyGenerator>(InstanceNames.LargeKeyGenerator); capibilities = keygenLarge.GetLicenseCapability(); chkIsLicenseSetUpgradeOnly.IsChecked = false; chkIsLicenseSetUpgradeOnly.IsEnabled = true; break; break; case KeyGeneratorTypes.None: capibilities = null; break; default: break; } } if (capibilities != null) { if (capibilities.SupportedLicenseKeyTypes.IsSet(LicenseKeyTypeFlag.SingleUser)) { chkSingleUser.IsEnabled = true; } else { chkSingleUser.IsChecked = false; chkSingleUser.IsEnabled = false; } if (capibilities.SupportedLicenseKeyTypes.IsSet(LicenseKeyTypeFlag.MultiUser)) { chkMultiUser.IsEnabled = true; } else { chkMultiUser.IsChecked = false; chkMultiUser.IsEnabled = false; } if (capibilities.SupportedLicenseKeyTypes.IsSet(LicenseKeyTypeFlag.HardwareLock)) { chkHardwareLock.IsEnabled = true; } else { chkHardwareLock.IsChecked = false; chkHardwareLock.IsEnabled = false; } if (capibilities.SupportedLicenseKeyTypes.IsSet(LicenseKeyTypeFlag.Unlimited)) { chkUnlimited.IsEnabled = true; } else { chkUnlimited.IsChecked = false; chkUnlimited.IsEnabled = false; } if (capibilities.SupportedLicenseKeyTypes.IsSet(LicenseKeyTypeFlag.Enterprise)) { chkEnterprise.IsEnabled = true; } else { chkEnterprise.IsChecked = false; chkEnterprise.IsEnabled = false; } } else { chkSingleUser.IsChecked = false; chkSingleUser.IsEnabled = false; chkMultiUser.IsChecked = false; chkMultiUser.IsEnabled = false; chkHardwareLock.IsChecked = false; chkHardwareLock.IsEnabled = false; chkUnlimited.IsChecked = false; chkUnlimited.IsEnabled = false; chkEnterprise.IsChecked = false; chkEnterprise.IsEnabled = false; } }
private void SetLicenseCapibilites() { LicenseCapability capibilities = null; if (UIContext.License != null) { switch (UIContext.License.KeyGeneratorType) { case KeyGeneratorTypes.StaticSmall: IKeyGenerator keygen = ObjectLocator.GetInstance <IKeyGenerator>(InstanceNames.SmallKeyGenerator); capibilities = keygen.GetLicenseCapability(); break; default: break; } } if (capibilities != null) { if (capibilities.SupportedLicenseKeyTypes.IsSet(LicenseKeyTypeFlag.SingleUser)) { cboSingleUser.IsEnabled = true; } else { cboSingleUser.IsChecked = false; cboSingleUser.IsEnabled = false; } if (capibilities.SupportedLicenseKeyTypes.IsSet(LicenseKeyTypeFlag.MultiUser)) { cboMultiUser.IsEnabled = true; } else { cboMultiUser.IsChecked = false; cboMultiUser.IsEnabled = false; } if (capibilities.SupportedLicenseKeyTypes.IsSet(LicenseKeyTypeFlag.HardwareLock)) { cboHardwareLock.IsEnabled = true; cboHardwareLockLocal.IsEnabled = true; } else { cboHardwareLock.IsChecked = false; cboHardwareLock.IsEnabled = false; cboHardwareLockLocal.IsChecked = false; cboHardwareLockLocal.IsEnabled = false; } if (capibilities.SupportedLicenseKeyTypes.IsSet(LicenseKeyTypeFlag.Unlimited)) { cboUnlimited.IsEnabled = true; } else { cboUnlimited.IsChecked = false; cboUnlimited.IsEnabled = false; } if (capibilities.SupportedLicenseKeyTypes.IsSet(LicenseKeyTypeFlag.Enterprise)) { cboEnterprise.IsEnabled = true; } else { cboEnterprise.IsChecked = false; cboEnterprise.IsEnabled = false; } } }