// dispatch function for handling filtered message response callbacks private bool dispatchResponse(string eventLabel, params object[] arguments) { var data = arguments; if (this.listeners.ContainsKey(eventLabel)) { List <object> listenersForEvent = listeners[eventLabel]; foreach (object listenerForEvent in listenersForEvent) { if (listenerForEvent.GetType() == typeof(JObjectWithActions)) { JObjectWithActions listenerObj = (JObjectWithActions)listenerForEvent; if (listenerObj["filters"] != null) { { JObject filtersObj = (JObject)listenerObj["filters"]; JObject dataObj = (JObject)data[0]; if (Symple.match(filtersObj, dataObj)) { Action <object> fn = listenerObj.actions["fn"]; fn(data); if (listenerObj["after"] != null) { Action <object> after = listenerObj.actions["after"]; after(data); } return(true); } } } } } } return(false); }
public List <JObject> find(JObject parameters) { List <JObject> res = new List <JObject>(); for (int i = 0; i < this.store.Count; i++) { if (Symple.match(parameters, this.store[i])) { res.Add(this.store[i]); } } return(res); }