LicFileLicenseProvider.GetLicense メソッド

定義

コンポーネントのインスタンスのライセンス (使用可能な場合) を返します。

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

パラメーター

context
LicenseContext

ライセンスされたオブジェクトを使用できる場所を指定する LicenseContext

type
Type

Licenseを要求するコンポーネントを表すType

instance
Object

Licenseを要求するオブジェクト。

allowExceptions
Boolean

true コンポーネントにライセンスを付与できないときに LicenseException をスローする必要がある場合は a0/>。それ以外の場合は false

返品

有効な License。 このメソッドが有効な License または有効な context パラメーターを見つけることができない場合は、 nullを返します。

注釈

デザイン時に、 GetLicense メソッドは、 myClassName.LICという名前のライセンス ファイルを検索します。ここで、 myClassName は作成するコンポーネントの FullName です。 このファイルは、コンポーネントを含む .dll ファイルと同じディレクトリに存在する必要があります。

次に、このメソッドは、ライセンス ファイルの最初の行を、 IsKeyValid メソッドで指定されたキーと照合します。 キーが有効な場合、この行は LicenseKeyとして使用されます。

適用対象

こちらもご覧ください