public void ClearHighlightItem() { ThreadHelper.ThrowIfNotOnUIThread(); if (lastHighlightedItem != null) { lastHighlightedItem.IsCurrentWorkingItem = false; lastHighlightedItem = null; } }
public void HighlightItemAtLine(int lineNumber) { ThreadHelper.ThrowIfNotOnUIThread(); var item = items.FirstOrDefault(i => i.LineNumber == lineNumber); if (lastHighlightedItem != null) { lastHighlightedItem.IsCurrentWorkingItem = false; } if (item == null) { return; } item.IsCurrentWorkingItem = true; lastHighlightedItem = item; if (Autoscroll) { tokens.ScrollIntoView(item); } }
static int CompareByLine(FunctionListItem a, FunctionListItem b) => a.LineNumber.CompareTo(b.LineNumber);
static int CompareByNameDesc(FunctionListItem a, FunctionListItem b) => - CompareByName(a, b);
static int CompareByName(FunctionListItem a, FunctionListItem b) { var comapre = string.Compare(a.Text, b.Text, StringComparison.Ordinal); return(comapre == 0 ? CompareByLine(a, b) : comapre); }