| LicenseSpring .Net SDK 8.1.0 Easily add Software Licensing to your application

Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
LicenseSpring.ILicense Interface Reference

License interface. More...

Inheritance diagram for LicenseSpring.ILicense:

## Public Member Functions
DateTime | ActivationDate ()
| DateTime of the license activation.
DateTime | ActivationDateUTC ()
| DateTime of the license activation.
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 | AddExtendedFeatureTarget (string featureCode)
| Starts tracking a floating feature in the extended watchdog. Idempotent for the same code.
void | AddExtendedLicenseTarget ()
| Starts tracking the license in the extended watchdog. Idempotent.
void | Borrow (DateTime endDateTime)
| Borrow floating license untill provided end DateTime.
void | Borrow (string borrowEndDateTime=null)
| Borrow floating license untill provided end DateTime string.
void | Borrow (string password, DateTime endDateTime)
| Borrow floating license untill provided end DateTime.
void | Borrow (string password, string borrowEndDateTime=null)
| Borrow floating license untill provided end DateTime string.
void | Borrow (string password, uint hours, uint days)
| Borrow floating license for provided time interval.
void | Borrow (uint hours, uint days)
| Borrow floating license for provided time interval.
void | BorrowFloatingFeature (ILicenseFeature licenseFeature, DateTime endDateTime)
| Borrow floating feature untill provided end DateTime.
void | BorrowFloatingFeature (ILicenseFeature licenseFeature, string borrowEndDateTime=null)
| Borrow floating feature untill provided end DateTime.
void | BorrowFloatingFeature (ILicenseFeature licenseFeature, string password, DateTime endDateTime)
| Borrow floating feature untill provided end DateTime.
void | BorrowFloatingFeature (ILicenseFeature licenseFeature, string password, string borrowEndDateTime=null)
| Borrow floating feature untill provided end DateTime.
void | BorrowFloatingFeature (ILicenseFeature licenseFeature, string password, uint hours, uint days)
| Borrow floating feature untill provided end DateTime.
void | BorrowFloatingFeature (ILicenseFeature licenseFeature, uint hours, uint days)
| Borrow floating feature untill provided end DateTime.
void | BorrowFloatingFeatureSSO (ILicenseFeature licenseFeature, string authData, string accountCode, bool useToken, DateTime endDateTime, string redirectUri=null)
| Borrow floating license using SSO authentication untill provided end DateTime.
void | BorrowFloatingFeatureSSO (ILicenseFeature licenseFeature, string authData, string accountCode, bool useToken, string borrowEndDateTime=null, string redirectUri=null)
| Borrow floating license using SSO authentication untill provided end DateTime string.
void | BorrowFloatingFeatureSSO (ILicenseFeature licenseFeature, string authData, string accountCode, bool useToken, uint hours, uint days=0, string redirectUri=null)
| Borrow floating license using SSO authentication for provided time interval.
void | BorrowSSO (string authData, string accountCode, bool useToken, DateTime endDateTime, string redirectUri=null)
| Borrow floating license using SSO authentication untill provided end DateTime.
void | BorrowSSO (string authData, string accountCode, bool useToken, string borrowEndDateTime=null, string redirectUri=null)
| Borrow floating license using SSO authentication untill provided end DateTime string.
void | BorrowSSO (string authData, string accountCode, bool useToken, uint hours, uint days=0, string redirectUri=null)
| Borrow floating license using SSO authentication 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.
Company | Company ()
| Class that encapsulates information about a company on the LicenseSpring backend.
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 Parameters
  removeLocalData |
void | DeactivateAirGap (string confirmationCode)
| Verify Confirmation code and deactivate air gap license.
string | DeactivateOffline (string deactivationRequestFile=null, DeviceVariable[] deviceVariables=null)
| Deactivate license locally and create an offline deactivation file request.
DeviceVariable | DeviceVariable (string name)
| Get device variable by name.
string | DeviceVariableValue (string name)
| Get device variable value by name.
ExtendedLicenseWatchdogTargetSnapshot[] | ExtendedWatchdogSnapshot ()
| Returns a snapshot of every extended-watchdog target, or an empty array if not set up.
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 DateTime in local time zone.
DateTime | FloatingEndDateTimeUtc ()
| Floating license validity end DateTime 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 ()
| Checks if 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.
long | MaxConsumption ()
| Maximum consumption of the license.
long | 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 | RemoveExtendedFeatureTarget (string featureCode)
| Stops tracking a floating feature in the extended watchdog. No-op if not set up.
void | RemoveExtendedLicenseTarget ()
| Stops tracking the license in the extended watchdog. No-op if not set up.
void | RequestExtendedCheckNow ()
| Schedules every extended-watchdog target for immediate refresh. No-op if not set up.
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 | SetupExtendedWatchdog (ExtendedLicenseWatchdogCallbacks callbacks, ExtendedLicenseWatchdogOptions options=null)
| Sets up and starts the extended license/feature watchdog, replacing any previously configured one. A single background thread services the license and every floating feature, each with independent state, transition callbacks, and exponential backoff.
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 | StopExtendedWatchdog ()
| Stops and releases the extended watchdog. No-op if not set up.
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.
long | 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 (long value=1)
| Increase local consumption counter for consumption license.
void | UpdateFeatureConsumption (string featureCode, long 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.

## Detailed Description

License interface.

Provides all information on a license and license check methods.

## Member Function Documentation

## ◆ ActivationDate()

DateTime LicenseSpring.ILicense.ActivationDate | ( |  | ) |

DateTime of the license activation.

Returns
  DateTime when the license was activated, expressed in local time.

Implemented in LicenseSpring.License.

## ◆ ActivationDateUTC()

DateTime LicenseSpring.ILicense.ActivationDateUTC | ( |  | ) |

DateTime of the license activation.

Returns
  DateTime when the license was activated, expressed in UTC.

Implemented in LicenseSpring.License.

## ◆ AddDeviceVariable() [1/2]

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

Parameters

  variable | Device variable

Exceptions

  ArgumentNullException | If variable parameter is null.

Implemented in LicenseSpring.License.

## ◆ AddDeviceVariable() [2/2]

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

Parameters

  name | Device variable name
  value | Device variable value

Implemented in LicenseSpring.License.

## ◆ AddDeviceVariables()

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

Parameters

  variables | Device variables

Exceptions

  ArgumentNullException | If variables parameter is null.

Implemented in LicenseSpring.License.

## ◆ AddExtendedFeatureTarget()

void LicenseSpring.ILicense.AddExtendedFeatureTarget | ( | string | featureCode | ) |

Starts tracking a floating feature in the extended watchdog. Idempotent for the same code.

Exceptions

  WatchdogException | Thrown if the extended watchdog has not been set up, or the code is empty.

Implemented in LicenseSpring.License.

## ◆ AddExtendedLicenseTarget()

void LicenseSpring.ILicense.AddExtendedLicenseTarget | ( |  | ) |

Starts tracking the license in the extended watchdog. Idempotent.

Exceptions

  WatchdogException | Thrown if the extended watchdog has not been set up.

Implemented in LicenseSpring.License.

## ◆ Borrow() [1/6]

void LicenseSpring.ILicense.Borrow | ( | DateTime | endDateTime | ) |

Borrow floating license untill provided end DateTime.

Meaningful only for floating licenses. During borrow period there is no need to register a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  endDateTime | Borrowing end DateTime in local time.

Exceptions

  System.ArgumentException | In case end DateTime 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.

## ◆ Borrow() [2/6]

void LicenseSpring.ILicense.Borrow | ( | string | borrowEndDateTime = `null` | ) |

Borrow floating license untill provided end DateTime string.

Meaningful only for floating licenses. During borrow period there is no need to register a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  borrowEndDateTime | Borrow end DateTime 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.

Exceptions

  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.

## ◆ Borrow() [3/6]

void LicenseSpring.ILicense.Borrow | ( | string | password,
|  | DateTime | endDateTime
| ) |  |

Borrow floating license untill provided end DateTime.

Meaningful only for floating licenses. During borrow period there is no need to register a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  endDateTime | Borrowing end DateTime in local time.
  password | License password (for user based licenses).

Exceptions

  System.ArgumentException | In case end DateTime 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.

## ◆ Borrow() [4/6]

void LicenseSpring.ILicense.Borrow | ( | string | password,
|  | string | borrowEndDateTime = `null`
| ) |  |

Borrow floating license untill provided end DateTime 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.

Parameters

    borrowEndDateTime | Borrow end DateTime in UTC in format "%Y-%m-%dT%H:%M:%SZ". Parameters
    password | License password (for user based licenses).
  If it's null or empty the license will be borrowed for max possible period.

Exceptions

  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.

## ◆ Borrow() [5/6]

void LicenseSpring.ILicense.Borrow | ( | string | password,
|  | 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 a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  password | License password (for user based licenses).
  hours | Number of hours to borrow the license for.
  days | Number of days to borrow the license for.

Exceptions

  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.

## ◆ Borrow() [6/6]

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 a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  hours | Number of hours to borrow the license for.
  days | Number of days to borrow the license for.

Exceptions

  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.

## ◆ BorrowFloatingFeature() [1/6]

void LicenseSpring.ILicense.BorrowFloatingFeature | ( | ILicenseFeature | licenseFeature,
|  | DateTime | endDateTime
| ) |  |

Borrow floating feature untill provided end DateTime.

Meaningful only for floating features.

Parameters

  licenseFeature | Feature to borrow.
  endDateTime | Borrowing end DateTime in local time.

Exceptions

  System.ArgumentException | In case end DateTime 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.

## ◆ BorrowFloatingFeature() [2/6]

void LicenseSpring.ILicense.BorrowFloatingFeature | ( | ILicenseFeature | licenseFeature,
|  | string | borrowEndDateTime = `null`
| ) |  |

Borrow floating feature untill provided end DateTime.

Meaningful only for floating features.

Parameters

  licenseFeature | Feature to borrow.
  borrowEndDateTime | Borrow end DateTime 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.

Exceptions

  System.ArgumentException | In case end DateTime 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.

## ◆ BorrowFloatingFeature() [3/6]

void LicenseSpring.ILicense.BorrowFloatingFeature | ( | ILicenseFeature | licenseFeature,
|  | string | password,
|  | DateTime | endDateTime
| ) |  |

Borrow floating feature untill provided end DateTime.

Meaningful only for floating features.

Parameters

  licenseFeature | Feature to borrow.
  password | License password (for user based licenses).
  endDateTime | Borrowing end DateTime in local time.

Exceptions

  System.ArgumentException | In case end DateTime 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.

## ◆ BorrowFloatingFeature() [4/6]

void LicenseSpring.ILicense.BorrowFloatingFeature | ( | ILicenseFeature | licenseFeature,
|  | string | password,
|  | string | borrowEndDateTime = `null`
| ) |  |

Borrow floating feature untill provided end DateTime.

Meaningful only for floating features.

Parameters

  licenseFeature | Feature to borrow.
  password | License password (for user based licenses).
  borrowEndDateTime | Borrow end DateTime 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.

Exceptions

  System.ArgumentException | In case end DateTime 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.

## ◆ BorrowFloatingFeature() [5/6]

void LicenseSpring.ILicense.BorrowFloatingFeature | ( | ILicenseFeature | licenseFeature,
|  | string | password,
|  | uint | hours,
|  | uint | days
| ) |  |

Borrow floating feature untill provided end DateTime.

Meaningful only for floating features.

Parameters

  licenseFeature | Feature to borrow.
  password | License password (for user based licenses).
  hours | Number of hours to borrow the license for.
  days | Number of days to borrow the license for.

Exceptions

  System.ArgumentException | In case end DateTime 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.

## ◆ BorrowFloatingFeature() [6/6]

void LicenseSpring.ILicense.BorrowFloatingFeature | ( | ILicenseFeature | licenseFeature,
|  | uint | hours,
|  | uint | days
| ) |  |

Borrow floating feature untill provided end DateTime.

Meaningful only for floating features.

Parameters

  licenseFeature | Feature to borrow.
  hours | Number of hours to borrow the license for.
  days | Number of days to borrow the license for.

Exceptions

  System.ArgumentException | In case end DateTime 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.

## ◆ BorrowFloatingFeatureSSO() [1/3]

void LicenseSpring.ILicense.BorrowFloatingFeatureSSO | ( | ILicenseFeature | licenseFeature,
|  | string | authData,
|  | string | accountCode,
|  | bool | useToken,
|  | DateTime | endDateTime,
|  | string | redirectUri = `null`
| ) |  |

Borrow floating license using SSO authentication untill provided end DateTime.

Meaningful only for floating licenses. During borrow period there is no need to register a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  licenseFeature | Feature to borrow.
  authData | SSO id_token (JWT) or authorization code.
  accountCode | Customer account code for SSO.
  useToken | True if authData is id_token, false if authorization code.
  endDateTime | Borrowing end DateTime in local time.
  redirectUri | An optional redirect URI that needs to be sent with authentication data. The License API expects a non-empty value only when using an alternate SSO URL.

Exceptions

  System.ArgumentException | In case end DateTime 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.

## ◆ BorrowFloatingFeatureSSO() [2/3]

void LicenseSpring.ILicense.BorrowFloatingFeatureSSO | ( | ILicenseFeature | licenseFeature,
|  | string | authData,
|  | string | accountCode,
|  | bool | useToken,
|  | string | borrowEndDateTime = `null`,
|  | string | redirectUri = `null`
| ) |  |

Borrow floating license using SSO authentication untill provided end DateTime string.

Meaningful only for floating licenses. During borrow period there is no need to register a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  licenseFeature | Feature to borrow.
  authData | SSO id_token (JWT) or authorization code.
  accountCode | Customer account code for SSO.
  useToken | True if authData is id_token, false if authorization code.
  borrowEndDateTime | Borrow end DateTime in UTC in format "yyyy-MM-ddTHH:mm:ssZ". If it's null or empty the license will be borrowed for max possible period.
  redirectUri | An optional redirect URI that needs to be sent with authentication data. The License API expects a non-empty value only when using an alternate SSO URL.

Exceptions

  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.

## ◆ BorrowFloatingFeatureSSO() [3/3]

void LicenseSpring.ILicense.BorrowFloatingFeatureSSO | ( | ILicenseFeature | licenseFeature,
|  | string | authData,
|  | string | accountCode,
|  | bool | useToken,
|  | uint | hours,
|  | uint | days = `0`,
|  | string | redirectUri = `null`
| ) |  |

Borrow floating license using SSO authentication for provided time interval.

Meaningful only for floating licenses. During borrow period there is no need to register a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  licenseFeature | Feature to borrow.
  authData | SSO id_token (JWT) or authorization code.
  accountCode | Customer account code for SSO.
  useToken | True if authData is id_token, false if authorization code.
  hours | Number of hours to borrow the license for.
  days | Number of days to borrow the license for.
  redirectUri | An optional redirect URI that needs to be sent with authentication data. The License API expects a non-empty value only when using an alternate SSO URL.

Exceptions

  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.

## ◆ BorrowSSO() [1/3]

void LicenseSpring.ILicense.BorrowSSO | ( | string | authData,
|  | string | accountCode,
|  | bool | useToken,
|  | DateTime | endDateTime,
|  | string | redirectUri = `null`
| ) |  |

Borrow floating license using SSO authentication untill provided end DateTime.

Meaningful only for floating licenses. During borrow period there is no need to register a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  authData | SSO id_token (JWT) or authorization code.
  accountCode | Customer account code for SSO.
  useToken | True if authData is id_token, false if authorization code.
  endDateTime | Borrowing end DateTime in local time.
  redirectUri | An optional redirect URI that needs to be sent with authentication data. The License API expects a non-empty value only when using an alternate SSO URL.

Exceptions

  System.ArgumentException | In case end DateTime 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.

## ◆ BorrowSSO() [2/3]

void LicenseSpring.ILicense.BorrowSSO | ( | string | authData,
|  | string | accountCode,
|  | bool | useToken,
|  | string | borrowEndDateTime = `null`,
|  | string | redirectUri = `null`
| ) |  |

Borrow floating license using SSO authentication untill provided end DateTime string.

Meaningful only for floating licenses. During borrow period there is no need to register a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  authData | SSO id_token (JWT) or authorization code.
  accountCode | Customer account code for SSO.
  useToken | True if authData is id_token, false if authorization code.
  borrowEndDateTime | Borrow end DateTime in UTC in format "yyyy-MM-ddTHH:mm:ssZ". If it's null or empty the license will be borrowed for max possible period.
  redirectUri | An optional redirect URI that needs to be sent with authentication data. The License API expects a non-empty value only when using an alternate SSO URL.

Exceptions

  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.

## ◆ BorrowSSO() [3/3]

void LicenseSpring.ILicense.BorrowSSO | ( | string | authData,
|  | string | accountCode,
|  | bool | useToken,
|  | uint | hours,
|  | uint | days = `0`,
|  | string | redirectUri = `null`
| ) |  |

Borrow floating license using SSO authentication for provided time interval.

Meaningful only for floating licenses. During borrow period there is no need to register a floating license to keep it alive. Sets AutoRelease to false so the license won't automatically release before the borrow period ends.

Parameters

  authData | SSO id_token (JWT) or authorization code.
  accountCode | Customer account code for SSO.
  useToken | True if authData is id_token, false if authorization code.
  hours | Number of hours to borrow the license for.
  days | Number of days to borrow the license for.
  redirectUri | An optional redirect URI that needs to be sent with authentication data. The License API expects a non-empty value only when using an alternate SSO URL.

Exceptions

  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.

## ◆ CanBorrow()

bool LicenseSpring.ILicense.CanBorrow | ( |  | ) |

Is this license can be borrowed or not.

Equivalent to check MaxBorrowTime() > 0. Meaningful only for floating licenses.

Returns
  Boolean value indicating whether license can be borrowed

Implemented in LicenseSpring.License.

## ◆ ChangePassword()

bool LicenseSpring.ILicense.ChangePassword | ( | string | password,
|  | string | newPassword
| ) |  |

Change password for user-based license.

Does the same as `LicenseManager.ChangePassword`

Parameters

  password | User password
  newPassword | New password

Returns
  True if successfully changed and false otherwise.

Exceptions

  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.

## ◆ Check()

InstallationFile LicenseSpring.ILicense.Check | ( | IInstallationFileOptions | options = `null`,
|  | bool | includeExpiredFeatures = `false`
| ) |  |

Check current license for validity on the LicenseSpring platform.

Parameters

  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.

Returns
  The most recent `InstallationFile` available for the license (useful for managing software updates). Returns null in case request failed and grace period started.

Exceptions

  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.

## ◆ Company()

Company LicenseSpring.ILicense.Company | ( |  | ) |

Class that encapsulates information about a company on the LicenseSpring backend.

Implemented in LicenseSpring.License.

## ◆ ConsumptionPeriod()

ConsumptionPeriod LicenseSpring.ILicense.ConsumptionPeriod | ( |  | ) |

Period of time after which consumption is reset.

Meaningful only for Consumption license.

Implemented in LicenseSpring.License.

## ◆ CustomFields()

CustomField[] LicenseSpring.ILicense.CustomFields | ( |  | ) |

Custom data fields available for the license.

Returns
  Array of CustomField objects available for the license

Implemented in LicenseSpring.License.

## ◆ DaysPassedSinceLastCheck()

int LicenseSpring.ILicense.DaysPassedSinceLastCheck | ( |  | ) |

How many days passed since last online check.

Returns
  Days count since license was checked online

Implemented in LicenseSpring.License.

## ◆ DaysRemaining()

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.

Returns
  Days count till license expires in current time zone

Implemented in LicenseSpring.License.

## ◆ DaysRemainingUTC()

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.

Returns
  Days count till license expires by UTC

Implemented in LicenseSpring.License.

## ◆ Deactivate()

bool LicenseSpring.ILicense.Deactivate | ( | bool | removeLocalData = `false` | ) |

Deactivate current license

Parameters

  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.

Returns
  True if successfully deactivated and false otherwise. Also returns true if license already inactive.

Exceptions

  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.

## ◆ DeactivateAirGap()

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.

Parameters

  confirmationCode | Code received from the air gap activation portal

Exceptions

  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.

## ◆ DeactivateOffline()

string LicenseSpring.ILicense.DeactivateOffline | ( | string | deactivationRequestFile = `null`,
|  | DeviceVariable[] | deviceVariables = `null`
| ) |  |

Deactivate license locally and create an offline deactivation file request.

If you are going to uninstall your application, you should call LicenseManager.ClearLocalStorage afterwards.

Parameters

  deactivationRequestFile | Deactivation request file path, null means use default path (Desktop).
  deviceVariables | An array of device variables to be sent to the LicenseSpring platform during license activation.

Returns
  Path to offline deactivation file request.

Implemented in LicenseSpring.License.

## ◆ DeviceVariable()

DeviceVariable LicenseSpring.ILicense.DeviceVariable | ( | string | name | ) |

Get device variable by name.

Returns empty device variable if the variable does not exist

Returns
  Device variable

Implemented in LicenseSpring.License.

## ◆ DeviceVariableValue()

string LicenseSpring.ILicense.DeviceVariableValue | ( | string | name | ) |

Get device variable value by name.

Parameters

  name | Device variable name

Returns
  Device variable value or empty string if variable does not exist

Implemented in LicenseSpring.License.

## ◆ ExtendedWatchdogSnapshot()

ExtendedLicenseWatchdogTargetSnapshot[] LicenseSpring.ILicense.ExtendedWatchdogSnapshot | ( |  | ) |

Returns a snapshot of every extended-watchdog target, or an empty array if not set up.

Implemented in LicenseSpring.License.

## ◆ Feature()

LicenseFeature LicenseSpring.ILicense.Feature | ( | string | featureCode | ) |

Get product (license) feature by feature code.

Returns
  LicenseFeature objects or throws exception if there is no such feature

Parameters

  featureCode | Feature identifier (code)

Implemented in LicenseSpring.License.

## ◆ Features()

LicenseFeature[] LicenseSpring.ILicense.Features | ( |  | ) |

Product features available for the license.

Returns
  Array of LicenseFeature objects available for the license

Implemented in LicenseSpring.License.

## ◆ FloatingClientId()

string LicenseSpring.ILicense.FloatingClientId | ( |  | ) |

Floating user (client) or instance id.

Meaningful only for offline floating license.

Returns
  Floating client identifier that was set during registration, see FloatingClient.Register

Implemented in LicenseSpring.License.

## ◆ FloatingEndDateTime()

DateTime LicenseSpring.ILicense.FloatingEndDateTime | ( |  | ) |

Floating license validity end DateTime in local time zone.

Meaningful only for floating licenses, if license is borrowed this method returns borrowedUntil DateTime.

Returns
  End DateTime of the floating license

Implemented in LicenseSpring.License.

## ◆ FloatingEndDateTimeUtc()

DateTime LicenseSpring.ILicense.FloatingEndDateTimeUtc | ( |  | ) |

Floating license validity end DateTime in UTC.

Meaningful only for floating licenses, if license is borrowed this method returns borrowedUntil DateTime in UTC.

Returns
  End DateTime of the floating license

Implemented in LicenseSpring.License.

## ◆ FloatingSlotsCount()

uint LicenseSpring.ILicense.FloatingSlotsCount | ( |  | ) |

Overall Floating slots or users count. Amount of simultaneous users (instances) allowed for this license.

Meaningful only for Floating license.

Returns
  Overall floating slots count or 0 if license is not Floating

Implemented in LicenseSpring.License.

## ◆ FloatingSlotsInUse()

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).

Returns
  Floating slots in use count or 0 if license is not Floating

Implemented in LicenseSpring.License.

## ◆ FloatingTimeout()

uint LicenseSpring.ILicense.FloatingTimeout | ( |  | ) |

Floating timeout in minutes.

Meaningful only for Floating license.

Returns
  Floating timeout value or 0 if license is not Floating

Implemented in LicenseSpring.License.

## ◆ GetAirGapDeactivationCode()

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.

Parameters

  initializationCode | Code received from the air gap activation portal.

Returns
  Air gap Deactivation code.

Exceptions

  LicenseSpring.LicenseSpringException | If feature not supported for current target Framework

Implemented in LicenseSpring.License.

## ◆ GetDeviceVariables()

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.

Parameters

  getFromBackend | Indicates if you want to request device variables list from local license or backend

Returns
  Variable list for current device

Exceptions

  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.

## ◆ GetProductDetails()

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.

Returns
  Cached `ProductDetails` or null if `ProductDetails` not present in current license

Implemented in LicenseSpring.License.

## ◆ GracePeriodEndDateTime()

DateTime LicenseSpring.ILicense.GracePeriodEndDateTime | ( |  | ) |

Getter for grace period end date time in local time.

Returns
  The DateTime when grace period expires in local time

Implemented in LicenseSpring.License.

## ◆ GracePeriodEndDateTimeUTC()

DateTime LicenseSpring.ILicense.GracePeriodEndDateTimeUTC | ( |  | ) |

Getter for grace period end date time in UTC.

Returns
  The DateTime when grace period expires in UTC

Implemented in LicenseSpring.License.

## ◆ GracePeriodHoursRemaining()

double LicenseSpring.ILicense.GracePeriodHoursRemaining | ( |  | ) |

How many hours remaining till grace period ends.

Returns
  Double value representing hours remaining till grace period ends

Implemented in LicenseSpring.License.

## ◆ Id()

LicenseID LicenseSpring.ILicense.Id | ( |  | ) |

License ID.

Returns
  License ID, license key or email and password

Implemented in LicenseSpring.License.

## ◆ IsAirGapped()

bool LicenseSpring.ILicense.IsAirGapped | ( |  | ) |

Was this license activated using air-gap activation.

Returns
  Boolean value indicating whether license was activated air-gap

Implemented in LicenseSpring.License.

## ◆ IsBorrowed()

bool LicenseSpring.ILicense.IsBorrowed | ( |  | ) |

Checks if the license is borrowed.

Meaningful only for floating licenses, see Borrow(string).

Returns
  True if borrowed, false if not borrowed or if the license is not floating.

Implemented in LicenseSpring.License.

## ◆ IsConsumptionOverageAllowed()

bool LicenseSpring.ILicense.IsConsumptionOverageAllowed | ( |  | ) |

Is it allowed to exceed consumption for this license.

Meaningful only for Consumption based license.

Returns
  Boolean value indicating whether it's allowed to go over `MaxConsumption`.

Implemented in LicenseSpring.License.

## ◆ IsConsumptionResetEnabled()

bool LicenseSpring.ILicense.IsConsumptionResetEnabled | ( |  | ) |

Indicates whether consumption resets after a certain period of time.

Meaningful only for Consumption license.

Implemented in LicenseSpring.License.

## ◆ IsDeviceTransferAllowed()

bool LicenseSpring.ILicense.IsDeviceTransferAllowed | ( |  | ) |

Checks if license can be transfered between devices.

Returns
  True if license is transferable between devices, otherwise returns false.

Implemented in LicenseSpring.License.

## ◆ IsDeviceTransferLimited()

bool LicenseSpring.ILicense.IsDeviceTransferLimited | ( |  | ) |

Checks if the license allows only limited number of transfers between devices.

Returns
  True if license device transfers are limited, otherwise returns false.

Implemented in LicenseSpring.License.

## ◆ IsExpired()

bool LicenseSpring.ILicense.IsExpired | ( |  | ) |

Is license expired.

Returns
  Boolean value indicating whether license have been expired

Implemented in LicenseSpring.License.

## ◆ IsFloating()

bool LicenseSpring.ILicense.IsFloating | ( |  | ) |

Is this license floating.

Returns
  Boolean value indicating whether license is floating

Implemented in LicenseSpring.License.

## ◆ IsGracePeriodStarted()

bool LicenseSpring.ILicense.IsGracePeriodStarted | ( |  | ) |

Check if grace period started for a license.

Returns
  Returns true if grace period started and false otherwise.

Implemented in LicenseSpring.License.

## ◆ IsMaintenancePeriodExpired()

bool LicenseSpring.ILicense.IsMaintenancePeriodExpired | ( |  | ) |

Is maintenance period expired.

Returns
  Boolean value indicating whether maintenance period have been expired for current license

Implemented in LicenseSpring.License.

## ◆ IsNegativeConsumptionAllowed()

bool LicenseSpring.ILicense.IsNegativeConsumptionAllowed | ( |  | ) |

Is negative consumption allowed for the license.

Meaningful only for Consumption based license.

Returns
  Boolean value indicating whether negative consumption is allowed.

Implemented in LicenseSpring.License.

## ◆ IsOfflineActivated()

bool LicenseSpring.ILicense.IsOfflineActivated | ( |  | ) |

Was this license activated offline.

Returns
  Boolean value indicating whether license was activated offline

Implemented in LicenseSpring.License.

## ◆ IsSubscriptionGracePeriodStarted()

bool LicenseSpring.ILicense.IsSubscriptionGracePeriodStarted | ( |  | ) |

Check if grace period started for subscription license.

Meaningful only for Subscription licenses

Returns
  Returns true if grace period started and false otherwise.

Implemented in LicenseSpring.License.

## ◆ IsTrial()

bool LicenseSpring.ILicense.IsTrial | ( |  | ) |

Is this license trial.

Returns
  Boolean value indicating whether license is trial

Implemented in LicenseSpring.License.

## ◆ IsUnlimitedConsumptionAllowed()

bool LicenseSpring.ILicense.IsUnlimitedConsumptionAllowed | ( |  | ) |

Is unlimited consumption allowed for the license.

Meaningful only for Consumption based license.

Returns
  Boolean value indicating whether unlimited consumption is allowed.

Implemented in LicenseSpring.License.

## ◆ IsValid()

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.

Returns
  Boolean value indicating whether license is valid

Implemented in LicenseSpring.License.

## ◆ Key()

string LicenseSpring.ILicense.Key | ( |  | ) |

License key.

Returns
  License key as string or null if not available (in case of user-based product)

Implemented in LicenseSpring.License.

## ◆ LastCheckDate()

DateTime LicenseSpring.ILicense.LastCheckDate | ( |  | ) |

The DateTime of the last sync with the LicenseSpring platform.

In other words - DateTime of the last online license check.

Returns
  The DateTime of the last sync in local time

Implemented in LicenseSpring.License.

## ◆ LastCheckDateUTC()

DateTime LicenseSpring.ILicense.LastCheckDateUTC | ( |  | ) |

The DateTime of the last sync with the LicenseSpring platform.

In other words - DateTime of the last online license check.

Returns
  The DateTime of the last sync in UCT

Implemented in LicenseSpring.License.

## ◆ LicenseUser()

LicenseUser LicenseSpring.ILicense.LicenseUser | ( |  | ) |

License user.

Returns
  License user or null if not available

Implemented in LicenseSpring.License.

## ◆ LocalCheck()

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.

Exceptions

  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.

## ◆ MaintenanceDaysRemaining()

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.

Returns
  Days count till maintenance expires in current time zone

Implemented in LicenseSpring.License.

## ◆ MaintenancePeriod()

DateTime LicenseSpring.ILicense.MaintenancePeriod | ( |  | ) |

Maintenance period for the license.

Returns
  The DateTime when maintenance expires in local time

Implemented in LicenseSpring.License.

## ◆ MaintenancePeriodUTC()

DateTime LicenseSpring.ILicense.MaintenancePeriodUTC | ( |  | ) |

Maintenance period for the license.

Returns
  The DateTime when maintenance expires in UTC

Implemented in LicenseSpring.License.

## ◆ MaxActivations()

uint LicenseSpring.ILicense.MaxActivations | ( |  | ) |

How many times license can be activated.

Returns
  Maximum number of activations for the license.

Implemented in LicenseSpring.License.

## ◆ MaxBorrowTime()

uint LicenseSpring.ILicense.MaxBorrowTime | ( |  | ) |

Maximum borrowing period in hours.

Meaningful only for floating license.

Returns
  Max borrow time or 0 if license borrowing is not allowed

Implemented in LicenseSpring.License.

## ◆ MaxConsumption()

long LicenseSpring.ILicense.MaxConsumption | ( |  | ) |

Maximum consumption of the license.

Meaningful only for Consumption based license.

Returns
  Maximum consumption value or 0 if license type is not Consumption.

Implemented in LicenseSpring.License.

## ◆ MaxConsumptionOverage()

long LicenseSpring.ILicense.MaxConsumptionOverage | ( |  | ) |

Extra amount of consumption that allows to go over `MaxConsumption`.

Meaningful only for Consumption based license.

Returns
  Maximum extra consumption value or 0 if license type is not Consumption.

Implemented in LicenseSpring.License.

## ◆ Metadata()

string LicenseSpring.ILicense.Metadata | ( |  | ) |

License metadata.

Returns
  Json with license metadata

Implemented in LicenseSpring.License.

## ◆ OrderStoreId()

string LicenseSpring.ILicense.OrderStoreId | ( |  | ) |

Order store id.

Returns
  Order store id that can be found on the LicenseSpring portal.

Implemented in LicenseSpring.License.

## ◆ Owner()

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)

Returns
  Customer object who license belongs to or null if such information unavailable

Implemented in LicenseSpring.License.

## ◆ PolicyId()

uint LicenseSpring.ILicense.PolicyId | ( |  | ) |

License Policy id.

Currently meaningful only for air-gap activated license.

Returns
  License Policy id or 0

Implemented in LicenseSpring.License.

## ◆ Register()

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.

Exceptions

  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.

## ◆ RegisterFloatingFeature()

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.

Parameters

  licenseFeature | License feature to register.

Exceptions

  ArgumentNullException | If a null reference is passed to the method.

Implemented in LicenseSpring.License.

## ◆ Release()

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.

Parameters

  throwExceptions | Boolean value indicating whether this method should throw exceptions, by default it's false.

Implemented in LicenseSpring.License.

## ◆ ReleaseFloatingFeature()

void LicenseSpring.ILicense.ReleaseFloatingFeature | ( | ILicenseFeature | licenseFeature | ) |

Release a floating feature and free a license slot.

Meaningful only for floating features.

Parameters

  licenseFeature | License feature to register.

Exceptions

  ArgumentNullException | If a null reference is passed to the method.

Implemented in LicenseSpring.License.

## ◆ RemoveExtendedFeatureTarget()

void LicenseSpring.ILicense.RemoveExtendedFeatureTarget | ( | string | featureCode | ) |

