LicenseHelper

StockSharp.Licensing

Extension class for licenses.

Properties

CurrentPlatform
public static OSPlatform CurrentPlatform { get; }
value = LicenseHelper.CurrentPlatform

Current platform.

Licenses
public static IEnumerable<License> Licenses { get; }
value = LicenseHelper.Licenses

Available licenses.

Methods

GetTimestampedType
public static Type GetTimestampedType(DateTime assemblyTimestamp)
result = LicenseHelper.GetTimestampedType(assemblyTimestamp)

Get fake type with specified timestamp.

Remove
public static void Remove(License license)
LicenseHelper.Remove(license)

Delete license.

license
License.
Save
public static string Save(License license)
result = LicenseHelper.Save(license)

Save the license on local disk.

license
License.

Returns: File name.

Save
public static string Save(License license, string path)
result = LicenseHelper.Save(license, path)

Save the license on local disk.

license
License.
path
Destination folder.

Returns: File name.

ValidateLicense
public static string ValidateLicense(string featureName, string portfolioName, Type component)
result = LicenseHelper.ValidateLicense(featureName, portfolioName, component)

Check the license supported the feature.

featureName
Feature.
portfolioName
The account number that will be used for verification.
component
Component.

Returns: Error info, if the license does not support the feature.

ValidateLicense2Async
public static ValueTask<ValueTuple<string, License>> ValidateLicense2Async(string featureName, string portfolioName, Type component, CancellationToken cancellationToken)
result = LicenseHelper.ValidateLicense2Async(featureName, portfolioName, component, cancellationToken)

Check the license supported the feature.

featureName
Feature.
portfolioName
The account number that will be used for verification.
component
Component.
cancellationToken
CancellationToken.

Returns: Error info, if the license does not support the feature.

ValidateLicenseAsync
public static ValueTask<string> ValidateLicenseAsync(string featureName, string portfolioName, Type component, CancellationToken cancellationToken)
result = LicenseHelper.ValidateLicenseAsync(featureName, portfolioName, component, cancellationToken)

Check the license supported the feature.

featureName
Feature.
portfolioName
The account number that will be used for verification.
component
Component.
cancellationToken
CancellationToken.

Returns: Error info, if the license does not support the feature.

Events

LicenseError
public static event Action<License, string> LicenseError
LicenseHelper.LicenseError += handler

License verification error event.

LicensesChanged
public static event Action LicensesChanged
LicenseHelper.LicensesChanged += handler

Licenses change event.

Fields

ExcludeCurrentDirectory
public static bool ExcludeCurrentDirectory
value = LicenseHelper.ExcludeCurrentDirectory

Exclude current directory for scan available licenses.

RenewOffset
public static readonly TimeSpan RenewOffset
value = LicenseHelper.RenewOffset

Date offset from the expiry date of the current license, when it can be renewed. The default is 2 days.

SpecialSplitter
public const string SpecialSplitter
value = LicenseHelper.SpecialSplitter

The special combination of '!!!' for the separation of account numbers.