LicenseProviderAttributeとは? わかりやすく解説

LicenseProviderAttribute クラス

クラス一緒に使用する LicenseProvider を指定します。このクラス継承できません。

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

<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple:=False, Inherited:=False)>
 _
Public NotInheritable Class
 LicenseProviderAttribute
    Inherits Attribute
Dim instance As LicenseProviderAttribute
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=false,
 Inherited=false)] 
public sealed class LicenseProviderAttribute
 : Attribute
[AttributeUsageAttribute(AttributeTargets::Class, AllowMultiple=false,
 Inherited=false)] 
public ref class LicenseProviderAttribute sealed
 : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=false,
 Inherited=false) */ 
public final class LicenseProviderAttribute
 extends Attribute
AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=false,
 Inherited=false) 
public final class LicenseProviderAttribute
 extends Attribute
解説解説
使用例使用例

LicFileLicenseProvider を MyControlライセンス プロバイダとして使用するコード例次に示します

<LicenseProvider(GetType(LicFileLicenseProvider))> _
Public Class MyControl
    Inherits Control
    
    ' Insert code here.
    Protected Overrides Sub
 Dispose(ByVal disposing As Boolean)
        ' All components must dispose of the licenses they grant.
        ' Insert code here to dispose of the license.
    End Sub        

End Class
[LicenseProvider(typeof(LicFileLicenseProvider))]
 public class MyControl : Control {
 
    // Insert code here.
 
    protected override void Dispose(bool
 disposing) {
       /* All components must dispose of the licenses they grant. 
        * Insert code here to dispose of the license. */
    }
 }
[LicenseProvider(LicFileLicenseProvider::typeid)]
ref class MyControl: public Control
{
protected:

   // Insert code here.
   ~MyControl()
   {
      /* All components must dispose of the licenses they grant. 
               * Insert code here to dispose of the license. */
   }
};
/** @attribute LicenseProvider(LicFileLicenseProvider.class)
 */
public class MyControl extends Control
{
    // Insert code here.
    protected void Dispose(boolean disposing)
    {
        /* All components must dispose of the licenses they grant.
           Insert code here to dispose of the license.
         */
    } //Dispose
} //MyControl
public LicenseProvider(LicFileLicenseProvider)
class MyControl extends Control{
    
    // Insert code here.
    function Dispose(){
        // All components must dispose of the licenses they grant.
        // Insert code here to dispose of the license.
    } //Dispose 
} //MyControl

MyControl クラスインスタンス作成するコード例次に示します。そのクラス属性取得しmyNewControl使用するライセンス プロバイダの名前を出力します

Public Shared Function Main()
 As Integer
    ' Creates a new component.
    Dim myNewControl As New
 MyControl()
    
    ' Gets the attributes for the component.
    Dim attributes As AttributeCollection =
 TypeDescriptor.GetAttributes(myNewControl)
    
    ' Prints the name of the license provider by retrieving the LicenseProviderAttribute
 
    ' from the AttributeCollection. 
    Dim myAttribute As LicenseProviderAttribute
 = _
        CType(attributes(GetType(LicenseProviderAttribute)), LicenseProviderAttribute)
        
    Console.WriteLine(("The license provider for this class is:
 " & _
        myAttribute.LicenseProvider.ToString()))
    Return 0