Stops tracking a floating feature in the extended watchdog. No-op if not set up.

Implemented in LicenseSpring.License.

## ◆ RemoveExtendedLicenseTarget()

void LicenseSpring.ILicense.RemoveExtendedLicenseTarget | ( |  | ) |

Stops tracking the license in the extended watchdog. No-op if not set up.

Implemented in LicenseSpring.License.

## ◆ RequestExtendedCheckNow()

void LicenseSpring.ILicense.RequestExtendedCheckNow | ( |  | ) |

Schedules every extended-watchdog target for immediate refresh. No-op if not set up.

Implemented in LicenseSpring.License.

## ◆ ResumeLicenseWatchdog()

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.

## ◆ SendDeviceVariables()

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.

Returns
  Bool value indicating if device variables were sent. Returns false if there are no device variables or in case request failed and grace period started.

Exceptions

  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.

## ◆ SetupExtendedWatchdog()

void LicenseSpring.ILicense.SetupExtendedWatchdog | ( | ExtendedLicenseWatchdogCallbacks | callbacks,
|  | ExtendedLicenseWatchdogOptions | options = `null`
| ) |  |

Sets up and starts the extended license/feature watchdog, replacing any previously configured one. A single background thread services the license and every floating feature, each with independent state, transition callbacks, and exponential backoff.

