- context
A System.ComponentModel.LicenseContext that specifies where you can use the licensed object.
- type
A Type that represents the component requesting the System.ComponentModel.License.
- instance
An object that requests the System.ComponentModel.License.
- allowExceptions
true if a System.ComponentModel.LicenseException should be thrown when a component cannot be granted a license; otherwise, false.
![]()
A valid System.ComponentModel.License. If this method cannot find a valid System.ComponentModel.License or a valid context parameter, it returns null.
At design time, the LicFileLicenseProvider.GetLicense(LicenseContext, Type, object, bool) method looks for a license file named myClassName.LIC, where myClassName is the Type.FullName of the component to create. This file must be in the same directory as the .dll file that contains the component.
Next, this method checks the first line of the license file against a key specified in the LicFileLicenseProvider.IsKeyValid(string, Type) method. If the key is valid, this line is used as the License.LicenseKey.