LicFileLicenseProvider 클래스

정의

LicenseProvider를 구현합니다. 이 공급자는 Microsoft .NET Framework의 표준 라이선스 모델과 유사한 방식으로 작동합니다.

public ref class LicFileLicenseProvider : System::ComponentModel::LicenseProvider
public class LicFileLicenseProvider : System.ComponentModel.LicenseProvider
type LicFileLicenseProvider = class
    inherit LicenseProvider
Public Class LicFileLicenseProvider
Inherits LicenseProvider
상속
LicFileLicenseProvider

예제

다음 예제에서는 메서드를 사용하여 라이선스가 부여된 컨트롤을 Validate 만듭니다. 라이선스 관리자에 를 사용합니다 LicFileLicenseProvider .

// Adds the LicenseProviderAttribute to the control.

[LicenseProvider(LicFileLicenseProvider::typeid)]
public ref class MyControl: public Control
{
   // Creates a new, null license.
private:
   License^ license;

public:
   MyControl()
   {
      
      // Adds Validate to the control's constructor.
      license = LicenseManager::Validate( MyControl::typeid, this );

      // Insert code to perform other instance creation tasks here.
   }

public:
   ~MyControl()
   {
      if ( license != nullptr )
      {
         delete license;
         license = nullptr;
      }
   }
};
using System;
using System.ComponentModel;
using System.Windows.Forms;

// Adds the LicenseProviderAttribute to the control.
[LicenseProvider(typeof(LicFileLicenseProvider))]
public class MyControl : Control 
{
 
   // Creates a new, null license.
   private License license = null;
 
   public MyControl () 
   {
 
      // Adds Validate to the control's constructor.
      license = LicenseManager.Validate(typeof(MyControl), this);
 
      // Insert code to perform other instance creation tasks here.
   }
 
   protected override void Dispose(bool disposing) 
   {
      if(disposing)
      {
         if (license != null) 
         {
            license.Dispose();
            license = null;
         }
      }
   }
}
Imports System.ComponentModel
Imports System.Windows.Forms

' Adds the LicenseProviderAttribute to the control.
<LicenseProvider(GetType(LicFileLicenseProvider))> _
Public Class MyControl
    Inherits Control
    
    ' Creates a new, null license.
    Private license As License = Nothing    
    
    Public Sub New()        
    
        ' Adds Validate to the control's constructor.
        license = LicenseManager.Validate(GetType(MyControl), Me)

        ' Insert code to perform other instance creation tasks here.
        
    End Sub
    
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)

        If disposing Then
            If (license IsNot Nothing) Then
                license.Dispose()
                license = Nothing
            End If
        End If

    End Sub    
    
End Class

설명

LicFileLicenseProvider 제안 GetLicenseIsKeyValid 메서드입니다. 메서드는 IsKeyValid 메서드에서 검색한 GetLicenseLicenseKey 유효한지 여부를 결정합니다. 이 클래스에서 상속하는 경우 메서드를 재정의 IsKeyValid 하여 고유한 유효성 검사 논리를 제공할 수 있습니다.

이 클래스는 COM 라이선스와 유사한 라이선스 기능을 제공하기 위해 존재하며 텍스트 라이선스 파일을 사용합니다.

라이선스에 대한 자세한 내용은 방법: 라이선스 구성 요소 및 컨트롤을 참조하세요.

생성자

LicFileLicenseProvider()

LicFileLicenseProvider 클래스의 새 인스턴스를 초기화합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetKey(Type)

지정된 형식에 대한 키를 반환합니다.

GetLicense(LicenseContext, Type, Object, Boolean)

구성 요소의 인스턴스에 대한 라이선스를 사용할 수 있으면 해당 라이선스를 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
IsKeyValid(String, Type)

GetLicense(LicenseContext, Type, Object, Boolean) 메서드에서 검색한 키가 지정된 형식에 대해 유효한지 여부를 확인합니다.

MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보