Class Licensing
A place for functions related to SDS2 licensing.
Inheritance
Inherited Members
Namespace: DesignData.SDS2.Database
Assembly: DesignData.SDS2.Database.dll
Syntax
public class Licensing
Remarks
The normal program start procedure looks like:
if(!Licensing.HasStoredCredentials)
{
string userName = .. prompt for user name;
string password = .. prompt for password;
Licensing.SetCredentials(userName, password);
}
Licensing.Checkout();
Properties
HasStoredCredentials
Check if SDS2 already has working stored credentials to use, if it does you do not need to prompt and get credentials
Declaration
public static bool HasStoredCredentials { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsLicensed
Returns true if the user has a valid license to run the API
Declaration
public static bool IsLicensed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Checkout()
Checkout your license for the full run of your program.
Declaration
public static LicenseReturnCode Checkout()
Returns
Type | Description |
---|---|
LicenseReturnCode |
Remarks
There is no checkin, this call is just needed to give you time to prompt for credentials if needed
Finalize()
Declaration
protected void Finalize()
GetIsLicensed()
Returns true if the user has a valid license to run the API
Declaration
public static bool GetIsLicensed()
Returns
Type | Description |
---|---|
System.Boolean |
HasFeature(LicenseFeatures)
Returns true if the user has a valid license to run the given API feature
Declaration
public static bool HasFeature(LicenseFeatures feature)
Parameters
Type | Name | Description |
---|---|---|
LicenseFeatures | feature |
Returns
Type | Description |
---|---|
System.Boolean | The API feature to be checked. |
SetCredentials(String, String)
If SDS2 didn't have stored credentials, and you've prompted the user for their 10duke login, you can then pass these credentials to SDS2 and it will use them to checkout a license
Declaration
public static void SetCredentials(string userName, string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | |
System.String | password |