private AbstractCallback.EventListener CreateCallbackEventListener(IDataReader reader, AbstractCallback callback) { CallbackEvent evt = (CallbackEvent)Enum.Parse(typeof(CallbackEvent), Convert.ToString(reader["CALLBACKNAME"])); int espaceId = (reader["ESPACEID"] == DBNull.Value? 0 : Convert.ToInt32(reader["ESPACEID"])); int tenantId = (reader["TENANTID"] == DBNull.Value? 0 : Convert.ToInt32(reader["TENANTID"])); if (evt == CallbackEvent.GetHtmlForUser && !(callback is Callbacks.ECT.ECTShowFeedbackCallback) && !(callback is Callbacks.ECT.ECTGetHtmlCallback)) { throw new InvalidOperationException("GetHtmlForUser must be used for ECT Callbacks only"); } if (evt.AffectsApplication()) { tenantId = 0; } return(callback.BuildEventListener(evt, espaceId, tenantId)); }
public override bool NeedsInvoke(AppInfo app, SessionInfo session, CallbackEvent triggeredEvt) { return(base.NeedsInvoke(app, session, triggeredEvt) && (triggeredEvt.AffectsApplication() || !Callback.IsAlreadyCached(app))); }