Click or drag to resize
AB4D logo

LicenseHelperEmbeddedLicenseAssembly Property

Gets or sets an Assembly that contains the embedded license key (its project contains the license.licx file as Embedded Resource).

Namespace: Ab3d.Licensing.PowerToys
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public static Assembly EmbeddedLicenseAssembly { get; set; }

Property Value

Assembly
Remarks
Note  Note
Ab3d.Licensing.PowerToys.LicenseHelper is available only in the commercial version (not in evaluation version).

When the project that is using PowerToys is compiled and the project contains the correct license.licx file, the compiler calls the licensing code in PowerToys that checks the installed license key and creates a runtime license key from it. The runtime license key is stored into the compiled assembly (the one that contains the license.licx) as embedded resource.

When the PowerToys is used in run-time the licensing code first tries to find the embedded runtime license key. Because from the PowerToys assembly it is not possible to get the assembly that references PowerToys, it is usually needed to check resources in multiple assemblies to find the one with embedded license key.

To prevent checking multiple assemblies, it is possible to manually specify the assembly that contains the embedded license key with setting the EmbeddedLicenseAssembly property.

Without setting the EmbeddedLicenseAssembly property, the licensing code will still find the embedded license key but this process will take a little bit longer.

IMPORTANT:
The EmbeddedLicenseAssembly must be set before the constructor of the PowerToys is called!
It is recommended that the EmbeddedLicenseAssembly is set in the constructor of the class that is using PowerToys and before call to InitializeComponent method.

Example

The following code shows how to set the EmbeddedLicenseAssembly in the constructor of the class that is using WmfDrawing or WmfViewbox in XAML.

C#
public class MyClass()    
{
    public MyClass()
    {
        Ab3d.Licensing.PowerToys.LicenseHelper.EmbeddedLicenseAssembly = typeof(MyClass).Assembly;

        InitializeComponent();
    }
}
See Also