/// <summary> /// Initializes a new instance of the <see cref="RequestFilterRule"/> class. /// </summary> /// <param name="serverVariable"></param> /// <param name="values"></param> /// <param name="op"></param> /// <param name="action"></param> /// <param name="location"></param> public RequestFilterRule(string serverVariable, string values, RequestFilterOperatorType op, RequestFilterRuleType action, string location) { this._ServerVariable = serverVariable; this.SetValues(values, op); this._Operator = op; this._Action = action; this._Location = location; }
/// <summary> /// Initializes a new instance of the RequestFilterRule class. /// </summary> /// <param name="serverVariable"></param> /// <param name="values"></param> /// <param name="op"></param> /// <param name="action"></param> /// <param name="location"></param> public RequestFilterRule(string serverVariable, string values, RequestFilterOperatorType op, RequestFilterRuleType action, string location) { _ServerVariable = serverVariable; SetValues(values, op); _Operator = op; _Action = action; _Location = location; }
public void SetValues(string values, RequestFilterOperatorType op) { this._Values.Clear(); if (op != RequestFilterOperatorType.Regex) { string[] vals = values.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); foreach (string value in vals) { this._Values.Add(value.ToUpperInvariant()); } } else { this._Values.Add(values); } }
public void SetValues(string values, RequestFilterOperatorType op) { _Values.Clear(); if ((op != RequestFilterOperatorType.Regex)) { string[] vals = values.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries); foreach (string value in vals) { _Values.Add(value.ToUpperInvariant()); } } else { _Values.Add(values); } }