ResourceConsumptionAttribute クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<AttributeUsageAttribute(AttributeTargets.Constructor Or AttributeTargets.Method Or AttributeTargets.Property, Inherited:=False)> _ <ConditionalAttribute("RESOURCE_ANNOTATION_WORK")> _ Public NotInheritable Class ResourceConsumptionAttribute Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property, Inherited=false)] [ConditionalAttribute("RESOURCE_ANNOTATION_WORK")] public sealed class ResourceConsumptionAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Constructor|AttributeTargets::Method|AttributeTargets::Property, Inherited=false)] [ConditionalAttribute(L"RESOURCE_ANNOTATION_WORK")] public ref class ResourceConsumptionAttribute sealed : public Attribute

ResourceConsumptionAttribute 属性をメンバに適用している場合は、ResourceExposureAttribute 属性も適用する必要があります。
リソースが消費されているスコープが、リソースが公開されているスコープと異なる場合は、consumptionScope パラメータを受け取るコンストラクタを使用して、公開されているスコープを指定する必要があります。たとえば、リソースが Machine リソースとして公開されていても、実際には Process と Assembly のスコープだけで使用されている場合があります。この例の場合、consumptionScope パラメータを Process | Assembly に設定します。
コンストラクタの resourceScope パラメータでは、呼び出されるすべてのメンバのリソース公開範囲以上の ResourceScope を指定する必要があります。たとえば、2 つの Process リソースと 1 つの Machine リソースを消費するメソッドは、resourceScope を Machine | Process に設定することによって、Machine リソースと Process リソースを消費するものとして指定します。
Public メンバは Assembly リソースや Private リソースを公開できません。また、Assembly メンバは Private リソースを公開できません。
リソース スコープが None の ResourceExposureAttribute 属性をメソッドに適用すると、メソッドのグラフは終了します。

System.Attribute
System.Runtime.Versioning.ResourceConsumptionAttribute


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- ResourceConsumptionAttribute クラスのページへのリンク