Parameters

  callbacks | Per-target callbacks; any field may be null.
  options | Tunable parameters; null uses defaults.

Implemented in LicenseSpring.License.

## ◆ SetupFloatingFeatureWatchdog()

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.

Parameters

  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.

## ◆ SetupLicenseWatchdog() [1/2]

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.

Parameters

  callback | This function will be called back in case of errors.
  timeout | Timeout in minutes, 0 means use default

Implemented in LicenseSpring.License.

## ◆ SetupLicenseWatchdog() [2/2]

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.

Parameters

  settings | Watchdog settings.

Implemented in LicenseSpring.License.

## ◆ SetWatchdogTimeout()

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.

Parameters

  timeout | Timeout in minutes, 0 means use default

Implemented in LicenseSpring.License.

## ◆ StartDate()

DateTime LicenseSpring.ILicense.StartDate | ( |  | ) |

License start date.

Returns
  The DateTime when license can be activated

Implemented in LicenseSpring.License.

## ◆ StartFloatingFeatureWatchdog()

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.

## ◆ Status()

LicenseStatus LicenseSpring.ILicense.Status | ( |  | ) |

Method for getting local license status, see LicenseStatus documentation.

Returns
  LicenseStatus object for this license

Implemented in LicenseSpring.License.

## ◆ StopExtendedWatchdog()

void LicenseSpring.ILicense.StopExtendedWatchdog | ( |  | ) |

Stops and releases the extended watchdog. No-op if not set up.

Implemented in LicenseSpring.License.

## ◆ StopFloatingFeatureWatchdog()

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.

## ◆ StopLicenseWatchdog()

void LicenseSpring.ILicense.StopLicenseWatchdog | ( |  | ) |

Stops license watchdog background thread.

This method does not revoke floating license, just stops the watchdog.

Implemented in LicenseSpring.License.

## ◆ SubscriptionGracePeriod()

uint LicenseSpring.ILicense.SubscriptionGracePeriod | ( |  | ) |

Grace period in hours.

Meaningful only for Subscription license.

Returns
  Grace period value or 0 if grace period is not allowed

Implemented in LicenseSpring.License.

## ◆ SyncConsumption()

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.

Parameters

  overageRequest | Optional parameter to request consumption overage, see `OverageRequest`

Returns
  Bool value indicating if consumption was synchronized. Returns false in case request failed and grace period started.

Exceptions

  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.

## ◆ SyncFeatureConsumption()

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.

Returns
  Bool value indicating if consumption was synchronized. Returns false in case request failed and grace period started.

Exceptions

  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.

## ◆ TimesActivated()

uint LicenseSpring.ILicense.TimesActivated | ( |  | ) |

