How to check enabled features of ILicenseInfo

The normal procedure to check if a feature is enabled is by calling QlmLicense.IsFeatureEnabledEx. In some cases, you might have a ILicenseInfo object and would like to check the ennabled features.

The code below shows how to check which features are enabled in an ILicenseInfo object. The ILicenseInfo object can be created by calling GetLicenseInfo.

ILicenseInfo li = lv.QlmLicenseObject.GetLicenseInfo(string.Empty, lv.ActivationKey, false, out string ds, out string response);

int[] enabledFeatures = lv.QlmLicenseObject.ConvertFeaturesToArray(li.Features);

if ((enabledFeatures[0] & 1) != 0)
{
    Console.WriteLine("Feature Set 0, Feature ID 1 is enabled");
}

if ((enabledFeatures[0] & 2)  != 0)
{
    Console.WriteLine("Feature Set 0, Feature ID 2 is enabled");
}

if ((enabledFeatures[0] & 4) != 0)
{
    Console.WriteLine("Feature Set 0, Feature ID 4 is enabled");
}

Last updated