public static T ValidateEventData <T>(BaseEventData data) where T : class { if (data as T == null) { throw new ArgumentException($"Invalid type: {data.GetType()} passed to event expecting {typeof(T)}"); } return(data as T); }
public static T ValidateEventData <T>(BaseEventData data) where T : class { if ((data as T) == null) { throw new ArgumentException(String.Format("Invalid type: {0} passed to event expecting {1}", data.GetType(), typeof(T))); } return(data as T); }