LicenseProvider.GetLicense(LicenseContext, Type, Object, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
When overridden in a derived class, gets a license for an instance or type of component, when given a context and whether the denial of a license throws an exception.
public:
abstract System::ComponentModel::License ^ GetLicense(System::ComponentModel::LicenseContext ^ context, Type ^ type, System::Object ^ instance, bool allowExceptions);
public abstract System.ComponentModel.License GetLicense (System.ComponentModel.LicenseContext context, Type type, object instance, bool allowExceptions);
public abstract System.ComponentModel.License? GetLicense (System.ComponentModel.LicenseContext context, Type type, object? instance, bool allowExceptions);
abstract member GetLicense : System.ComponentModel.LicenseContext * Type * obj * bool -> System.ComponentModel.License
Public MustOverride Function GetLicense (context As LicenseContext, type As Type, instance As Object, allowExceptions As Boolean) As License
Parameters
- context
- LicenseContext
A LicenseContext that specifies where you can use the licensed object.
- instance
- Object
An object that is requesting the license.
- allowExceptions
- Boolean
true
if a LicenseException should be thrown when the component cannot be granted a license; otherwise, false
.
Returns
A valid License.
Notes to Implementers
When you inherit from LicenseProvider, you must override GetLicense(LicenseContext, Type, Object, Boolean) to implement a validation method for the license key.
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om