End Function
public static int Main()
 {
    // Creates a new component.
    MyControl myNewControl = new MyControl();
 
    // Gets the attributes for the component.
    AttributeCollection attributes = TypeDescriptor.GetAttributes(myNewControl);
 
    /* Prints the name of the license provider by retrieving the LicenseProviderAttribute
 
     * from the AttributeCollection. */
    LicenseProviderAttribute myAttribute = (LicenseProviderAttribute)attributes[typeof(LicenseProviderAttribute)];
    Console.WriteLine("The license provider for this
 class is: " + myAttribute.LicenseProvider.ToString());
 
    return 0;
 }
int main()
{
   // Creates a new component.
   MyControl^ myNewControl = gcnew MyControl;

   // Gets the attributes for the component.
   AttributeCollection^ attributes = TypeDescriptor::GetAttributes( myNewControl
 );

   /* Prints the name of the license provider by retrieving the LicenseProviderAttribute
 
        * from the AttributeCollection. */
   LicenseProviderAttribute^ myAttribute = dynamic_cast<LicenseProviderAttribute^>(attributes[
 LicenseProviderAttribute::typeid ]);
   Console::WriteLine( "The license provider for this
 class is: {0}", myAttribute->LicenseProvider );
   return 0;
}
public static void main(String[]
 args)
{
    // Creates a new component.
    Class1 lObjClass1 = new Class1();
    MyControl myNewControl = lObjClass1.new MyControl();

    // Gets the attributes for the component.
    AttributeCollection attributes =
        TypeDescriptor.GetAttributes(myNewControl);

    /* Prints the name of the license provider by 
       retrieving the LicenseProviderAttribute 
       from the AttributeCollection.
     */
    LicenseProviderAttribute myAttribute = ((LicenseProviderAttribute)
        (attributes.get_Item(LicenseProviderAttribute.class.ToType())));

    Console.WriteLine(("The license provider for this
 class is: "
        + myAttribute.get_LicenseProvider().ToString()));
} //main
// Creates a new component.
var myNewControl : MyControl = new MyControl()

// Gets the attributes for the component.
var attributes : AttributeCollection = TypeDescriptor.GetAttributes(myNewControl)

// Prints the name of the license provider by retrieving the LicenseProviderAttribute
 
// from the AttributeCollection. 
var myAttribute : LicenseProviderAttribute = LicenseProviderAttribute(attributes(LicenseProviderAttribute))
Console.WriteLine("The license provider for this
 class is: " + myAttribute.LicenseProvider.ToString())

継承階層継承階層
System.Object
   System.Attribute
    System.ComponentModel.LicenseProviderAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
LicenseProviderAttribute メンバ
System.ComponentModel 名前空間
License クラス
LicenseContext クラス
LicenseException クラス
LicenseManager クラス
LicenseProvider クラス
LicFileLicenseProvider
LicenseUsageMode

LicenseProviderAttribute コンストラクタ ()


LicenseProviderAttribute コンストラクタ (Type)


LicenseProviderAttribute コンストラクタ (String)


LicenseProviderAttribute コンストラクタ

LicenseProviderAttribute クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
LicenseProviderAttribute () ライセンス プロバイダ指定せずに、LicenseProviderAttribute クラス新しインスタンス初期化します。
LicenseProviderAttribute (String) 型を指定してLicenseProviderAttribute クラス新しインスタンス初期化します。
LicenseProviderAttribute (Type) ライセンス プロバイダ種類指定してLicenseProviderAttribute クラス新しインスタンス初期化します。
参照参照

関連項目

LicenseProviderAttribute クラス
LicenseProviderAttribute メンバ
System.ComponentModel 名前空間

LicenseProviderAttribute フィールド


パブリック フィールドパブリック フィールド

参照参照

関連項目

LicenseProviderAttribute クラス
System.ComponentModel 名前空間
License クラス
LicenseContext クラス
LicenseException クラス
LicenseManager クラス
LicenseProvider クラス
LicFileLicenseProvider
LicenseUsageMode

LicenseProviderAttribute プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

LicenseProviderAttribute クラス
System.ComponentModel 名前空間
License クラス
LicenseContext クラス
LicenseException クラス
LicenseManager クラス
LicenseProvider クラス
LicFileLicenseProvider
LicenseUsageMode

LicenseProviderAttribute メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals オーバーロードされますオーバーライドされます。 このインスタンス指定したオブジェクト等しかどうか示します
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode オーバーライドされます対象インスタンスハッシュ コード返します
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 ( Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

LicenseProviderAttribute クラス
System.ComponentModel 名前空間
License クラス
LicenseContext クラス
LicenseException クラス
LicenseManager クラス
LicenseProvider クラス
LicFileLicenseProvider
LicenseUsageMode

LicenseProviderAttribute メンバ

クラス一緒に使用する LicenseProvider を指定します。このクラス継承できません。

LicenseProviderAttribute データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド LicenseProviderAttribute オーバーロードされます。 LicenseProviderAttribute クラス新しインスタンス初期化します。
パブリック フィールドパブリック フィールド
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals オーバーロードされますオーバーライドされます。 このインスタンス指定したオブジェクト等しかどうか示します
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode オーバーライドされます対象インスタンスハッシュ コード返します
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 (Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

LicenseProviderAttribute クラス
System.ComponentModel 名前空間
License クラス
LicenseContext クラス
LicenseException クラス
LicenseManager クラス
LicenseProvider クラス
LicFileLicenseProvider
LicenseUsageMode



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

辞書ショートカット

すべての辞書の索引

「LicenseProviderAttribute」の関連用語

LicenseProviderAttributeのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS