For developers using our Silverlight binaries and having difficulty understanding how to use the RasterSupport.SetLicense() method, here is a step-by-step guide on how you can modify our SDK demos to include your licensing information:
1.) In the Solution Explorer, create a folder called "Resources".
2.) Right click on the new "Resources" folder. Select the option for adding an existing item. Select your LIC file
3.) Highlight the new LIC file that's been added to the solution explore. Right-click on it, and bring up the property page. Change the Build action to be "Resource".
4.) In the code, change the value passed to the "GetPackResourceUri()" method to point to your file name. It should be something like GetPackResourceUri("Resources/Your_File_Name_Here.lic")
5.) Modify the "developerKey" variable to include the contents of the key file.
6.) Compile and run the project.
Please note that if the StreamResourceInfo instance is null, accessing the Stream property will cause the demo to hang. Checking the StreamResourceInfo instance itself though will not be a problem. Here is sample code illustrating how I updated the demo to run:
public static void SetLicense()
{
// Uncomment this and add your developer key and license resource file stream
System.Windows.Resources.StreamResourceInfo licenseInfo = Application.GetResourceStream(GetPackResourceUri("Resources/MyFile.lic"));
string developerKey = "==CONTENTS_OF_KEY_FILE==";
if (licenseInfo != null)
RasterSupport.SetLicense(licenseInfo.Stream, developerKey);
else
MessageBox.Show("Cannot set license file. Stream is not valid.", "Error setting license file", MessageBoxButton.OK);
}
If you have any questions or issues with this, please send an email to
support@leadtools.com.
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.