protected virtual void OnItemSelected(CtrlExtendedListItemBase item, bool selected) { ExtendedListItemHandler tmp = ItemSelectedEvent; if (tmp != null) { tmp(item, selected); } }
private void RaiseSelectedItem(CtrlExtendedListItemBase item) { ListItemEventHandler tmp = OnItemSelect; if (tmp != null) { tmp(item); } }
protected override void FireListItemClicked(Control listItem) { base.FireListItemClicked(listItem); CtrlExtendedListItemBase item = listItem as CtrlExtendedListItemBase; if (item != null) { RaiseSelectedItem(item); } }
public CtrlExtendedListItemBase AddItem(CtrlExtendedListItemBase item) { if (item == null) throw new ArgumentNullException("item"); item.HeightChangedEvent -= Item_OnHeightChanged; item.ItemSelectedEvent -= Item_OnItemSelectedChanged; item.HeightChangedEvent += Item_OnHeightChanged; item.ItemSelectedEvent += Item_OnItemSelectedChanged; HookEvents(item); //Call add item in CustomListBox imp base.AddItem(item); CtrlExtendedListItemBase prevSelectedItem = SelectedItem; SelectedItem = item; return item; }
public CtrlExtendedListItemBase AddItem(CtrlExtendedListItemBase item) { if (item == null) { throw new ArgumentNullException("item"); } item.HeightChangedEvent -= Item_OnHeightChanged; item.ItemSelectedEvent -= Item_OnItemSelectedChanged; item.HeightChangedEvent += Item_OnHeightChanged; item.ItemSelectedEvent += Item_OnItemSelectedChanged; HookEvents(item); //Call add item in CustomListBox imp base.AddItem(item); CtrlExtendedListItemBase prevSelectedItem = SelectedItem; SelectedItem = item; return(item); }
public void RemoveItem(CtrlExtendedListItemBase item) { if (item == null) { throw new ArgumentNullException("item"); } if (item.IsSelected) { //Selected item and collapse deleted if is selected foreach (Control ctrl in Items) { if (ctrl != item) { SelectedItem = ctrl as CtrlExtendedListItemBase; break; } } } base.RemoveItem(item); }
private void CtrlListItem_MouseMove(object sender, MouseEventArgs e) { foreach (Control ctrl in base.Items) { Control tmpCtrl = (Control)sender; CtrlExtendedListItemBase listItem = null; do { listItem = tmpCtrl as CtrlExtendedListItemBase; if (listItem == null) { tmpCtrl = tmpCtrl.Parent; if (tmpCtrl == null) { throw new NullReferenceException("CtrlExtendedListItemBase control not found"); } } }while (listItem == null); ((CtrlExtendedListItemBase)ctrl).IsHovering = (listItem != null && listItem == ctrl); } }
protected override void OnItemSelected(CtrlExtendedListItemBase item, bool selected) { base.OnItemSelected(item, selected); }
private void Item_OnItemSelectedChanged(CtrlExtendedListItemBase item, bool selected) { }
public void RemoveItem(CtrlExtendedListItemBase item) { if (item == null) throw new ArgumentNullException("item"); if (item.IsSelected) { //Selected item and collapse deleted if is selected foreach (Control ctrl in Items) { if (ctrl != item) { SelectedItem = ctrl as CtrlExtendedListItemBase; break; } } } base.RemoveItem(item); }