/// <summary> /// Checks if the signature of the supplied <paramref name="handlerMethod"/> /// is compatible with the signature expected by the supplied /// <paramref name="eventMeta"/>. /// </summary> /// <param name="eventMeta">The event to be checked against.</param> /// <param name="handlerMethod"> /// The method signature to check for compatibility. /// </param> /// <returns> /// <see langword="true"/> if the signature of the supplied /// <paramref name="handlerMethod"/> is compatible with the signature /// expected by the supplied <paramref name="eventMeta"/>; /// <see langword="false"/> if not or either of the supplied /// parameters is <see langword="null"/>. /// </returns> /// <seealso cref="Spring.Util.DelegateInfo.IsSignatureCompatible(MethodInfo)"/> public static bool IsSignatureCompatible( EventInfo eventMeta, MethodInfo handlerMethod) { bool compatible = false; if (eventMeta != null && DelegateInfo.IsDelegate(eventMeta.EventHandlerType)) { compatible = new DelegateInfo(eventMeta.EventHandlerType) .IsSignatureCompatible(handlerMethod); } return(compatible); }
public void IsDelegateWithNullType() { Assert.IsFalse(DelegateInfo.IsDelegate(null)); }
public void IsDelegate() { Assert.IsTrue(DelegateInfo.IsDelegate(typeof(EventHandler))); }
public void IsDelegateWithBadType() { Assert.IsFalse(DelegateInfo.IsDelegate(typeof(string))); }