internal KeyValuePair <Key, double>?LastEventWhenLess(Key to, double threshold) { if (Predicates.Less(to, From)) { return(null); } if (Minimum >= threshold) { return(null); } KeyValuePair <Key, double>?result = null; if ((null != FirstChild) && (null != SecondChild)) { result = SecondChild.LastEventWhenLess(to, threshold); if (null == result) { result = FirstChild.LastEventWhenLess(to, threshold); } return(result); } Debug.Assert(null == FirstChild); Debug.Assert(null == SecondChild); if ((Close < threshold) && (Predicates.LessOrEqual(To, to))) { result = new KeyValuePair <Key, double>(To, Close); } else if (Open < threshold) { result = new KeyValuePair <Key, double>(From, Open); } return(result); }