Class LicenseHelper
Вспомогательный класс для работы с лицензиями.
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
Временной отступ до срока окончания действия текущей лицензии, когда можно будет ее продлевать. Равен 2-ум дням.
Declaration
public static readonly TimeSpan RenewOffset
Field Value
Type | Description |
---|---|
TimeSpan |
SpecialSplitter
Специальная комбинация '!!!' для разделения номера счетов, если в указании номера счета допускается использования запятой.
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)
Можно ли обновлять лицензию (до окончания времени действия лицензии осталось менее RenewOffset).
Declaration
public static bool CanRenew(this License license)
Parameters
Type | Name | Description |
---|---|---|
License | license | License. |
Returns
Type | Description |
---|---|
Boolean | true, если лицензию можно обновлять. Иначе, false. |
GetEstimatedTime(License)
Получить оставшееся время действия лицензии.
Declaration
public static TimeSpan GetEstimatedTime(this License license)
Parameters
Type | Name | Description |
---|---|---|
License | license | License. |
Returns
Type | Description |
---|---|
TimeSpan | Оставшееся время действия лицензии. Если лицензия истекла, то будет возвращено значение Zero. |
IsTrial(License)
Является ли лицензия триальной.
Declaration
public static bool IsTrial(this License license)
Parameters
Type | Name | Description |
---|---|---|
License | license | License. |
Returns
Type | Description |
---|---|
Boolean | true, если лицензия триальная, иначе, false. |
Remove(License)
Delete license.
Declaration
public static void Remove(this License license)
Parameters
Type | Name | Description |
---|---|---|
License | license | License. |
Save(License)
Сохранить лицензию на диске.
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)
Проверить лицензию по названию функциональности.
Declaration
public static string ValidateLicense(this string featureName, string portfolioName = null, Type component = null)
Parameters
Type | Name | Description |
---|---|---|
String | featureName | Название функциональности. |
String | portfolioName | Номер портфеля, который будет использоваться для проверки. |
Type | component | Компонента. |
Returns
Type | Description |
---|---|
String | Описание ошибки, если лицензия не поддерживает функциональность. |
Events
LicenseError
Событие ошибки проверки лицензии.
Declaration
public static event Action<License, string> LicenseError
Event Type
Type | Description |
---|---|
Action<License, String> |
LicensesChanged
Событие изменения Licenses.
Declaration
public static event Action LicensesChanged
Event Type
Type | Description |
---|---|
Action |