Appendix B. License Mechanism

Table of Contents

yFiles for Silverlight License Files
General Concept
Development vs. Distribution License Files
Pre-installed License File in Evaluation Distribution
Separate License Files for Purchased yFiles for Silverlight Packages
Including a License File
Developing with Visual Studio Designer
Programming Samples and Tutorials

This appendix covers the license mechanism of yFiles for Silverlight. It explains the basic steps to successfully include a valid license into a yFiles for Silverlight-based application.

yFiles for Silverlight License Files

General Concept

In order to run, a yFiles for Silverlight-based application needs a valid license file that contains encoded information on:

  • the authorized domains that the application can be served from
  • whether the application can be served from localhost
  • whether the application can be run out-of-browser
  • whether the application can be run from the file system

At application run time, the license file needs to be present top-level in the application's .xap container file. The file's format is XML based. The following example shows a (non-functional) development license file (for a Single Developer license):

Example B.1. What a license file looks like

<?xml version="1.0" encoding="UTF-8"?>
<license version="1.2">
  <product>yFiles for Silverlight</product>
  <type>singledeveloper</type>
  <developer><![CDATA[Joe Average]]></developer>
  <distribution>false</distribution>
  <version>2.4</version>
  <date>03/15/2010</date>
  <watermark>yFiles for Silverlight Development License</watermark>
  <domains>
    <domain>MyCompany.com</domain>
  </domains>
  <localhost>true</localhost>
  <oobAllowed>true</oobAllowed>
  <fileSystemAllowed>true</fileSystemAllowed>
  <key>90b9a98e11c9923878b2c6403ac60efc60fbacdc</key>
</license>

Development vs. Distribution License Files

There are two different kinds of yFiles for Silverlight license files that are strictly intended for one of two different situations:

  • During application development, the development license can be used. It allows unrestricted access and usage of the yFiles for Silverlight-based application under development. The application itself, however, will show a watermark to indicate the usage of the development license. The development license is contained in the following file: yWorks.yFilesSilverlight.DevelopmentLicense.xml
  • For final deployment, the distribution license must be used. The distribution license is contained in the following file: yWorks.yFilesSilverlight.License.xml

It is most important that for final deployment of a yFiles for Silverlight-based application, the development license file must not be included in the application's .xap container file. Instead, the distribution license file must be included.

Pre-installed License File in Evaluation Distribution

As part of the installation of the yFiles for Silverlight evaluation distribution, the dedicated installer executable that unpacks the programming samples and tutorials also installs a development license file that is valid for the evaluation period. This license file is located in the lib folder in the yFiles for Silverlight installation directory, for example: C:\Users\Me\My Files\yFiles for Silverlight 2.4\lib\yWorks.yFilesSilverlight.DevelopmentLicense.xml

All programming samples and tutorials use this physical location to reference the license file.

Separate License Files for Purchased yFiles for Silverlight Packages

In non-evaluation distributions of yFiles for Silverlight, there is no license file installed. Still, the programming samples and tutorials use the same physical location in the yFiles for Silverlight installation directory to reference the license file.

Thus, to start developing, the development license file that comes in addition to a licensed yFiles for Silverlight package needs to be copied to this location and all projects are set up.

Including a License File

When using Visual Studio (or Visual Web Developer) for software development, having the license file properly included in the final yFiles for Silverlight-based application, can be easily achieved by simply adding it as a top-level item to the application's project in Solution Explorer. Note that you can also add a link to the license file instead of the file itself.

By default, the IDE uses the following file properties values for the added license file:

Table B.1. License file properties

Property Value
Build Action Content
Copy to Output Directory Do not copy

With these values set, the license file can be properly accessed by the built application.

Developing with Visual Studio Designer

At design time, i.e., when using the Visual Studio Designer, the license file also needs to be present in the directory of any XAML files that use yFiles for Silverlight components.

Programming Samples and Tutorials

The projects of the programming samples and of the tutorial steps already have a link to a license file (which references the license file in the lib folder in the yFiles for Silverlight installation directory, see above: Pre-installed License File in Evaluation Distribution).