Share via


LicFileLicenseProvider.GetLicense Yöntem

Tanım

Varsa, bileşenin örneği için bir lisans döndürür.

public:
 override System::ComponentModel::License ^ GetLicense(System::ComponentModel::LicenseContext ^ context, Type ^ type, System::Object ^ instance, bool allowExceptions);
public override System.ComponentModel.License GetLicense (System.ComponentModel.LicenseContext context, Type type, object instance, bool allowExceptions);
public override System.ComponentModel.License? GetLicense (System.ComponentModel.LicenseContext context, Type type, object? instance, bool allowExceptions);
override this.GetLicense : System.ComponentModel.LicenseContext * Type * obj * bool -> System.ComponentModel.License
Public Overrides Function GetLicense (context As LicenseContext, type As Type, instance As Object, allowExceptions As Boolean) As License

Parametreler

context
LicenseContext

LicenseContext Lisanslı nesneyi nerede kullanabileceğinizi belirten bir.

type
Type

Type öğesini isteyen bileşeni temsil eden bir License.

instance
Object

öğesini isteyen Licensebir nesne.

allowExceptions
Boolean

true bir LicenseException bileşene lisans verilemediğinde a oluşturulmalıdır; aksi takdirde , false.

Döndürülenler

Geçerli Licensebir . Bu yöntem geçerli veya geçerli Licensecontext bir parametre bulamazsa döndürür null.

Açıklamalar

Tasarım zamanında yöntemi, GetLicense oluşturulacak bileşenin bulunduğu myClassNameFullName adlı myClassName.LICbir lisans dosyasını arar. Bu dosya, bileşeni içeren .dll dosyasıyla aynı dizinde olmalıdır.

Daha sonra bu yöntem, lisans dosyasının ilk satırını yönteminde belirtilen bir anahtarla karşılaştırarak IsKeyValid denetler. Anahtar geçerliyse, bu satır olarak LicenseKeykullanılır.

Şunlara uygulanır

Ayrıca bkz.