Confuser.Core/Marker.cs
/// <summary>
///     Applies the rules to the target definition.
/// </summary>
/// <param name="context">The working context.</param>
/// <param name="target">The target definition.</param>
/// <param name="rules">The rules.</param>
/// <param name="baseSettings">The base settings.</param>
// Token: 0x06000196 RID: 406 RVA: 0x0000D45C File Offset: 0x0000B65C
Applies the rules to the target definition.
Applies the rules to the target definition .
protected void ApplyRules(ConfuserContext context, IDnlibDef target, Dictionary<Rule, PatternExpression> rules, ProtectionSettings baseSettings = null)
		{
			ProtectionSettings ret = (baseSettings == null) ? new ProtectionSettings() : new ProtectionSettings(baseSettings);
			foreach (KeyValuePair<Rule, PatternExpression> i in rules)
			{
				if ((bool)i.Value.Evaluate(target))
				{
					if (!i.Key.Inherit)
					{
						ret.Clear();
					}
					this.FillPreset(i.Key.Preset, ret);
					foreach (SettingItem<Protection> prot in i.Key)
					{
						if (prot.Action == SettingItemAction.Add)
						{
							ret[this.protections[prot.Id]] = new Dictionary<string, string>(prot, StringComparer.OrdinalIgnoreCase);
						}
						else
						{
							ret.Remove(this.protections[prot.Id]);
						}
					}
				}
			}
			ProtectionParameters.SetParameters(context, target, ret);
		}
protected void ApplyRules ( ConfuserContext context , IDnlibDef target , Dictionary < Rule , PatternExpression > rules , ProtectionSettings baseSettings = null ) { ProtectionSettings ret = ( baseSettings == null ) ? new ProtectionSettings ( ) : new ProtectionSettings ( baseSettings ) ; foreach ( KeyValuePair < Rule , PatternExpression > i in rules ) { if ( ( bool ) i . Value . Evaluate ( target ) ) { if ( ! i . Key . Inherit ) { ret . Clear ( ) ; } this . FillPreset ( i . Key . Preset , ret ) ; foreach ( SettingItem < Protection > prot in i . Key ) { if ( prot . Action == SettingItemAction . Add ) { ret [ this . protections [ prot . Id ] ] = new Dictionary < string , string > ( prot , StringComparer . OrdinalIgnoreCase ) ; } else { ret . Remove ( this . protections [ prot . Id ] ) ; } } } } ProtectionParameters . SetParameters ( context , target , ret ) ; }
Applies the rules to the target definition.
Applies the rules to the target definition .
context
ConfuserContext
The working context.
The working context .
target
IDnlibDef
The target definition.
The target definition .
rules
Dictionary<Rule, PatternExpression>
None
baseSettings
ProtectionSettings
The base settings.
The base settings .