![]() |
LicenseSpring .Net SDK 7.32.1
Easily add Software Licensing to your application
|
License interface. More...
Public Member Functions | |
void | AddDeviceVariable (DeviceVariable variable) |
Add new or update existing device variable to license data. | |
void | AddDeviceVariable (string name, string value) |
Add new or update existing device variable to license data. | |
void | AddDeviceVariables (DeviceVariable[] variables) |
Add new or update existing device variables to license data. | |
void | Borrow (DateTime endDateTime) |
Borrow floating license till provided end date time. | |
void | Borrow (string borrowEndDateTime=null) |
Borrow floating license till provided end date time string. | |
void | Borrow (uint hours, uint days) |
Borrow floating license for provided time interval. | |
bool | CanBorrow () |
Is this license can be borrowed or not. | |
bool | ChangePassword (string password, string newPassword) |
Change password for user-based license. | |
InstallationFile | Check (IInstallationFileOptions options=null, bool includeExpiredFeatures=false) |
Check current license for validity on the LicenseSpring platform. | |
ConsumptionPeriod | ConsumptionPeriod () |
Period of time after which consumption is reset. | |
CustomField[] | CustomFields () |
Custom data fields available for the license. | |
int | DaysPassedSinceLastCheck () |
How many days passed since last online check. | |
int | DaysRemaining () |
How many days remaining till license expires in current time zone. | |
int | DaysRemainingUTC () |
How many days remaining till license expires. | |
bool | Deactivate (bool removeLocalData=false) |
Deactivate current license. | |
void | DeactivateAirGap (string confirmationCode) |
Verify Confirmation code and deactivate air gap license. | |
string | DeactivateOffline (string deactivationRequestFile=null) |
Deactivate license locally and create offline deactivation file request. | |
DeviceVariable | DeviceVariable (string name) |
Get device variable by name. | |
string | DeviceVariableValue (string name) |
Get device variable value by name. | |
LicenseFeature | Feature (string featureCode) |
Get product (license) feature by feature code. | |
LicenseFeature[] | Features () |
Product features available for the license. | |
string | FloatingClientId () |
Floating user (client) or instance id. | |
DateTime | FloatingEndDateTime () |
Floating license validity end date time in local time zone. | |
DateTime | FloatingEndDateTimeUtc () |
Floating license validity end date time in UTC. | |
uint | FloatingSlotsCount () |
Overall Floating slots or users count. Amount of simultaneous users (instances) allowed for this license. | |
uint | FloatingSlotsInUse () |
Current floatings slots in use count, including this user (instance). | |
uint | FloatingTimeout () |
Floating timeout in minutes. | |
string | GetAirGapDeactivationCode (string initializationCode) |
Get air gap Deactivation code. | |
DeviceVariable[] | GetDeviceVariables (bool getFromBackend=false) |
Get device variables from the local license or from the backend. | |
ProductDetails | GetProductDetails () |
Get information about a product this license belongs to. | |
DateTime | GracePeriodEndDateTime () |
Getter for grace period end date time in local time. | |
DateTime | GracePeriodEndDateTimeUTC () |
Getter for grace period end date time in UTC. | |
double | GracePeriodHoursRemaining () |
How many hours remaining till grace period ends. | |
LicenseID | Id () |
License ID. | |
bool | IsAirGapped () |
Was this license activated using air-gap activation. | |
bool | IsBorrowed () |
Checker for whether the license is borrowed. | |
bool | IsConsumptionOverageAllowed () |
Is it allowed to exceed consumption for this license. | |
bool | IsConsumptionResetEnabled () |
Indicates whether consumption resets after a certain period of time. | |
bool | IsDeviceTransferAllowed () |
Checks if license can be transfered between devices. | |
bool | IsDeviceTransferLimited () |
Checks if the license allows only limited number of transfers between devices. | |
bool | IsExpired () |
Is license expired. | |
bool | IsFloating () |
Is this license floating. | |
bool | IsGracePeriodStarted () |
Check if grace period started for a license. | |
bool | IsMaintenancePeriodExpired () |
Is maintenance period expired. | |
bool | IsNegativeConsumptionAllowed () |
Is negative consumption allowed for the license. | |
bool | IsOfflineActivated () |
Was this license activated offline. | |
bool | IsSubscriptionGracePeriodStarted () |
Check if grace period started for subscription license. | |
bool | IsTrial () |
Is this license trial. | |
bool | IsUnlimitedConsumptionAllowed () |
Is unlimited consumption allowed for the license. | |
bool | IsValid () |
Fast and simple way to check current local state of the license. | |
string | Key () |
License key. | |
DateTime | LastCheckDate () |
The DateTime of the last sync with the LicenseSpring platform. | |
DateTime | LastCheckDateUTC () |
The DateTime of the last sync with the LicenseSpring platform. | |
LicenseUser | LicenseUser () |
License user. | |
void | LocalCheck () |
Perform check for license validity locally. | |
int | MaintenanceDaysRemaining () |
How many days remaining till maintenance period expires in current time zone. | |
DateTime | MaintenancePeriod () |
Maintenance period for the license. | |
DateTime | MaintenancePeriodUTC () |
Maintenance period for the license. | |
uint | MaxActivations () |
How many times license can be activated. | |
uint | MaxBorrowTime () |
Maximum borrowing period in hours. | |
int | MaxConsumption () |
Maximum consumption of the license. | |
int | MaxConsumptionOverage () |
Extra amount of consumption that allows to go over MaxConsumption . | |
string | Metadata () |
License metadata. | |
string | OrderStoreId () |
Order store id. | |
Customer | Owner () |
Gets the information about license owner, commonly it's a person or organization associated with the license. | |
uint | PolicyId () |
License Policy id. | |
void | Register () |
Register floating license and occupy floating slot. | |
void | RegisterFloatingFeature (ILicenseFeature licenseFeature) |
Register a floating feature and occupy a floating slot. | |
void | Release (bool throwExceptions=false) |
Stop license watchdog thread and revoke floating license so other user can use it. | |
void | ReleaseFloatingFeature (ILicenseFeature licenseFeature) |
Release a floating feature and free a license slot. | |
void | ResumeLicenseWatchdog () |
Restart background thread, you can call this within you callback in order to resume periodic license checks. | |
bool | SendDeviceVariables () |
Send current device variables list to the backend (see device variables on the platform) | |
void | SetupFloatingFeatureWatchdog (LicenseWatchdogCallback callback, bool runCallbackOnEveryCheck=false) |
Initialize and run the floating feature watchdog, a background thread that periodically checks registered floating features and by doing so keeps them alive. | |
void | SetupLicenseWatchdog (LicenseWatchdogCallback callback, uint timeout=0) |
Setup and run license watchdog, a background thread which periodically checks the license, by so keeping it alive. | |
void | SetupLicenseWatchdog (LicenseWatchdogSettings settings) |
Setup and run license watchdog, a background thread which periodically checks the license, by so keeping it alive. | |
void | SetWatchdogTimeout (uint timeout=0) |
Set new timout for license watchdog. | |
DateTime | StartDate () |
License start date. | |
void | StartFloatingFeatureWatchdog () |
Starts the floating feature watchdog by unpausing the background thread. Does nothing if the floating feature watchdog wasn't previously initialized or is already running. | |
LicenseStatus | Status () |
Method for getting local license status, see LicenseStatus documentation. | |
void | StopFloatingFeatureWatchdog () |
Stops the floating feature watchdog by pausing the background thread. Does nothing if the floating feature watchdog wasn't previously initialized or is already stoped. | |
void | StopLicenseWatchdog () |
Stops license watchdog background thread. | |
uint | SubscriptionGracePeriod () |
Grace period in hours. | |
bool | SyncConsumption (OverageRequest overageRequest=null) |
Sync Consumption license with the LicenseSpring platform. | |
bool | SyncFeatureConsumption (string featureCode=null) |
Sync Consumption feature with the LicenseSpring platform. | |
uint | TimesActivated () |
How many times license already been activated. | |
int | TotalConsumption () |
Current total consumption of the license. | |
uint | TransferCount () |
How many times license has been transferred between devices. | |
uint | TransferLimit () |
Maximum number of allowed license transfers between devices. | |
LicenseType | Type () |
Type of license. | |
void | UpdateConsumption (int value=1) |
Increase local consumption counter for consumption license. | |
void | UpdateFeatureConsumption (string featureCode, int value=1) |
Increase local consumption counter for consumption product feature. | |
bool | UpdateOffline (string path) |
Update license data accordingly to provided file. | |
string | User () |
Email of the License user. | |
DateTime | ValidityPeriod () |
The DateTime until the license is valid. | |
DateTime | ValidityPeriodUTC () |
The DateTime until the license is valid. | |
DateTime | ValidityWithGracePeriod () |
The DateTime until the license is valid including grace period. | |
DateTime | ValidityWithGracePeriodUTC () |
The DateTime until the license is valid including grace period. | |
Properties | |
bool | AutoRelease [get, set] |
Meaningful only for floating licenses, if set to true the License object will call Release(bool) in it's destructor, if false user must manually release the license. Will be set to false automatically when borrowing or releasing a license. | |
License interface.
Provides all information on a license and license check methods.
void LicenseSpring.ILicense.AddDeviceVariable | ( | DeviceVariable | variable | ) |
Add new or update existing device variable to license data.
Variable will be stored in local license, in order to send device variables to the backend see License.SendDeviceVariables
variable | Device variable |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.AddDeviceVariable | ( | string | name, |
string | value | ||
) |
Add new or update existing device variable to license data.
Variable will be stored in local license, in order to send device variables to the backend see License.SendDeviceVariables
name | Device variable name |
value | Device variable value |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.AddDeviceVariables | ( | DeviceVariable[] | variables | ) |
Add new or update existing device variables to license data.
Variables will be stored in local license, in order to send device variables to the backend see License.SendDeviceVariables
variables | Device variables |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.Borrow | ( | DateTime | endDateTime | ) |
Borrow floating license till provided end date time.
Meaningful only for floating licenses.
endDateTime | Borrowing end date time in local time. |
System.ArgumentException | In case end date time is invalid or in the past. |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.BorrowLicenseException | If borrowing is not allowed or provided borrowing period is bigger than max. |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid or missing |
LicenseSpring.OAuthException | In case of invalid or expired OAuth credentials. |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.Borrow | ( | string | borrowEndDateTime = null | ) |
Borrow floating license till provided end date time string.
Meaningful only for floating licenses. During borrow period there is no need to register floating license to keep it alive. Sets AutoRelease to false so the license won't automatically Release before the borrow period ends.
Sets AutoRelease to false so the license won't automatically Release before the borrow period ends.
borrowEndDateTime | Borrow end date time in UTC in format "%Y-%m-%dT%H:%M:%SZ". If it's null or empty the license will be borrowed for max possible period. |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.BorrowLicenseException | If borrowing is not allowed or provided borrowing period is bigger than max. |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid or missing |
LicenseSpring.OAuthException | In case of invalid or expired OAuth credentials. |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.Borrow | ( | uint | hours, |
uint | days | ||
) |
Borrow floating license for provided time interval.
Meaningful only for floating licenses. During borrow period there is no need to register floating license to keep it alive. Sets AutoRelease to false so the license won't automatically Release before the borrow period ends.
hours | Count of hours from now you want borrow license for. |
days | Count of days from now you want borrow license for. |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.BorrowLicenseException | If borrowing is not allowed or provided borrowing period is bigger than max. |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid or missing |
LicenseSpring.OAuthException | In case of invalid or expired OAuth credentials. |
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.CanBorrow | ( | ) |
Is this license can be borrowed or not.
Equivalent to check MaxBorrowTime() > 0. Meaningful only for floating licenses.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.ChangePassword | ( | string | password, |
string | newPassword | ||
) |
Change password for user-based license.
Does the same as LicenseManager.ChangePassword
password | User password |
newPassword | New password |
InvalidOperationException | In case method was called for key-based license |
System.Security.Authentication.InvalidCredentialException | In case of wrong password |
LicenseSpring.PasswordChangeNotAllowedException | If changing password is forbidden |
LicenseSpring.MissingParametersException | If password or newPassword is empty |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.License.
InstallationFile LicenseSpring.ILicense.Check | ( | IInstallationFileOptions | options = null , |
bool | includeExpiredFeatures = false |
||
) |
Check current license for validity on the LicenseSpring platform.
options | Optional, using options you can filter install files by channel and environment. |
includeExpiredFeatures | Optional, default false. If set to true updates local license data to include expired license features. |
InstallationFile
available for the license (useful for managing software updates). Returns null in case request failed and grace period started.LicenseSpring.LicenseInactiveException | Thrown when license is inactive |
LicenseSpring.LicenseDisabledException | Thrown when license is disabled |
LicenseSpring.LicenseExpiredException | Thrown when license is expired |
LicenseSpring.MaxFloatingReachedException | In case all floating slots are busy. |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid or missing |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.OAuthException | In case of invalid or expired OAuth credentials. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.License.
ConsumptionPeriod LicenseSpring.ILicense.ConsumptionPeriod | ( | ) |
Period of time after which consumption is reset.
Meaningful only for Consumption license.
Implemented in LicenseSpring.License.
CustomField[] LicenseSpring.ILicense.CustomFields | ( | ) |
Custom data fields available for the license.
Implemented in LicenseSpring.License.
int LicenseSpring.ILicense.DaysPassedSinceLastCheck | ( | ) |
How many days passed since last online check.
Implemented in LicenseSpring.License.
int LicenseSpring.ILicense.DaysRemaining | ( | ) |
How many days remaining till license expires in current time zone.
Days counter will be changed in local midnight.
If you are going to show days remaining dialog to end user you should use this method instead of UTC counterpart. For Subscription license it also counts grace period if set.
Implemented in LicenseSpring.License.
int LicenseSpring.ILicense.DaysRemainingUTC | ( | ) |
How many days remaining till license expires.
Days counter will be changed in midnight by UTC. 0 means license expires today. For Subscription license it also counts grace period if set.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.Deactivate | ( | bool | removeLocalData = false | ) |
Deactivate current license.
removeLocalData | Should local license files and folders created by the SDK be removed after deactivation, default false.Equivalent to call LicenseManager.ClearLocalStorage after deactivation. |
If you are going to uninstall your application you probably should call LicenseManager.ClearLocalStorage afterwards or just set removeLocalData param to true.
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.OAuthException | In case of invalid or expired OAuth credentials. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.DeactivateAirGap | ( | string | confirmationCode | ) |
Verify Confirmation code and deactivate air gap license.
Available only in .NET Framework 4.7 or greater, .NET Standard, .NET 5.0 and later versions.
confirmationCode | Code received from the air gap activation portal |
LicenseSpring.LicenseSpringException | If feature not supported for current target Framework |
LicenseSpring.AirGapActivationException | In case confirmation code from the air gap activation portal is invalid. |
Implemented in LicenseSpring.License.
string LicenseSpring.ILicense.DeactivateOffline | ( | string | deactivationRequestFile = null | ) |
Deactivate license locally and create offline deactivation file request.
If you are going to uninstall your application you probably should call LicenseManager.ClearLocalStorage afterwards.
deactivationRequestFile | Deactivation request file path, null means use default path (Desktop) |
Implemented in LicenseSpring.License.
DeviceVariable LicenseSpring.ILicense.DeviceVariable | ( | string | name | ) |
Get device variable by name.
Returns empty device variable if the variable does not exist
Implemented in LicenseSpring.License.
string LicenseSpring.ILicense.DeviceVariableValue | ( | string | name | ) |
Get device variable value by name.
name | Device variable name |
Implemented in LicenseSpring.License.
LicenseFeature LicenseSpring.ILicense.Feature | ( | string | featureCode | ) |
Get product (license) feature by feature code.
featureCode | Feature identifier (code) |
Implemented in LicenseSpring.License.
LicenseFeature[] LicenseSpring.ILicense.Features | ( | ) |
Product features available for the license.
Implemented in LicenseSpring.License.
string LicenseSpring.ILicense.FloatingClientId | ( | ) |
Floating user (client) or instance id.
Meaningful only for offline floating license.
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.FloatingEndDateTime | ( | ) |
Floating license validity end date time in local time zone.
Meaningful only for floating licenses, if license is borrowed this method returns borrowedUntil date time.
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.FloatingEndDateTimeUtc | ( | ) |
Floating license validity end date time in UTC.
Meaningful only for floating licenses, if license is borrowed this method returns borrowedUntil date time in UTC.
Implemented in LicenseSpring.License.
uint LicenseSpring.ILicense.FloatingSlotsCount | ( | ) |
Overall Floating slots or users count. Amount of simultaneous users (instances) allowed for this license.
Meaningful only for Floating license.
Implemented in LicenseSpring.License.
uint LicenseSpring.ILicense.FloatingSlotsInUse | ( | ) |
Current floatings slots in use count, including this user (instance).
Meaningful only for Floating license, please query this value only after online license check or registration (for Offline floating).
Implemented in LicenseSpring.License.
uint LicenseSpring.ILicense.FloatingTimeout | ( | ) |
Floating timeout in minutes.
Meaningful only for Floating license.
Implemented in LicenseSpring.License.
string LicenseSpring.ILicense.GetAirGapDeactivationCode | ( | string | initializationCode | ) |
Get air gap Deactivation code.
Available only in .NET Framework 4.7 or greater, .NET Standard, .NET 5.0 and later versions.
initializationCode | Code received from the air gap activation portal. |
LicenseSpring.LicenseSpringException | If feature not supported for current target Framework |
Implemented in LicenseSpring.License.
DeviceVariable[] LicenseSpring.ILicense.GetDeviceVariables | ( | bool | getFromBackend = false | ) |
Get device variables from the local license or from the backend.
This method does not throw exceptions if you getting variables list from local license.
getFromBackend | Indicates if you want to request device variables list from local license or backend |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.OAuthException | In case of invalid or expired OAuth credentials. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.License.
ProductDetails LicenseSpring.ILicense.GetProductDetails | ( | ) |
Get information about a product this license belongs to.
ProductDetails is always available for offline activated license.
This method does not perform any network requests and does not throw exceptions.
ProductDetails
or null if ProductDetails
not present in current licenseImplemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.GracePeriodEndDateTime | ( | ) |
Getter for grace period end date time in local time.
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.GracePeriodEndDateTimeUTC | ( | ) |
Getter for grace period end date time in UTC.
Implemented in LicenseSpring.License.
double LicenseSpring.ILicense.GracePeriodHoursRemaining | ( | ) |
How many hours remaining till grace period ends.
Implemented in LicenseSpring.License.
LicenseID LicenseSpring.ILicense.Id | ( | ) |
License ID.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsAirGapped | ( | ) |
Was this license activated using air-gap activation.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsBorrowed | ( | ) |
Checker for whether the license is borrowed.
Meaningful only for Floating license, see License.Borrow
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsConsumptionOverageAllowed | ( | ) |
Is it allowed to exceed consumption for this license.
Meaningful only for Consumption based license.
MaxConsumption
.Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsConsumptionResetEnabled | ( | ) |
Indicates whether consumption resets after a certain period of time.
Meaningful only for Consumption license.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsDeviceTransferAllowed | ( | ) |
Checks if license can be transfered between devices.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsDeviceTransferLimited | ( | ) |
Checks if the license allows only limited number of transfers between devices.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsExpired | ( | ) |
Is license expired.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsFloating | ( | ) |
Is this license floating.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsGracePeriodStarted | ( | ) |
Check if grace period started for a license.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsMaintenancePeriodExpired | ( | ) |
Is maintenance period expired.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsNegativeConsumptionAllowed | ( | ) |
Is negative consumption allowed for the license.
Meaningful only for Consumption based license.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsOfflineActivated | ( | ) |
Was this license activated offline.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsSubscriptionGracePeriodStarted | ( | ) |
Check if grace period started for subscription license.
Meaningful only for Subscription licenses
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsTrial | ( | ) |
Is this license trial.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsUnlimitedConsumptionAllowed | ( | ) |
Is unlimited consumption allowed for the license.
Meaningful only for Consumption based license.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.IsValid | ( | ) |
Fast and simple way to check current local state of the license.
Equivalent to Status().IsOk() and !IsExpired()
It's just basic check, you cannot be 100% sure that license is valid without online license check.
So you still need to perform license check (both local and online) from time to time.
Implemented in LicenseSpring.License.
string LicenseSpring.ILicense.Key | ( | ) |
License key.
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.LastCheckDate | ( | ) |
The DateTime of the last sync with the LicenseSpring platform.
In other words - DateTime of the last online license check.
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.LastCheckDateUTC | ( | ) |
The DateTime of the last sync with the LicenseSpring platform.
In other words - DateTime of the last online license check.
Implemented in LicenseSpring.License.
LicenseUser LicenseSpring.ILicense.LicenseUser | ( | ) |
void LicenseSpring.ILicense.LocalCheck | ( | ) |
Perform check for license validity locally.
Local check do not establish any connections to the LicenseSpring platform, so it can be used in offline mode.
LicenseSpring.LicenseInactiveException | Thrown when license is inactive |
LicenseSpring.LicenseDisabledException | Thrown when license is disabled |
LicenseSpring.LicenseExpiredException | Thrown when license is expired |
LicenseSpring.ProductMismatchException | Thrown when license product code does not correspond to configuration product code |
LicenseSpring.DeviceNotLicensedException | Thrown when computer hardware configuration has been changed or license does not belong to this computer |
LicenseSpring.DateTimeCheatingException | Thrown when detected that system time was set back |
Implemented in LicenseSpring.License.
int LicenseSpring.ILicense.MaintenanceDaysRemaining | ( | ) |
How many days remaining till maintenance period expires in current time zone.
Days counter will be changed in local midnight.
Returns int.MaxValue in case maintenance period unlimited or not specified.
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.MaintenancePeriod | ( | ) |
Maintenance period for the license.
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.MaintenancePeriodUTC | ( | ) |
Maintenance period for the license.
Implemented in LicenseSpring.License.
uint LicenseSpring.ILicense.MaxActivations | ( | ) |
How many times license can be activated.
Implemented in LicenseSpring.License.
uint LicenseSpring.ILicense.MaxBorrowTime | ( | ) |
Maximum borrowing period in hours.
Meaningful only for floating license.
Implemented in LicenseSpring.License.
int LicenseSpring.ILicense.MaxConsumption | ( | ) |
Maximum consumption of the license.
Meaningful only for Consumption based license.
Implemented in LicenseSpring.License.
int LicenseSpring.ILicense.MaxConsumptionOverage | ( | ) |
Extra amount of consumption that allows to go over MaxConsumption
.
Meaningful only for Consumption based license.
Implemented in LicenseSpring.License.
string LicenseSpring.ILicense.Metadata | ( | ) |
string LicenseSpring.ILicense.OrderStoreId | ( | ) |
Order store id.
Implemented in LicenseSpring.License.
Customer LicenseSpring.ILicense.Owner | ( | ) |
Gets the information about license owner, commonly it's a person or organization associated with the license.
Please note some fields of the Customer object can be empty or null(unavailable)
Implemented in LicenseSpring.License.
uint LicenseSpring.ILicense.PolicyId | ( | ) |
License Policy id.
Currently meaningful only for air-gap activated license.
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.Register | ( | ) |
Register floating license and occupy floating slot.
This is equivalent to check license online. See also SetupLicenseWatchdog. In order to keep floating license alive you should check in (register) it periodically.
LicenseSpring.LicenseInactiveException | Thrown when license is inactive |
LicenseSpring.LicenseDisabledException | Thrown when license is disabled |
LicenseSpring.LicenseExpiredException | Thrown when license is expired |
LicenseSpring.MaxFloatingReachedException | In case all floating slots are busy. |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.RegisterFloatingFeature | ( | ILicenseFeature | licenseFeature | ) |
Register a floating feature and occupy a floating slot.
Meaningful only for floating features. In order to keep the floating feature alive, you should register it periodically.
licenseFeature | License feature to register. |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.Release | ( | bool | throwExceptions = false | ) |
Stop license watchdog thread and revoke floating license so other user can use it.
It's important to call this function if you use floating license or watchdog.
Typically should be called at the end of app execution.
throwExceptions | Boolean value indicating whether this method should throw exceptions, by default it's false. |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.ReleaseFloatingFeature | ( | ILicenseFeature | licenseFeature | ) |
Release a floating feature and free a license slot.
Meaningful only for floating features.
licenseFeature | License feature to register. |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.ResumeLicenseWatchdog | ( | ) |
Restart background thread, you can call this within you callback in order to resume periodic license checks.
Using this function is a little faster than running new watchdog. Does nothing if watchdog was not set up.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.SendDeviceVariables | ( | ) |
Send current device variables list to the backend (see device variables on the platform)
Please note this data will be linked to the current running device ID.
This method does nothing if local license does not have any variables.
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.OAuthException | In case of invalid or expired OAuth credentials. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.SetupFloatingFeatureWatchdog | ( | LicenseWatchdogCallback | callback, |
bool | runCallbackOnEveryCheck = false |
||
) |
Initialize and run the floating feature watchdog, a background thread that periodically checks registered floating features and by doing so keeps them alive.
callback | Funcion called when an exception is thrown or after every feature check if runCallbackOnEveryCheck is set to true. |
runCallbackOnEveryCheck | If true callback will be called after every feature check, if false only in case of exceptions. Default value is false. |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.SetupLicenseWatchdog | ( | LicenseWatchdogCallback | callback, |
uint | timeout = 0 |
||
) |
Setup and run license watchdog, a background thread which periodically checks the license, by so keeping it alive.
This is especially useful for floating licenses, but can be used for any.
callback | This function will be called back in case of errors. |
timeout | Timeout in minutes, 0 means use default |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.SetupLicenseWatchdog | ( | LicenseWatchdogSettings | settings | ) |
Setup and run license watchdog, a background thread which periodically checks the license, by so keeping it alive.
This is especially useful for floating licenses, but can be used for any.
settings | Watchdog settings. |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.SetWatchdogTimeout | ( | uint | timeout = 0 | ) |
Set new timout for license watchdog.
This method does not restart the watchdog, it sets a new timeout for the running watchdog or before calling ResumeLicenseWatchdog.
timeout | Timeout in minutes, 0 means use default |
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.StartDate | ( | ) |
License start date.
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.StartFloatingFeatureWatchdog | ( | ) |
Starts the floating feature watchdog by unpausing the background thread. Does nothing if the floating feature watchdog wasn't previously initialized or is already running.
Watchdog will stop automatically in case an exception other than a LicenseServerException or NetworkException is thrown or it can be stoped manually by calling StopFloatingFeatureWatchdog.
Implemented in LicenseSpring.License.
LicenseStatus LicenseSpring.ILicense.Status | ( | ) |
Method for getting local license status, see LicenseStatus documentation.
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.StopFloatingFeatureWatchdog | ( | ) |
Stops the floating feature watchdog by pausing the background thread. Does nothing if the floating feature watchdog wasn't previously initialized or is already stoped.
Watchdog will stop automatically in case an exception other than a LicenseServerException or NetworkException is thrown
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.StopLicenseWatchdog | ( | ) |
Stops license watchdog background thread.
This method does not revoke floating license, just stops the watchdog.
Implemented in LicenseSpring.License.
uint LicenseSpring.ILicense.SubscriptionGracePeriod | ( | ) |
Grace period in hours.
Meaningful only for Subscription license.
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.SyncConsumption | ( | OverageRequest | overageRequest = null | ) |
Sync Consumption license with the LicenseSpring platform.
Meaningful only for Consumption based license.
Also consumption license gets updated within online check, so you can call Check
instead.
overageRequest | Optional parameter to request consumption overage, see OverageRequest |
System.InvalidOperationException | Thrown when called for not Consumption license type |
LicenseSpring.NotEnoughConsumptionException | Thrown when license is out of resources |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid or missing |
LicenseSpring.OAuthException | In case of invalid or expired OAuth credentials. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.SyncFeatureConsumption | ( | string | featureCode = null | ) |
Sync Consumption feature with the LicenseSpring platform.
Meaningful only for Consumption features.
Also consumption features gets updated within online check, so you can call Check
instead.
LicenseSpring.NotEnoughConsumptionException | Thrown when license feature is out of resources |
LicenseSpring.LicenseServerException | In case of internal LicenseSpring backend error |
LicenseSpring.NetworkException | In case of network errors, e.g. no Internet connection or operation timed out. |
LicenseSpring.SignatureMismatchException | In case signature returned by LicenseSpring backend is not valid or missing |
LicenseSpring.OAuthException | In case of invalid or expired OAuth credentials. |
LicenseSpring.UnknownLicenseSpringException | In rare case if something went wrong. |
Implemented in LicenseSpring.License.
uint LicenseSpring.ILicense.TimesActivated | ( | ) |
How many times license already been activated.
Implemented in LicenseSpring.License.
int LicenseSpring.ILicense.TotalConsumption | ( | ) |
Current total consumption of the license.
Meaningful only for Consumption based license.
Implemented in LicenseSpring.License.
uint LicenseSpring.ILicense.TransferCount | ( | ) |
How many times license has been transferred between devices.
Implemented in LicenseSpring.License.
uint LicenseSpring.ILicense.TransferLimit | ( | ) |
Maximum number of allowed license transfers between devices.
Implemented in LicenseSpring.License.
LicenseType LicenseSpring.ILicense.Type | ( | ) |
void LicenseSpring.ILicense.UpdateConsumption | ( | int | value = 1 | ) |
Increase local consumption counter for consumption license.
Meaningful only for Consumption based license.
value | The value by which the counter is being increased, default is 1. |
System.InvalidOperationException | Thrown when called for not Consumption license type |
LicenseSpring.NotEnoughConsumptionException | Thrown when license is out of resources |
Implemented in LicenseSpring.License.
void LicenseSpring.ILicense.UpdateFeatureConsumption | ( | string | featureCode, |
int | value = 1 |
||
) |
Increase local consumption counter for consumption product feature.
Meaningful only for Consumption product features.
featureCode | Feature identifier (code). |
value | The value by which the counter is being increased, default is 1. |
LicenseSpring.InvalidLicenseFeatureException | Thrown when license feature not found or it's not of cosumption type |
LicenseSpring.NotEnoughConsumptionException | Thrown when license feature is out of resources |
Implemented in LicenseSpring.License.
bool LicenseSpring.ILicense.UpdateOffline | ( | string | path | ) |
Update license data accordingly to provided file.
path | Update file path |
System.IO.FileNotFoundException | If file cannot be found |
System.IO.InvalidDataException | If file content is empty or invalid |
LicenseSpring.SignatureMismatchException | In case signature in the file is not valid or missing |
Implemented in LicenseSpring.License.
string LicenseSpring.ILicense.User | ( | ) |
Email of the License user.
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.ValidityPeriod | ( | ) |
The DateTime until the license is valid.
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.ValidityPeriodUTC | ( | ) |
The DateTime until the license is valid.
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.ValidityWithGracePeriod | ( | ) |
The DateTime until the license is valid including grace period.
Currently grace period meaningful only for Subscription licenses
Implemented in LicenseSpring.License.
DateTime LicenseSpring.ILicense.ValidityWithGracePeriodUTC | ( | ) |
The DateTime until the license is valid including grace period.
Currently grace period meaningful only for Subscription licenses
Implemented in LicenseSpring.License.
|
getset |
Meaningful only for floating licenses, if set to true the License object will call Release(bool) in it's destructor, if false user must manually release the license. Will be set to false automatically when borrowing or releasing a license.
Default value is false.
Implemented in LicenseSpring.License.