public EventListener(AbstractCallback callback, CallbackEvent evt, int espaceId, int tenantId) { _callback = callback; _evt = evt; _espaceId = espaceId; _tenantId = tenantId; }
private static string _getPropertyGetValue(string property, object key, object value) { if (value == null) { return(""); } string propertyName = property + "[" + key + "]"; AbstractCallback valueAsAbstractCallback = value as AbstractCallback; if (valueAsAbstractCallback != null) { return(_getPropertyText(propertyName, valueAsAbstractCallback)); } Type valueAsType = value as Type; if (valueAsType != null) { return(_getPropertyText(propertyName, valueAsType)); } IList valueAsIList = value as IList; if (valueAsIList != null) { return(_getPropertyText(propertyName, valueAsIList)); } // See if value is a dictionary Type valueType = value.GetType(); Type iGenericDictionaryType = typeof(IDictionary <,>); if (valueType.IsGenericType && iGenericDictionaryType.IsAssignableFrom(valueType.GetGenericTypeDefinition())) { MethodInfo getPropertyTextMethod = typeof(CallbackResultStorage).GetMethod("_getPropertyText", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(string), iGenericDictionaryType.MakeGenericType(valueType.GetGenericArguments()) }, null); getPropertyTextMethod.Invoke(null, new object[] { propertyName, value }); } return(BuiltInFunction.EncodeHtml(value.ToString())); }
private bool Equals(AbstractCallback obj) { return(_invoke.Equals(obj._invoke)); }
private static string _getPropertyText(string property, AbstractCallback value) { return(_getPropertyText(property, value.GetType())); }
/// <summary> /// Calling this method makes sure every event listener is bound to the same callback object /// </summary> public void NormalizeCallback(HashSet <AbstractCallback> callbacks) { _callback = callbacks.FirstOrDefault(c => c.Equals(_callback)); }