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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > 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



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

辞書ショートカット

すべての辞書の索引

「LicenseProviderAttribute クラス」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS