| 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.BaseManager Class Reference

Base class for License management. More...

Inheritance diagram for LicenseSpring.BaseManager:

## Public Member Functions
void | ClearLocalStorage ()
| Removes the license file, license log and folders created by the SDK.
ILicense | CurrentLicense ()
| Load license from local storage (if not yet loaded).
virtual void | Initialize (Configuration configuration, ILicenseStorage storage=null)
| Initialize license manager with the given configuration.
bool | IsInitialized ()
| Check whether license manager has been initialized.
string | LicenseFilePath ()
| Returns full path to the license file, meaningful only if LicenseFileStorage (or derived) is used.
ILicense | ReloadLicense ()
| Resets current license and loads it again from the local storage.

## Properties
string | DataLocation`[get, set]`
| Folder path where LicenseSpring data is being stored.
string | LicenseFileName`[get, set]`
| License filename with extension (optional), meaningful only if LicenseFileStorage is used.

## Detailed Description

Base class for License management.

Inherited by `LicenseManager` and `FloatingClient`

## Member Function Documentation

## ◆ ClearLocalStorage()

void LicenseSpring.BaseManager.ClearLocalStorage | ( |  | ) |

Removes the license file, license log and folders created by the SDK.

Typically should be called after license deactivation in the app uninstaller.

Exceptions

  System.InvalidOperationException | Thrown if the license manager is not initialized.

## ◆ CurrentLicense()

ILicense LicenseSpring.BaseManager.CurrentLicense | ( |  | ) |

Load license from local storage (if not yet loaded).

If license was already loaded this method returns an existing license object.

Returns
  License object or null if no license exists for current configuration.

Exceptions

  System.InvalidOperationException | Thrown if license manager is not initialized.
  LicenseSpring.LocalLicenseException | Thrown if the local license can't be loaded.

## ◆ Initialize()

virtual void LicenseSpring.BaseManager.Initialize | ( | Configuration | configuration,
|  | ILicenseStorage | storage = `null`
| ) |  |
| virtual

Initialize license manager with the given configuration.

Parameters

  configuration | Configuration object used to initialize the manager.
  storage | Storage for local license, uses local license file by default.

Exceptions

  System.ArgumentNullException | Configuration is null.

Reimplemented in LicenseSpring.FloatingClient.

## ◆ IsInitialized()

bool LicenseSpring.BaseManager.IsInitialized | ( |  | ) |

Check whether license manager has been initialized.

Returns
  True if license manager has been initialized and is ready to use, false otherwise.

## ◆ LicenseFilePath()

string LicenseSpring.BaseManager.LicenseFilePath | ( |  | ) |

Returns full path to the license file, meaningful only if LicenseFileStorage (or derived) is used.

Returns
  Absolute path to the license file or null if local storage is not file-based.

## ◆ ReloadLicense()

ILicense LicenseSpring.BaseManager.ReloadLicense | ( |  | ) |

Resets current license and loads it again from the local storage.

Returns
  License object or null if no license exists for current configuration (DataLocation or LicenseFileName).

Exceptions

  System.InvalidOperationException | Thrown if license manager is not initialized.
  LicenseSpring.LocalLicenseException | Thrown if the local license can't be loaded.

## Property Documentation

## ◆ DataLocation

string LicenseSpring.BaseManager.DataLocation
| get set

Folder path where LicenseSpring data is being stored.

Data like log file, temporary files for offline activation and local license file if LicenseFileStorage is used (which it is by default). Default data folder path is Environment.SpecialFolder.LocalApplicationData/LicenseSpring/{ProductCode}

## ◆ LicenseFileName

string LicenseSpring.BaseManager.LicenseFileName
| get set

License filename with extension (optional), meaningful only if LicenseFileStorage is used.

Default filename is License.key

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

- BaseManager.cs