ObfuscationAttribute.Exclude 속성

정의

난독 처리 도구가 형식 또는 멤버를 난독 처리 대상에서 제외할지 여부를 나타내는 Boolean 값을 가져오거나 설정합니다.

public:
 property bool Exclude { bool get(); void set(bool value); };
public bool Exclude { get; set; }
member this.Exclude : bool with get, set
Public Property Exclude As Boolean

속성 값

이 특성이 적용된 형식 또는 멤버를 난독 처리 대상에서 제외하면 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

예제

다음 코드 예제에서는 난독 처리에서 제외되도록 표시된 형식을 보여 줍니다. 기본값true은 이므로 속성을 지정할 Exclude 필요는 없지만 명시적으로 지정하면 의도가 명확해집니다. 는 ApplyToMembersfalse설정되므로 난독 처리 제외가 클래스의 멤버에 적용되지 않습니다. 즉, 클래스 이름이 표시되지만 멤버는 난독화됩니다.

메서드는 MethodA 속성 값 "default"Feature 으로 표시됩니다. 속성의 Exclude 기본값은 이므로 난독 처리에서 제외 MethodA 하지 않도록 하려면 속성에 Exclude 대 한 를 지정 false 해야 합니다true. 속성은 StripAfterObfuscationfalse 난독 처리 도구가 난독 처리 후 특성을 제거하지 않도록 합니다.

이 코드는 컴파일 및 실행할 수 있는 더 큰 예제의 일부입니다. 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 void MethodA() {}

    // This member is marked for obfuscation, because the
    // exclusion of the type is not applied to its members.
    public void MethodB() {}
}
<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

설명

중요

이 특성을 적용해도 해당 특성을 적용할 코드 엔터티가 자동으로 난독 처리되지는 않습니다. 특성을 적용하는 것은 난독 처리 도구에 대한 구성 파일을 만드는 대안입니다. 즉, 난독 처리 도구에 대한 지침만 제공합니다. Microsoft는 난독 처리 도구 공급업체가 여기에 설명된 의미 체계를 따르는 것이 좋습니다. 그러나 특정 도구가 Microsoft 권장 사항을 따른다는 보장은 없습니다.

적용 대상