LicenseProviderAttribute クラス
アセンブリ: System (system.dll 内)

<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple:=False, Inherited:=False)> _ Public NotInheritable Class LicenseProviderAttribute Inherits Attribute
[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

ライセンスを受けるコンポーネントを作成する場合は、LicenseProviderAttribute でコンポーネントをマークすることによって、LicenseProvider を指定する必要があります。
LicenseProvider の Type を取得するには、LicenseProvider プロパティを使用します。
属性の詳細については、「属性の概要」と「属性を使用したメタデータの拡張」を参照してください。ライセンスの詳細については、「方法 : コンポーネントおよびコントロールのライセンス処理を行う」を参照してください。
![]() |
---|
このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、SharedState です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。 |

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.Attribute
System.ComponentModel.LicenseProviderAttribute


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


LicenseProviderAttribute コンストラクタ ()
アセンブリ: System (system.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


LicenseProviderAttribute コンストラクタ (Type)
アセンブリ: System (system.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


LicenseProviderAttribute コンストラクタ (String)
アセンブリ: System (system.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


LicenseProviderAttribute コンストラクタ

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

LicenseProviderAttribute フィールド
LicenseProviderAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | LicenseProvider | 関連付けられているクラスと一緒に使用する必要があるライセンス プロバイダを取得します。 |
![]() | TypeId | オーバーライドされます。 この属性型の一意の ID を示します。 |

LicenseProviderAttribute メソッド

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

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

LicenseProviderAttribute メンバ
クラスと一緒に使用する LicenseProvider を指定します。このクラスは継承できません。
LicenseProviderAttribute データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | LicenseProvider | 関連付けられているクラスと一緒に使用する必要があるライセンス プロバイダを取得します。 |
![]() | TypeId | オーバーライドされます。 この属性型の一意の ID を示します。 |

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

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- LicenseProviderAttributeのページへのリンク