/// <summary> /// Select should be called from within other GuiManagers /// and wants this manager to get avtive and go to given item. /// </summary> /// <param name="item">The KmlItem to select</param> /// <returns>Whether item was found or not</returns> public bool Select(KmlItem item) { KmlNode masterNode = item is KmlNode ? (KmlNode)item : item.Parent; foreach (GuiKerbalsNode node in KerbalsList.Items) { if (node.DataKerbal == masterNode) { // Force a refreh, by causing SelectionChanged to invoke KerbalsList.SelectedItem = null; KerbalsList.SelectedItem = node; KerbalsList.ScrollIntoView(node); Focus(); if (item is KmlAttrib) { foreach (GuiTreeAttrib attrib in KerbalsDetails.Items) { if (attrib.DataAttrib == item) { attrib.IsSelected = true; KerbalsDetails.Focus(); } } } return(true); } } return(false); }
/// <summary> /// Select should be called from within other GuiManagers /// and wants this manager to get avtive and go to given item. /// </summary> /// <param name="item">The KmlItem to select</param> public void Select(KmlItem item) { foreach (GuiKerbalsNode node in KerbalsList.Items) { if (node.DataKerbal == item) { KerbalsList.SelectedItem = node; KerbalsList.ScrollIntoView(node); Focus(); return; } } }
/// <summary> /// Select should be called from within other GuiManagers /// and wants this manager to get avtive and go to given item. /// </summary> /// <param name="item">The KmlItem to select</param> public void Select(KmlItem item) { foreach (GuiKerbalsNode node in KerbalsList.Items) { if (node.DataKerbal == item) { // Force a refreh, by causing SelectionChanged to invoke KerbalsList.SelectedItem = null; KerbalsList.SelectedItem = node; KerbalsList.ScrollIntoView(node); Focus(); return; } } }