Bewerken

Share via


ObfuscationAttribute.ApplyToMembers Property

Definition

Gets or sets a Boolean value indicating whether the attribute of a type is to apply to the members of the type.

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

Property Value

true if the attribute is to apply to the members of the type; otherwise, false. The default is true.

Examples

The following code example shows a type that is excluded from obfuscation, but the exclusion does not apply to its members because the ApplyToMembers property is false.

This code is part of a larger example that can be compiled and executed. See the ObfuscationAttribute class.

[ObfuscationAttribute(Exclude=true, ApplyToMembers=false)]
public class Type2
{
<ObfuscationAttribute(Exclude:=True, ApplyToMembers:=False)> _
Public Class Type2

Remarks

The value of this property is ignored when the attribute is applied to a member.

Important

Applying this attribute does not automatically obfuscate the code entity to which you apply it. Applying the attribute is an alternative to creating a configuration file for the obfuscation tool. That is, it merely provides instructions for an obfuscation tool. Microsoft recommends that vendors of obfuscation tools follow the semantics described here. However, there is no guarantee that a particular tool follows Microsoft recommendations.

Applies to