How many times license already been activated.

Returns
  Current number of activations for the license.

Implemented in LicenseSpring.License.

## ◆ TotalConsumption()

long LicenseSpring.ILicense.TotalConsumption | ( |  | ) |

Current total consumption of the license.

Meaningful only for Consumption based license.

Returns
  Current total consumption or 0 if license type is not Consumption.

Implemented in LicenseSpring.License.

## ◆ TransferCount()

uint LicenseSpring.ILicense.TransferCount | ( |  | ) |

How many times license has been transferred between devices.

Returns
  Transfer count of the license.

Implemented in LicenseSpring.License.

## ◆ TransferLimit()

uint LicenseSpring.ILicense.TransferLimit | ( |  | ) |

Maximum number of allowed license transfers between devices.

Returns
  Maximum device transfer limit of the license, uint.MaxValue for unlimited device transfers, 0 if device transfers are not allowed.

Implemented in LicenseSpring.License.

## ◆ Type()

LicenseType LicenseSpring.ILicense.Type | ( |  | ) |

Type of license.

Returns
  LicenseType

Implemented in LicenseSpring.License.

## ◆ UpdateConsumption()

void LicenseSpring.ILicense.UpdateConsumption | ( | long | value = `1` | ) |

Increase local consumption counter for consumption license.

