![]() |
LicenseSpring .Net SDK 7.30.0
Easily add Software Licensing to your application
|
License class, implements ILicense
interface.
More...
Public Member Functions | |||||||||||||||||||||
void | 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 | |||||||||||||||||||||
void | 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 | |||||||||||||||||||||
void | 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 | |||||||||||||||||||||
void | Borrow (DateTime endDateTime) | ||||||||||||||||||||
Borrow floating license till provided end date time.Meaningful only for floating licenses. | |||||||||||||||||||||
void | 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. | |||||||||||||||||||||
void | Borrow (uint hours, uint days=0) | ||||||||||||||||||||
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. | |||||||||||||||||||||
bool | CanBorrow () | ||||||||||||||||||||
Is this license can be borrowed or not.Equivalent to check MaxBorrowTime() > 0. Meaningful only for floating licenses. | |||||||||||||||||||||
bool | ChangePassword (string password, string newPassword) | ||||||||||||||||||||
Change password for user-based license.Does the same as LicenseManager.ChangePassword | |||||||||||||||||||||
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.Meaningful only for Consumption license. | |||||||||||||||||||||
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.Days counter will be changed in local midnight. | |||||||||||||||||||||
int | 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. | |||||||||||||||||||||
bool | Deactivate (bool removeLocalData=false) | ||||||||||||||||||||
Deactivate current license.
| |||||||||||||||||||||
void | DeactivateAirGap (string code) | ||||||||||||||||||||
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. | |||||||||||||||||||||
string | 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. | |||||||||||||||||||||
DeviceVariable | DeviceVariable (string name) | ||||||||||||||||||||
Get device variable by name.Returns empty device variable if the variable does not exist | |||||||||||||||||||||
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.Meaningful only for offline floating license. | |||||||||||||||||||||
DateTime | 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. | |||||||||||||||||||||
DateTime | 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. | |||||||||||||||||||||
uint | FloatingSlotsCount () | ||||||||||||||||||||
Overall Floating slots or users count. Amount of simultaneous users (instances) allowed for this license.Meaningful only for Floating license. | |||||||||||||||||||||
uint | 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). | |||||||||||||||||||||
uint | FloatingTimeout () | ||||||||||||||||||||
Floating timeout in minutes.Meaningful only for Floating license. | |||||||||||||||||||||
string | 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. | |||||||||||||||||||||
DeviceVariable[] | 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. | |||||||||||||||||||||
ProductDetails | 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. | |||||||||||||||||||||
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.Meaningful only for Floating license, see License.Borrow | |||||||||||||||||||||
bool | IsConsumptionOverageAllowed () | ||||||||||||||||||||
Is it allowed to exceed consumption for this license.Meaningful only for Consumption based license. | |||||||||||||||||||||
bool | IsConsumptionResetEnabled () | ||||||||||||||||||||
Indicates whether consumption resets after a certain period of time.Meaningful only for Consumption license. | |||||||||||||||||||||
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.Meaningful only for Consumption based license. | |||||||||||||||||||||
bool | IsOfflineActivated () | ||||||||||||||||||||
Was this license activated offline.
| |||||||||||||||||||||
bool | IsSubscriptionGracePeriodStarted () | ||||||||||||||||||||
Check if grace period started for subscription license.Meaningful only for Subscription licenses | |||||||||||||||||||||
bool | IsTrial () | ||||||||||||||||||||
Is this license trial.
| |||||||||||||||||||||
bool | IsUnlimitedConsumptionAllowed () | ||||||||||||||||||||
Is unlimited consumption allowed for the license.Meaningful only for Consumption based license. | |||||||||||||||||||||
bool | IsValid () | ||||||||||||||||||||
Fast and simple way to check current local state of the license.Equivalent to Status().IsOk() and !IsExpired() | |||||||||||||||||||||
string | Key () | ||||||||||||||||||||
License key.
| |||||||||||||||||||||
DateTime | LastCheckDate () | ||||||||||||||||||||
The DateTime of the last sync with the LicenseSpring platform.In other words - DateTime of the last online license check. | |||||||||||||||||||||
DateTime | LastCheckDateUTC () | ||||||||||||||||||||
The DateTime of the last sync with the LicenseSpring platform.In other words - DateTime of the last online license check. | |||||||||||||||||||||
License () | |||||||||||||||||||||
Default constructor, creates invalid license. | |||||||||||||||||||||
LicenseUser | LicenseUser () | ||||||||||||||||||||
License user.
| |||||||||||||||||||||
void | 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. | |||||||||||||||||||||
int | 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. | |||||||||||||||||||||
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.Meaningful only for floating license. | |||||||||||||||||||||
int | MaxConsumption () | ||||||||||||||||||||
Maximum consumption of the license.Meaningful only for Consumption based license. | |||||||||||||||||||||
int | MaxConsumptionOverage () | ||||||||||||||||||||
Extra amount of consumption that allows to go over MaxConsumption .Meaningful only for Consumption based license. | |||||||||||||||||||||
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.Please note some fields of the Customer object can be empty or null(unavailable) | |||||||||||||||||||||
uint | PolicyId () | ||||||||||||||||||||
License Policy id.Currently meaningful only for air-gap activated license. | |||||||||||||||||||||
void | 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. | |||||||||||||||||||||
void | 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. | |||||||||||||||||||||
void | 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. | |||||||||||||||||||||
void | ReleaseFloatingFeature (ILicenseFeature licenseFeature) | ||||||||||||||||||||
Release a floating feature and free a license slot.Meaningful only for floating features. | |||||||||||||||||||||
void | 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. | |||||||||||||||||||||
bool | 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. | |||||||||||||||||||||
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.This is especially useful for floating licenses, but can be used for any. | |||||||||||||||||||||
void | 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. | |||||||||||||||||||||
void | 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. | |||||||||||||||||||||
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.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. | |||||||||||||||||||||
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.Watchdog will stop automatically in case an exception other than a LicenseServerException or NetworkException is thrown | |||||||||||||||||||||
void | StopLicenseWatchdog () | ||||||||||||||||||||
Stops license watchdog background thread.This method does not revoke floating license, just stops the watchdog. | |||||||||||||||||||||
uint | SubscriptionGracePeriod () | ||||||||||||||||||||
Grace period in hours.Meaningful only for Subscription license. | |||||||||||||||||||||
bool | SyncConsumption (OverageRequest overageRequest=null) | ||||||||||||||||||||
Sync Consumption license with the LicenseSpring platform.Meaningful only for Consumption based license. | |||||||||||||||||||||
bool | SyncFeatureConsumption (string featureCode=null) | ||||||||||||||||||||
Sync Consumption feature with the LicenseSpring platform.Meaningful only for Consumption features. | |||||||||||||||||||||
uint | TimesActivated () | ||||||||||||||||||||
How many times license already been activated.
| |||||||||||||||||||||
int | TotalConsumption () | ||||||||||||||||||||
Current total consumption of the license.Meaningful only for Consumption based 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.Meaningful only for Consumption based license. | |||||||||||||||||||||
void | UpdateFeatureConsumption (string featureCode, int value=1) | ||||||||||||||||||||
Increase local consumption counter for consumption product feature.Meaningful only for Consumption product features. | |||||||||||||||||||||
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.Currently grace period meaningful only for Subscription licenses | |||||||||||||||||||||
DateTime | ValidityWithGracePeriodUTC () | ||||||||||||||||||||
The DateTime until the license is valid including grace period.Currently grace period meaningful only for Subscription licenses | |||||||||||||||||||||
Static Public Attributes | |
const int | MaxDaysRemainingValue = int.MaxValue |
Maximum value that can be returned by DaysRemaining , it equals to int.MaxValue | |
Properties | |
bool | AutoRelease = false [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.Default value is false. | |
![]() |
License class, implements ILicense
interface.
Used for checking, editing, and deleting characteristics of a license.
void LicenseSpring.License.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
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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
Implements LicenseSpring.ILicense.
void LicenseSpring.License.Borrow | ( | DateTime | endDateTime | ) |
Borrow floating license till provided end date time.Meaningful only for floating licenses.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.Borrow | ( | uint | hours, |
uint | days = 0 |
||
) |
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.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.CanBorrow | ( | ) |
Is this license can be borrowed or not.Equivalent to check MaxBorrowTime() > 0. Meaningful only for floating licenses.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.ChangePassword | ( | string | password, |
string | newPassword | ||
) |
Change password for user-based license.Does the same as LicenseManager.ChangePassword
Implements LicenseSpring.ILicense.
InstallationFile LicenseSpring.License.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.UnknownLicenseSpringException | In rare case if something went wrong. |
Implements LicenseSpring.ILicense.
ConsumptionPeriod LicenseSpring.License.ConsumptionPeriod | ( | ) |
Period of time after which consumption is reset.Meaningful only for Consumption license.
Implements LicenseSpring.ILicense.
CustomField[] LicenseSpring.License.CustomFields | ( | ) |
Custom data fields available for the license.
Implements LicenseSpring.ILicense.
int LicenseSpring.License.DaysPassedSinceLastCheck | ( | ) |
How many days passed since last online check.
Implements LicenseSpring.ILicense.
int LicenseSpring.License.DaysRemaining | ( | ) |
How many days remaining till license expires in current time zone.Days counter will be changed in local midnight.
Implements LicenseSpring.ILicense.
int LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.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. |
Implements LicenseSpring.ILicense.
void LicenseSpring.License.DeactivateAirGap | ( | string | code | ) |
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.
Implements LicenseSpring.ILicense.
string LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
DeviceVariable LicenseSpring.License.DeviceVariable | ( | string | name | ) |
Get device variable by name.Returns empty device variable if the variable does not exist
Implements LicenseSpring.ILicense.
string LicenseSpring.License.DeviceVariableValue | ( | string | name | ) |
Get device variable value by name.
name | Device variable name |
Implements LicenseSpring.ILicense.
LicenseFeature LicenseSpring.License.Feature | ( | string | featureCode | ) |
Get product (license) feature by feature code.
featureCode | Feature identifier (code) |
Implements LicenseSpring.ILicense.
LicenseFeature[] LicenseSpring.License.Features | ( | ) |
Product features available for the license.
Implements LicenseSpring.ILicense.
string LicenseSpring.License.FloatingClientId | ( | ) |
Floating user (client) or instance id.Meaningful only for offline floating license.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
uint LicenseSpring.License.FloatingSlotsCount | ( | ) |
Overall Floating slots or users count. Amount of simultaneous users (instances) allowed for this license.Meaningful only for Floating license.
Implements LicenseSpring.ILicense.
uint LicenseSpring.License.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).
Implements LicenseSpring.ILicense.
uint LicenseSpring.License.FloatingTimeout | ( | ) |
Floating timeout in minutes.Meaningful only for Floating license.
Implements LicenseSpring.ILicense.
string LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
DeviceVariable[] LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
ProductDetails LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.GracePeriodEndDateTime | ( | ) |
Getter for grace period end date time in local time.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.GracePeriodEndDateTimeUTC | ( | ) |
Getter for grace period end date time in UTC.
Implements LicenseSpring.ILicense.
double LicenseSpring.License.GracePeriodHoursRemaining | ( | ) |
How many hours remaining till grace period ends.
Implements LicenseSpring.ILicense.
LicenseID LicenseSpring.License.Id | ( | ) |
bool LicenseSpring.License.IsAirGapped | ( | ) |
Was this license activated using air-gap activation.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsBorrowed | ( | ) |
Checker for whether the license is borrowed.Meaningful only for Floating license, see License.Borrow
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsConsumptionOverageAllowed | ( | ) |
Is it allowed to exceed consumption for this license.Meaningful only for Consumption based license.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsConsumptionResetEnabled | ( | ) |
Indicates whether consumption resets after a certain period of time.Meaningful only for Consumption license.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsDeviceTransferAllowed | ( | ) |
Checks if license can be transfered between devices.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsDeviceTransferLimited | ( | ) |
Checks if the license allows only limited number of transfers between devices.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsExpired | ( | ) |
Is license expired.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsFloating | ( | ) |
Is this license floating.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsGracePeriodStarted | ( | ) |
Check if grace period started for a license.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsMaintenancePeriodExpired | ( | ) |
Is maintenance period expired.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsNegativeConsumptionAllowed | ( | ) |
Is negative consumption allowed for the license.Meaningful only for Consumption based license.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsOfflineActivated | ( | ) |
Was this license activated offline.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsSubscriptionGracePeriodStarted | ( | ) |
Check if grace period started for subscription license.Meaningful only for Subscription licenses
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsTrial | ( | ) |
Is this license trial.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsUnlimitedConsumptionAllowed | ( | ) |
Is unlimited consumption allowed for the license.Meaningful only for Consumption based license.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.IsValid | ( | ) |
Fast and simple way to check current local state of the license.Equivalent to Status().IsOk() and !IsExpired()
Implements LicenseSpring.ILicense.
string LicenseSpring.License.Key | ( | ) |
License key.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.LastCheckDate | ( | ) |
The DateTime of the last sync with the LicenseSpring platform.In other words - DateTime of the last online license check.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.LastCheckDateUTC | ( | ) |
The DateTime of the last sync with the LicenseSpring platform.In other words - DateTime of the last online license check.
Implements LicenseSpring.ILicense.
LicenseUser LicenseSpring.License.LicenseUser | ( | ) |
void LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
int LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.MaintenancePeriod | ( | ) |
Maintenance period for the license.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.MaintenancePeriodUTC | ( | ) |
Maintenance period for the license.
Implements LicenseSpring.ILicense.
uint LicenseSpring.License.MaxActivations | ( | ) |
How many times license can be activated.
Implements LicenseSpring.ILicense.
uint LicenseSpring.License.MaxBorrowTime | ( | ) |
Maximum borrowing period in hours.Meaningful only for floating license.
Implements LicenseSpring.ILicense.
int LicenseSpring.License.MaxConsumption | ( | ) |
Maximum consumption of the license.Meaningful only for Consumption based license.
Implements LicenseSpring.ILicense.
int LicenseSpring.License.MaxConsumptionOverage | ( | ) |
Extra amount of consumption that allows to go over MaxConsumption
.Meaningful only for Consumption based license.
Implements LicenseSpring.ILicense.
string LicenseSpring.License.Metadata | ( | ) |
string LicenseSpring.License.OrderStoreId | ( | ) |
Order store id.
Implements LicenseSpring.ILicense.
Customer LicenseSpring.License.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)
Implements LicenseSpring.ILicense.
uint LicenseSpring.License.PolicyId | ( | ) |
License Policy id.Currently meaningful only for air-gap activated license.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.ReleaseFloatingFeature | ( | ILicenseFeature | licenseFeature | ) |
Release a floating feature and free a license slot.Meaningful only for floating features.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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. |
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.StartDate | ( | ) |
License start date.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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.
Implements LicenseSpring.ILicense.
LicenseStatus LicenseSpring.License.Status | ( | ) |
Method for getting local license status, see LicenseStatus documentation.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.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
Implements LicenseSpring.ILicense.
void LicenseSpring.License.StopLicenseWatchdog | ( | ) |
Stops license watchdog background thread.This method does not revoke floating license, just stops the watchdog.
Implements LicenseSpring.ILicense.
uint LicenseSpring.License.SubscriptionGracePeriod | ( | ) |
Grace period in hours.Meaningful only for Subscription license.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.SyncConsumption | ( | OverageRequest | overageRequest = null | ) |
Sync Consumption license with the LicenseSpring platform.Meaningful only for Consumption based license.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.SyncFeatureConsumption | ( | string | featureCode = null | ) |
Sync Consumption feature with the LicenseSpring platform.Meaningful only for Consumption features.
Implements LicenseSpring.ILicense.
uint LicenseSpring.License.TimesActivated | ( | ) |
How many times license already been activated.
Implements LicenseSpring.ILicense.
int LicenseSpring.License.TotalConsumption | ( | ) |
Current total consumption of the license.Meaningful only for Consumption based license.
Implements LicenseSpring.ILicense.
uint LicenseSpring.License.TransferCount | ( | ) |
How many times license has been transferred between devices.
Implements LicenseSpring.ILicense.
uint LicenseSpring.License.TransferLimit | ( | ) |
Maximum number of allowed license transfers between devices.
Implements LicenseSpring.ILicense.
LicenseType LicenseSpring.License.Type | ( | ) |
void LicenseSpring.License.UpdateConsumption | ( | int | value = 1 | ) |
Increase local consumption counter for consumption license.Meaningful only for Consumption based license.
Implements LicenseSpring.ILicense.
void LicenseSpring.License.UpdateFeatureConsumption | ( | string | featureCode, |
int | value = 1 |
||
) |
Increase local consumption counter for consumption product feature.Meaningful only for Consumption product features.
Implements LicenseSpring.ILicense.
bool LicenseSpring.License.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 |
Implements LicenseSpring.ILicense.
string LicenseSpring.License.User | ( | ) |
Email of the License user.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.ValidityPeriod | ( | ) |
The DateTime until the license is valid.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.ValidityPeriodUTC | ( | ) |
The DateTime until the license is valid.
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.ValidityWithGracePeriod | ( | ) |
The DateTime until the license is valid including grace period.Currently grace period meaningful only for Subscription licenses
Implements LicenseSpring.ILicense.
DateTime LicenseSpring.License.ValidityWithGracePeriodUTC | ( | ) |
The DateTime until the license is valid including grace period.Currently grace period meaningful only for Subscription licenses
Implements LicenseSpring.ILicense.
|
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.
Implements LicenseSpring.ILicense.