NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

LicenseProvider.GetLicense

When overridden in a derived class, gets a license for an instance or type of component.

[Visual Basic]
MustOverride Public Function GetLicense( _
   ByVal context As LicenseContext, _
   ByVal type As Type, _
   ByVal instance As Object, _
   ByVal allowExceptions As Boolean _
) As License
[C#]
public abstract License GetLicense(
   LicenseContext context,
   Type type,
   object instance,
   bool allowExceptions
);
[C++]
public: virtual License* GetLicense(
   LicenseContext* context,
   Type* type,
   Object* instance,
   bool allowExceptions
) = 0;
[JScript]
public abstract function GetLicense(
   context : LicenseContext,
   type : Type,
   instance : Object,
   allowExceptions : Boolean
) : License;

Parameters

context
A LicenseContext that specifies where the licensed object can be used.
type
A Type that represents the component requesting the license.
instance
An object that is requesting the license.
allowExceptions
true if System.ComponentModel.LicenseExceptions should be thrown when a component cannot be granted a license; otherwise, false.

Return Value

A valid License.

Remarks

Notes to Inheritors: The object asking for a License must Dispose the License when the object is disposed or finalized.

When you inherit from LicenseProvider, you must override GetLicense to implement a validation method for the license key.

See Also

LicenseProvider Class | LicenseProvider Members | System.ComponentModel Namespace | System.License.Dispose | License | LicenseContext | LicenseException | LicenseManager | LicenseProvider | LicenseProviderAttribute | LicFileLicenseProvider | LicenseUsageMode