public virtual bool Filter(BaseObject @object, EventType eventType, string message) { if (this.excludeObjectTypes.Exists(o => @object.ObjectType == o)) return false; if (this.excludeObjects.Exists(o => @object.ObjectID == o)) return false; if (this.excludeEvents.Exists(e => e == eventType)) return false; return true; }
public void RaiseEvent(BaseObject @object, EventType eventType, string message, params object[] args) { string formattedMessage = (args.Length == 0) ? message : string.Format(message, args); this.listeners.FindAll(l => l.Filter.Filter(@object, eventType, formattedMessage)).ForEach(l => l.WriteEvent(@object, eventType, formattedMessage)); }