Release notes for v4013
Extended information about a floating license
The activation method from the floating license tutorial can be changed slightly to allow more details about the license to be retrieved.
You only need add Metadata = true
, which will allow you to call Helpers.GetFloatingLicenseInformation
. This method has multiple overloads, we show the one that requires the
activation model and the activation result. If you don't have these objects, you can specify MaxOverdraft
, MaxNoOfMachines
and UsedFloatingMachines
yourself.
Below is an example that show this method in action.
var activateModel = new ActivateModel()
{
Key = "GEBNC-WZZJD-VJIHG-GCMVD",
ProductId = 3349,
Sign = true,
MachineCode = Helpers.GetMachineCode(),
Metadata = true, // <- add this
FloatingTimeInterval = 100,
MaxOverdraft = 1
};
var activateResult = Key.Activate(token: activateToken, parameters: activateModel);
if (activateResult != null && activateResult.Result == ResultType.Success)
{
var info = Helpers.GetFloatingLicenseInformation(activateModel, activateResult);
System.Diagnostics.Debug.WriteLine(info.AvailableDevices);
System.Diagnostics.Debug.WriteLine(info.UsedDevices);
System.Diagnostics.Debug.WriteLine(info.OverdraftDevices);
}
else
{
Assert.Fail();
}
Release a floating license
Normally, floating licenses will automatically be released in a certain period of time (specified by FloatingTimeInterval
). However, you can manually release a floating license by
using Key.Deactivate
with Floating=True
, as shown below:
Key.Deactivate(activateToken, new DeactivateModel {
Key = "GEBNC-WZZJD-VJIHG-GCMVD",
ProductId = 3349,
MachineCode = "test",
Floating = true // <- add this
});