/// <summary> /// Returns the <see cref="ImagePanel"/> that contains the passed Sim /// </summary> /// <param name="sdsc"></param> /// <returns></returns> public void FindItem(Wrapper.SDesc sdsc) { if (sdsc == null) { gp.SelectedItems.Clear(); return; } foreach (SteepValley.Windows.Forms.XPListViewItem gpe in gp.Items) { if (gpe.Tag is Wrapper.SDesc) { if (sdsc.Equals((Wrapper.SDesc)gpe.Tag)) { gpe.Selected = true; gpe.EnsureVisible(); SelectedSimChanged(this, ((Wrapper.SDesc)gpe.Tag).Image, ((Wrapper.SDesc)gpe.Tag)); } else { gpe.Selected = false; } } } }
/// <summary> /// Returns the <see cref="ImagePanel"/> that contains the passed Sim /// </summary> /// <param name="sdsc"></param> /// <returns></returns> public ImagePanel FindItem(Wrapper.SDesc sdsc) { foreach (GraphPanelElement gpe in this.Items) { if (gpe is ImagePanel) { if (sdsc.Equals(((ImagePanel)gpe).Tag)) { return((ImagePanel)gpe); } } } return(null); }