Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuleEventArgs"/> class.
 /// </summary>
 /// <param name="rule">
 /// The rule that caused the event.
 /// </param>
 /// <param name="session">
 /// The session.
 /// </param>
 /// <param name="message">
 /// The message.
 /// </param>
 public RuleEventArgs(Rule rule, Session session, string message)
 {
     this.Rule = rule;
     this.Session = session;
     this.Message = message;
     this.Path = session.host + session.PathAndQuery;
     this.Referer = session.oRequest["Referer"] ?? "No Referer";
 }
Beispiel #2
0
        /// <summary>
        /// Add the specified rule.
        /// </summary>
        /// <param name="rule">The rule to add.</param>
        /// <param name="session">The current session.</param>
        /// <param name="message">The message.</param>
        public void AddRule(Rule rule, Session session, string message)
        {
            if (rule != null && !rule.LogEnabled)
            {
                return;
            }

            if (this.OnRuleLogged != null)
            {
                this.OnRuleLogged(session, new RuleEventArgs(rule, session, message));
            }
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuleModel"/> class.
 /// </summary>
 /// <param name="rule">
 /// The rule that is model represents.
 /// </param>
 public RuleModel(Rule rule)
 {
     this.Rule = rule;
 }