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);
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 사용이 허가된 개체를 사용할 수 있는 위치를 지정하는 A입니다.

type
Type

를 요청하는 Type구성 요소를 나타내는 A License 입니다.

instance
Object

를 요청하는 개체입니다 License.

allowExceptions
Boolean

구성 요소에 라이선스를 부여할 수 없을 때 throw되어야 하면 .

반품

유효한 입니다 License. 이 메서드가 유효한 매개 변수 또는 유효한 Licensecontext 매개 변수를 찾을 수 없으면 반환됩니다 null.

설명

디자인 타임에 메서드는 GetLicense 만들 구성 요소의 위치 myClassName.LICmyClassName 인 명명된 FullName라이선스 파일을 찾습니다. 이 파일은 구성 요소가 포함된 .dll 파일과 동일한 디렉터리에 있어야 합니다.

다음으로, 이 메서드는 메서드에 지정된 IsKeyValid 키에 대해 라이선스 파일의 첫 번째 줄을 확인합니다. 키가 유효한 경우 이 줄은 .로 LicenseKey사용됩니다.

적용 대상

추가 정보