void model_SelectionUpdateEvt(Selection.State previous, Selection.State current) { if (current.sender == this) { return; } TestResultTreeNode node = null; if (current.testResult != null) { node = current.testResult.DataElement.Annotation <TestResultTreeNode>(); System.Diagnostics.Debug.Assert(node != null, "The node was selected before there was a test result. How's this possible? We have a race somewhere."); } suspend_selection_notify = true; treeView1.SelectedNode = node; if (node != null) { node.EnsureVisible(); } suspend_selection_notify = false; }