void control_OnEntitySelected(ChemEntity entity) { object obj = null; if (entity.CdkObject is IAtom) { AtomWrapper atom = new AtomWrapper((IAtom)entity.CdkObject); obj = atom; ListViewItem[] connectedItems = atom.GetConnectedItemsForListView(currentSelected.ChemControl, uiConnectedList.Groups[0], uiConnectedList.Groups[1]); uiConnectedList.Items.Clear(); if (connectedItems != null) { uiConnectedList.Items.AddRange(connectedItems); } } propertyGrid1.SelectedObject = obj; }
void control_OnEntitySelected(ChemEntity entity) { object obj = null; if (entity.CdkObject is IAtom) { AtomWrapper atom = new AtomWrapper((IAtom)entity.CdkObject); obj = atom; ListViewItem[] connectedItems = atom.GetConnectedItemsForListView(currentSelected.ChemControl, uiConnectedList.Groups[0], uiConnectedList.Groups[1]); uiConnectedList.Items.Clear(); if (connectedItems != null) uiConnectedList.Items.AddRange(connectedItems); } propertyGrid1.SelectedObject = obj; }