ObfuscationAttribute.Exclude プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As ObfuscationAttribute Dim value As Boolean value = instance.Exclude instance.Exclude = value
/** @property */ public boolean get_Exclude () /** @property */ public void set_Exclude (boolean value)
この属性を適用する型やメンバを隠ぺいから除外する必要がある場合は true。それ以外の場合は false。既定値は true です。

![]() |
---|
この属性を適用しても、属性を適用するコード エンティティの隠ぺいが自動的に行われるわけではありません。この属性の適用は、隠ぺいツールの構成ファイルを作成する代わりとして行われます。つまり、隠ぺいツールに対する指示を出すだけです。Microsoft では、隠ぺいツールの販売元が次に説明するセマンティクスに従うことを推奨しています。ただし、特定のツールが Microsoft の推奨するセマンティクスに従っているという保証はありません。 |

隠ぺいから除外されるようにマークが付けられている型のコード例を次に示します。Exclude プロパティは既定で true に設定されるため、特に指定する必要はありませんが、明示的に指定すると意図が明確になります。ApplyToMembers が false に指定されているため、隠ぺいからの除外はクラスのメンバに適用されません。つまり、クラス名は表示されますが、メンバは隠ぺいされます。
MethodA メソッドは、Feature プロパティの値 "default" でマークされています。Exclude プロパティの既定値が true であるため、Exclude プロパティに false を指定して、MethodA が隠ぺいから除外されないようにする必要があります。StripAfterObfuscation プロパティが false であるため、隠ぺいツールは隠ぺい後に属性を削除しません。
このコードは、コンパイルして実行することのできる例の一部です。詳細については、ObfuscationAttribute クラスのトピックを参照してください。
<ObfuscationAttribute(Exclude:=True, ApplyToMembers:=False)> _ Public Class Type2 ' The exclusion of the type is not applied to its members, ' however in order to mark the member with the "default" ' feature it is necessary to specify Exclude:=False, ' because the default value of Exclude is True. The tool ' should not strip this attribute after obfuscation. <ObfuscationAttribute(Exclude:=False, _ Feature:="default", StripAfterObfuscation:=False)> _ Public Sub MethodA() End Sub ' This member is marked for obfuscation, because the ' exclusion of the type is not applied to its members. Public Sub MethodB() End Sub End Class
[ObfuscationAttribute(Exclude=true, ApplyToMembers=false)] public class Type2 { // The exclusion of the type is not applied to its members, // however in order to mark the member with the "default" // feature it is necessary to specify Exclude=false, // because the default value of Exclude is true. The tool // should not strip this attribute after obfuscation. [ObfuscationAttribute(Exclude=false, Feature="default", StripAfterObfuscation=false)] public void MethodA() {} // This member is marked for obfuscation, because the // exclusion of the type is not applied to its members. public void MethodB() {} }

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


- ObfuscationAttribute.Exclude プロパティのページへのリンク