Error processing SSI file
LEADTOOLS (Leadtools assembly)

Show in webframe

SetLicenseAsync Method








IRandomAccessStreamContaining the LEADTOOLS runtime license to load.
Character string containing the developer key.
Sets the runtime license for LEADTOOLS and unlocks support for optional features such as LEADTOOLS Imaging Pro, Document and Medical capabilities, or PDF support. After you have obtained a runtime license and a developer key, you can call Leadtools.RasterSupport.SetLicenseAsync in your application to disable the nag message.
Syntax
public static IAsyncAction SetLicenseAsync( 
   IRandomAccessStream licenseStream,
   string developerKey
)
'Declaration
 
Public Shared Function SetLicenseAsync( _
   ByVal licenseStream As IRandomAccessStream, _
   ByVal developerKey As String _
) As IAsyncAction
'Usage
 
Dim licenseStream As IRandomAccessStream
Dim developerKey As String
Dim value As IAsyncAction
 
value = RasterSupport.SetLicenseAsync(licenseStream, developerKey)
public static IAsyncAction SetLicenseAsync( 
   IRandomAccessStream licenseStream,
   string developerKey
)
 function Leadtools.RasterSupport.SetLicenseAsync( 
   licenseStream ,
   developerKey 
)
public:
static IAsyncAction^ SetLicenseAsync( 
   IRandomAccessStream^ licenseStream,
   String^ developerKey
) 

Parameters

licenseStream
IRandomAccessStreamContaining the LEADTOOLS runtime license to load.
developerKey
Character string containing the developer key.

Return Value

The asynchronous save operation object.
Remarks

You must use this function to set the runtime license for LEADTOOLS and to unlock support for any optional features that you have licensed. If you do not set a RELEASE runtime license, your application will display a "nag" message dialog at runtime, indicating that you have developed the application without a valid runtime license.

In order to obtain a runtime license and developer key, you must contact LEAD. For more information, refer to About LEADTOOLS Runtime Licenses.

For information about LEADTOOLS Document/Medical capabilities, contact LEAD.

To determine if support for optional features has been unlocked, use IsLocked

Example

This example will set a runtime license and check for Document support. You must obtain the proper license and developer key from LEAD.

Copy Code  
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;

public void SetLicenseAsyncExample()
{
   IStorageFolder packageLocation = Windows.ApplicationModel.Package.Current.InstalledLocation;
   var licStorageFile = packageLocation.GetFileAsync(@"Assets\" + MY_LICENSE_FILE2);
   licStorageFile.Completed = delegate(IAsyncOperation<StorageFile> storageFileOperation, AsyncStatus storageFileStatus)
   {
      if (storageFileStatus == AsyncStatus.Completed)
      {
         var licRAS = storageFileOperation.GetResults().OpenAsync(FileAccessMode.Read);
         licRAS.Completed = delegate(IAsyncOperation<IRandomAccessStream> licRASOperation, AsyncStatus licRASStatus)
         {
            if (licRASStatus == AsyncStatus.Completed)
            {
               var setLicense = RasterSupport.SetLicenseAsync(licRASOperation.GetResults(), MY_DEVELOPER_KEY2);
               setLicense.Completed = delegate(IAsyncAction setLicenseAction, AsyncStatus setLicenseStatus)
               {
                  if (setLicenseStatus == AsyncStatus.Completed)
                  {
                     bool isLocked = RasterSupport.IsLocked(RasterSupportType.Document);
                     if (isLocked)
                        Debug.WriteLine("Document support is locked");
                     else
                        Debug.WriteLine("Document support is unlocked");
                     Assert.IsTrue(!isLocked);
                  }
                  else
                  {
                     RasterException rasterEx = RasterException.FromHResult(setLicenseAction.ErrorCode.HResult);
                     string message = setLicenseAction.ErrorCode.Message;
                     if (rasterEx != null)
                        message = rasterEx.Message;
                     Debug.WriteLine(message);
                     Assert.IsTrue(false);
                  }
               };
            }
            else
            {
               Debug.WriteLine(licRASOperation.ErrorCode.Message);
               Assert.IsTrue(false);
            }
         };
      }
      else
      {
         Debug.WriteLine(storageFileOperation.ErrorCode.Message);
         Assert.IsTrue(false);
      }
   };
}
Requirements

Target Platforms

See Also

Reference

RasterSupport Class
RasterSupport Members
Setting a Runtime License
Activating Server Licenses
SetLicense(byte[] licenseBuffer, string developerKey)
SetLicense(IRandomAccessStream licenseStream, String developerKey)
SetLicense(Stream licenseFile, string developerKey)
SetLicense(string licenseFile, string developerKey)

Error processing SSI file