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

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Properties | List of all members
LicenseSpring.LicenseID Class Reference

Class that represents License identifier. More...

Inheritance diagram for LicenseSpring.LicenseID:

## Public Member Functions
bool | Equals (LicenseID id)
| Compare this object with given LicenseID.
override bool | Equals (object obj)
| Overrides Object.Equals.
override int | GetHashCode ()
| Overrides Object.GetHashCode.
string | Id ()
| Returns license key or user identifier, depending of what is present. Returns License key or user identifier string
bool | IsEmpty ()
| Checks if LicenseID is empty.LicenseID considered empty if both license key and user are empty strings.
bool | IsValid ()
| Checks if LicenseID is valid.LicenseID considered valid if one of the members (key or user) is not empty. Equivalent of !IsEmpty().

## Static Public Member Functions
static LicenseID | FromKey (string licenseKey)
| Constructs LicenseID with given license key.
static LicenseID | FromKey (string licenseKey, long? serverId)
| Constructs LicenseID with given license key and the server ID of the license.
static LicenseID | FromUser (string user, long? serverId, string password="")
| Constructs LicenseID with given user credentials, including the server ID of the license.
static LicenseID | FromUser (string user, string password="")
| Constructs LicenseID with given user credentials.
static bool | operator!= (LicenseID lhs, LicenseID rhs)
| Compare two LicenseIDs.
static bool | operator== (LicenseID lhs, LicenseID rhs)
| Compare two LicenseIDs.

## Properties
string | Key`[get]`
| License key or empty string, if key is not set, for example in case of user-based product.
string | Password`[get, set]`
| Returns user password or empty string, if password is not set. SDK does not store password on disk or anywhere else.
long? | ServerId`[get, set]`
| Serverside license id, used for activating user licenses if a single user has multiple licenses for the same product. If not set, latest license will be activated.
string | User`[get]`
| User identifier or empty string, if user is not set, for example in case of key-based product.
Properties inherited from LicenseSpring.ILicenseID

## Detailed Description

Class that represents License identifier.

For key-based products it is license key, for user-based products it is user credentials - user identifier (typically email) and password.

Please note: password only required for license activation, other API does not require password. This class does not throw exceptions.

## Member Function Documentation

## ◆ Equals()

bool LicenseSpring.LicenseID.Equals | ( | LicenseID | id | ) |

Compare this object with given LicenseID.

Returns
  True if objects equal and false otherwise

## ◆ FromKey() [1/2]

static LicenseID LicenseSpring.LicenseID.FromKey | ( | string | licenseKey | ) |
| static

Constructs LicenseID with given license key.

Returns
  LicenseID object

## ◆ FromKey() [2/2]

static LicenseID LicenseSpring.LicenseID.FromKey | ( | string | licenseKey,
|  | long? | serverId
| ) |  |
| static

Constructs LicenseID with given license key and the server ID of the license.

Returns
  LicenseID object

## ◆ FromUser()

static LicenseID LicenseSpring.LicenseID.FromUser | ( | string | user,
|  | string | password = `""`
| ) |  |
| static

Constructs LicenseID with given user credentials.

Returns
  LicenseID object

## ◆ Id()

string LicenseSpring.LicenseID.Id | ( |  | ) |

Returns license key or user identifier, depending of what is present.

Returns
  License key or user identifier string

Implements LicenseSpring.ILicenseID.

## ◆ IsEmpty()

bool LicenseSpring.LicenseID.IsEmpty | ( |  | ) |

Checks if LicenseID is empty.LicenseID considered empty if both license key and user are empty strings.

Implements LicenseSpring.ILicenseID.

## ◆ IsValid()

bool LicenseSpring.LicenseID.IsValid | ( |  | ) |

Checks if LicenseID is valid.LicenseID considered valid if one of the members (key or user) is not empty. Equivalent of !IsEmpty().

Implements LicenseSpring.ILicenseID.

## ◆ operator!=()

static bool LicenseSpring.LicenseID.operator!= | ( | LicenseID | lhs,
|  | LicenseID | rhs
| ) |  |
| static

Compare two LicenseIDs.

Returns
  True if objects are not equal and false otherwise

## ◆ operator==()

static bool LicenseSpring.LicenseID.operator== | ( | LicenseID | lhs,
|  | LicenseID | rhs
| ) |  |
| static

Compare two LicenseIDs.

Returns
  True if objects equal and false otherwise

## Property Documentation

## ◆ Key

string LicenseSpring.LicenseID.Key
| get

License key or empty string, if key is not set, for example in case of user-based product.

Implements LicenseSpring.ILicenseID.

## ◆ Password

string LicenseSpring.LicenseID.Password
| get set

Returns user password or empty string, if password is not set. SDK does not store password on disk or anywhere else.

Implements LicenseSpring.ILicenseID.

## ◆ ServerId

long? LicenseSpring.LicenseID.ServerId
| get set

Serverside license id, used for activating user licenses if a single user has multiple licenses for the same product. If not set, latest license will be activated.

Implements LicenseSpring.ILicenseID.

## ◆ User

string LicenseSpring.LicenseID.User
| get

User identifier or empty string, if user is not set, for example in case of key-based product.

Implements LicenseSpring.ILicenseID.

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

- LicenseID.cs