Class LicenseHelper
- Namespace
- StockSharp.Licensing
- Assembly
- StockSharp.Licensing.dll
Extension class for licenses.
public static class LicenseHelper
- Inheritance
-
LicenseHelper
- Inherited Members
Fields
ExcludeCurrentDirectory
Exclude current directory for scan available licenses.
public static bool ExcludeCurrentDirectory
Field Value
RenewOffset
Date offset from the expiry date of the current license, when it can be renewed. The default is 2 days.
public static readonly TimeSpan RenewOffset
Field Value
SpecialSplitter
The special combination of '!!!' for the separation of account numbers.
public const string SpecialSplitter = "!!!"
Field Value
Properties
CurrentPlatform
Current platform.
public static OSPlatform CurrentPlatform { get; }
Property Value
Licenses
Available licenses.
public static IEnumerable<License> Licenses { get; }
Property Value
Methods
GetTimestampedType(DateTime)
Get fake type with specified timestamp.
public static Type GetTimestampedType(DateTime assemblyTimestamp)
Parameters
assemblyTimestamp
DateTime
Returns
Remove(License)
Delete license.
public static void Remove(this License license)
Parameters
license
LicenseLicense.
Save(License)
Save the license on local disk.
public static string Save(this License license)
Parameters
license
LicenseLicense.
Returns
- string
File name.
Save(License, string)
Save the license on local disk.
public static string Save(this License license, string path)
Parameters
Returns
- string
File name.
ValidateLicense(string, string, Type)
Check the license supported the feature.
public static string ValidateLicense(this string featureName, string portfolioName = null, Type component = null)
Parameters
featureName
stringFeature.
portfolioName
stringThe account number that will be used for verification.
component
TypeComponent.
Returns
- string
Error info, if the license does not support the feature.
ValidateLicense2Async(string, string, Type, CancellationToken)
Check the license supported the feature.
public static ValueTask<(string message, License)> ValidateLicense2Async(this string featureName, string portfolioName = null, Type component = null, CancellationToken cancellationToken = default)
Parameters
featureName
stringFeature.
portfolioName
stringThe account number that will be used for verification.
component
TypeComponent.
cancellationToken
CancellationToken
Returns
ValidateLicenseAsync(string, string, Type, CancellationToken)
Check the license supported the feature.
public static ValueTask<string> ValidateLicenseAsync(this string featureName, string portfolioName = null, Type component = null, CancellationToken cancellationToken = default)
Parameters
featureName
stringFeature.
portfolioName
stringThe account number that will be used for verification.
component
TypeComponent.
cancellationToken
CancellationToken
Returns
Events
LicenseError
License verification error event.
public static event Action<License, string> LicenseError
Event Type
LicensesChanged
Licenses change event.
public static event Action LicensesChanged