obfuz/com.code-philosophy.obfuz/Runtime/ObfuzIgnoreAttribute.cs

44 lines
1.1 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz
{
2025-05-21 16:50:56 +08:00
[Flags]
2025-05-21 13:33:03 +08:00
public enum ObfuzScope
{
None = 0x0,
TypeName = 0x1,
2025-05-21 13:33:03 +08:00
Field = 0x2,
MethodName = 0x4,
MethodParameter = 0x8,
MethodBody = 0x10,
Method = MethodName | MethodParameter | MethodBody,
2025-05-26 19:22:55 +08:00
PropertyName = 0x20,
PropertyGetterSetterName = 0x40,
Property = PropertyName | PropertyGetterSetterName,
2025-05-21 13:33:03 +08:00
EventName = 0x100,
2025-05-26 19:22:55 +08:00
EventAddRemoveFireName = 0x200,
Event = EventName | PropertyGetterSetterName,
Module = 0x1000,
All = TypeName | Field | Method | Property | Event,
2025-05-21 13:33:03 +08:00
}
[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = false)]
public class ObfuzIgnoreAttribute : Attribute
{
2025-05-21 13:33:03 +08:00
public ObfuzScope Scope { get; set; }
public bool ApplyToMembers { get; set; } = true;
2025-05-26 19:22:55 +08:00
public bool ApplyToNestedTypes { get; set; } = true;
2025-05-21 13:33:03 +08:00
public ObfuzIgnoreAttribute(ObfuzScope scope = ObfuzScope.All)
{
this.Scope = scope;
}
}
}