Meaningful only for Consumption based license.

Parameters

  value | The value by which the counter is being increased, default is 1.

Exceptions

  System.InvalidOperationException | Thrown when called for not Consumption license type
  LicenseSpring.NotEnoughConsumptionException | Thrown when license is out of resources

Implemented in LicenseSpring.License.

## ◆ UpdateFeatureConsumption()

void LicenseSpring.ILicense.UpdateFeatureConsumption | ( | string | featureCode,
|  | long | value = `1`
| ) |  |

Increase local consumption counter for consumption product feature.

Meaningful only for Consumption product features.

Parameters

  featureCode | Feature identifier (code).
  value | The value by which the counter is being increased, default is 1.

Exceptions

  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.

## ◆ UpdateOffline()

bool LicenseSpring.ILicense.UpdateOffline | ( | string | path | ) |

Update license data accordingly to provided file.

Parameters

  path | Update file path

Returns
  True if license successfully updated and false otherwise

Exceptions

  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.

## ◆ User()

string LicenseSpring.ILicense.User | ( |  | ) |

Email of the License user.

Returns
  Email or null if not available (in case of key-based product)

Implemented in LicenseSpring.License.

## ◆ ValidityPeriod()

DateTime LicenseSpring.ILicense.ValidityPeriod | ( |  | ) |

The DateTime until the license is valid.

Returns
  The DateTime when license expires in local time

Implemented in LicenseSpring.License.

## ◆ ValidityPeriodUTC()

DateTime LicenseSpring.ILicense.ValidityPeriodUTC | ( |  | ) |

The DateTime until the license is valid.

Returns
  The DateTime when license expires in UTC

Implemented in LicenseSpring.License.

## ◆ ValidityWithGracePeriod()

DateTime LicenseSpring.ILicense.ValidityWithGracePeriod | ( |  | ) |

The DateTime until the license is valid including grace period.

Currently grace period meaningful only for Subscription licenses

Returns
  The DateTime when license expires in local time

Implemented in LicenseSpring.License.

## ◆ ValidityWithGracePeriodUTC()

DateTime LicenseSpring.ILicense.ValidityWithGracePeriodUTC | ( |  | ) |

The DateTime until the license is valid including grace period.

Currently grace period meaningful only for Subscription licenses

Returns
  The DateTime when license expires in UTC

Implemented in LicenseSpring.License.

## Property Documentation

## ◆ AutoRelease

bool LicenseSpring.ILicense.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.

Default value is false.

Implemented in LicenseSpring.License.

The documentation for this interface was generated from the following file:

- ILicense.cs