public static T FindLast <T>(TrackEvent current) where T : TrackEvent { while (true) { current = current.Previous; if (current is T) { return(current as T); } } }
public static T FindLast <T>(TrackEvent current, SentinelCheck <T> check) where T : TrackEvent { T val; while ((current = current.Previous) != null) { val = current as T; if (val != null && check(val)) { return(val); } } return(null); }