Class LicenseHelper
Extension class for licenses.
Inherited Members
Namespace: StockSharp.Licensing
Assembly: StockSharp.Licensing.dll
Syntax
public static class LicenseHelper
Fields
ExcludeCurrentDirectory
Exclude current directory for scan available licenses.
Declaration
public static bool ExcludeCurrentDirectory
Field Value
Type | Description |
---|---|
Boolean |
RenewOffset
Date offset from the expiry date of the current license, when it can be renewed. The default is 2 days.
Declaration
public static readonly TimeSpan RenewOffset
Field Value
Type | Description |
---|---|
TimeSpan |
SpecialSplitter
The special combination of '!!!' for the separation of account numbers.
Declaration
public const string SpecialSplitter = "!!!"
Field Value
Type | Description |
---|---|
String |
Properties
Licenses
Available licenses.
Declaration
public static IEnumerable<License> Licenses { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<License> |
Methods
CanRenew(License)
Check the possibility of license renewal (until the end of time, the license remains less RenewOffset).
Declaration
public static bool CanRenew(this License license)
Parameters
Type | Name | Description |
---|---|---|
License | license | License. |
Returns
Type | Description |
---|---|
Boolean | true, if the license can be renewed, otherwise, false. |
GetEstimatedTime(License)
Get the remaining time of the license.
Declaration
public static TimeSpan GetEstimatedTime(this License license)
Parameters
Type | Name | Description |
---|---|---|
License | license | License. |
Returns
Type | Description |
---|---|
TimeSpan | Remaining time of the license. If the license is expired, the value Zero will be returned. |
IsTrial(License)
License it trial.
Declaration
public static bool IsTrial(this License license)
Parameters
Type | Name | Description |
---|---|---|
License | license | License. |
Returns
Type | Description |
---|---|
Boolean | true, if the license if trial, otherwise, false. |
Remove(License)
Delete license.
Declaration
public static void Remove(this License license)
Parameters
Type | Name | Description |
---|---|---|
License | license | License. |
Save(License)
Save the license on local disk.
Declaration
public static string Save(this License license)
Parameters
Type | Name | Description |
---|---|---|
License | license | License. |
Returns
Type | Description |
---|---|
String | File name. |
ValidateLicense(String, String, Type)
Check the license supported the feature.
Declaration
public static string ValidateLicense(this string featureName, string portfolioName = null, Type component = null)
Parameters
Type | Name | Description |
---|---|---|
String | featureName | Feature. |
String | portfolioName | The account number that will be used for verification. |
Type | component | Component. |
Returns
Type | Description |
---|---|
String | Error info, if the license does not support the feature. |
Events
LicenseError
License verification error event.
Declaration
public static event Action<License, string> LicenseError
Event Type
Type | Description |
---|---|
Action<License, String> |
LicensesChanged
Licenses change event.
Declaration
public static event Action LicensesChanged
Event Type
Type | Description |
---|---|
Action |