Changeset 12235
- Timestamp:
- 03/23/15 10:19:35 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs
r12234 r12235 196 196 currentSearchString = searchString; 197 197 198 // if there is just one type node left, select by default 199 if (typesTreeView.Nodes.Count == 1) { 200 if (typesTreeView.Nodes[0].Nodes.Count == 1) { 201 typesTreeView.SelectedNode = typesTreeView.Nodes[0].Nodes[0]; 202 } 198 // select first item 199 if (selectedType == null) { 200 var firstNode = FirstVisibleNode; 201 while (firstNode != null && !(firstNode.Tag is Type)) 202 firstNode = firstNode.NextVisibleNode; 203 if (firstNode != null) 204 typesTreeView.SelectedNode = firstNode; 203 205 } 204 206 … … 406 408 private TreeNode FirstVisibleNode { 407 409 get { 408 return typesTreeView.Nodes [0];410 return typesTreeView.Nodes.Count > 0 ? typesTreeView.Nodes[0] : null; 409 411 } 410 412 } … … 412 414 get { 413 415 var node = FirstVisibleNode; 414 while (node .NextVisibleNode != null) node = node.NextVisibleNode;416 while (node != null && node.NextVisibleNode != null) node = node.NextVisibleNode; 415 417 return node; 416 418 }
Note: See TracChangeset
for help on using the changeset viewer.