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

注釈

オファー LicFileLicenseProviderGetLicenseIsKeyValid メソッド。 メソッドはIsKeyValid、 メソッドによって取得された がLicenseKeyGetLicense有効かどうかを判断します。 このクラスから継承する場合は、 メソッドをオーバーライドして独自の IsKeyValid 検証ロジックを提供できます。

このクラスは、COM ライセンスと同様のライセンス機能を提供するために存在し、テキスト ライセンス ファイルを使用します。

ライセンスの詳細については、「 How to: License Components and Controls」を参照してください。

コンストラクター

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)

適用対象

こちらもご覧ください