Table of Contents

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

bool

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

TimeSpan

SpecialSplitter

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

public const string SpecialSplitter = "!!!"

Field Value

string

Properties

CurrentPlatform

Current platform.

public static OSPlatform CurrentPlatform { get; }

Property Value

OSPlatform

Licenses

Available licenses.

public static IEnumerable<License> Licenses { get; }

Property Value

IEnumerable<License>

Methods

GetTimestampedType(DateTime)

Get fake type with specified timestamp.

public static Type GetTimestampedType(DateTime assemblyTimestamp)

Parameters

assemblyTimestamp DateTime

Returns

Type

Remove(License)

Delete license.

public static void Remove(this License license)

Parameters

license License

License.

Save(License)

Save the license on local disk.

public static string Save(this License license)

Parameters

license License

License.

Returns

string

File name.

Save(License, string)

Save the license on local disk.

public static string Save(this License license, string path)

Parameters

license License

License.

path string

Destination folder.

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 string

Feature.

portfolioName string

The account number that will be used for verification.

component Type

Component.

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 string

Feature.

portfolioName string

The account number that will be used for verification.

component Type

Component.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask<(string message, License)>

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

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 string

Feature.

portfolioName string

The account number that will be used for verification.

component Type

Component.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask<string>

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

Events

LicenseError

License verification error event.

public static event Action<License, string> LicenseError

Event Type

Action<License, string>

LicensesChanged

Licenses change event.

public static event Action LicensesChanged

Event Type

Action