LicenseManager クラスとは? わかりやすく解説

LicenseManager クラス

コンポーネントライセンス与え、LicenseProvider を管理するためのプロパティメソッド提供します。このクラス継承できません。

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

Public NotInheritable Class
 LicenseManager
Dim instance As LicenseManager
public sealed class LicenseManager
public ref class LicenseManager sealed
public final class LicenseManager
public final class LicenseManager
解説解説

LicenseManager クラスでは、static プロパティ (CurrentContext と UsageMode) が提供されます。また、このクラスでは、static メソッド (CreateWithContext、IsValid、および Validate) も提供されます。

ライセンス与え対象となるコンポーネント作成する場合は、次の処理を行う必要があります

  1. LicenseProviderAttribute を使用してコンポーネントマークすることによって、LicenseProvider指定します

  2. コンポーネントコンストラクタValidate または IsValid呼び出します。有効なライセンスがないのにインスタンス作成しようとすると、Validate は LicenseException をスローます。IsValid例外スローしません。

  3. コンポーネント破棄または終了するときに、与えられているすべてのライセンスに対して Dispose呼び出します。

ライセンス詳細については、「方法 : コンポーネントおよびコントロールライセンス処理を行う」を参照してください

メモメモ

このクラス適用される HostProtectionAttribute 属性Resources プロパティの値は、ExternalProcessMgmt です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的にはアイコンダブルクリックコマンド入力、またはブラウザURL入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラストピックまたは「SQL Server プログラミングホスト保護属性」を参照してください

使用例使用例

Validate メソッド使用して複数ライセンス コントロール作成するコード例次に示します。このコード例では、LicFileLicenseProvider クラス実装される LicenseProvider使用されます。

Imports System
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 Not (license Is
 Nothing) Then
                license.Dispose()
                license = Nothing
            End If
        End If

    End Sub    
    
End Class

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;
         }
      }
   }
 
}
// 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;
      }
   }
};
import System.*;
import System.ComponentModel.*;
import System.Windows.Forms.*;


// Adds the LicenseProviderAttribute to the control.
/** @attribute LicenseProvider(LicFileLicenseProvider.class)
 */
public class MyControl extends Control
{
    // Creates a new, null license.
    private License license = null;

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

        // Insert code to perform other instance creation tasks here.
    } 
    
    protected void Dispose(boolean disposing)
    {
        if (disposing) {
            if (license != null) {
                license.Dispose();
                license = null;
            }
        }
    } 
} 
継承階層継承階層
System.Object
  System.ComponentModel.LicenseManager
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
LicenseManager メンバ
System.ComponentModel 名前空間
License クラス
LicenseContext クラス
LicenseException クラス
LicenseProvider
LicenseProviderAttribute
LicFileLicenseProvider
LicenseUsageMode



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「LicenseManager クラス」の関連用語

LicenseManager クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



LicenseManager クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS