LicenseHelper
Extension class for licenses.
Properties
public static OSPlatform CurrentPlatform { get; }
value = LicenseHelper.CurrentPlatform
Current platform.
public static IEnumerable<License> Licenses { get; }
value = LicenseHelper.Licenses
Available licenses.
Methods
public static Type GetTimestampedType(DateTime assemblyTimestamp)
result = LicenseHelper.GetTimestampedType(assemblyTimestamp)
Get fake type with specified timestamp.
public static void Remove(License license)
LicenseHelper.Remove(license)
Delete license.
- license
- License.
public static string Save(License license)
result = LicenseHelper.Save(license)
Save the license on local disk.
- license
- License.
Returns: File name.
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.
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.
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.
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
public static event Action<License, string> LicenseError
LicenseHelper.LicenseError += handler
License verification error event.
public static event Action LicensesChanged
LicenseHelper.LicensesChanged += handler
Licenses change event.
Fields
public static bool ExcludeCurrentDirectory
value = LicenseHelper.ExcludeCurrentDirectory
Exclude current directory for scan available licenses.
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.
public const string SpecialSplitter
value = LicenseHelper.SpecialSplitter
The special combination of '!!!' for the separation of account numbers.