LicenseProvider.GetLicense(LicenseContext, Type, Object, Boolean) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
En cas de substitution dans une classe dérivée, obtient une licence pour une instance ou un type de composant, lorsqu’un contexte est donné et si le refus d’une licence lève une 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);
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
Paramètres
- context
- LicenseContext
Qui LicenseContext spécifie où vous pouvez utiliser l’objet sous licence.
- instance
- Object
Objet qui demande la licence.
- allowExceptions
- Boolean
true si un LicenseException doit être levée lorsque le composant ne peut pas recevoir de licence ; sinon, false.
Retours
Valide License.
Notes pour les responsables de l’implémentation
Lorsque vous héritez de LicenseProvider, vous devez remplacer GetLicense(LicenseContext, Type, Object, Boolean) pour implémenter une méthode de validation pour la clé de licence.