示例#1
0
        protected virtual void OnItemSelected(CtrlExtendedListItemBase item, bool selected)
        {
            ExtendedListItemHandler tmp = ItemSelectedEvent;

            if (tmp != null)
            {
                tmp(item, selected);
            }
        }
示例#2
0
        private void RaiseSelectedItem(CtrlExtendedListItemBase item)
        {
            ListItemEventHandler tmp = OnItemSelect;

            if (tmp != null)
            {
                tmp(item);
            }
        }
示例#3
0
        protected override void FireListItemClicked(Control listItem)
        {
            base.FireListItemClicked(listItem);
            CtrlExtendedListItemBase item = listItem as CtrlExtendedListItemBase;

            if (item != null)
            {
                RaiseSelectedItem(item);
            }
        }
示例#4
0
        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;
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        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);
            }
        }
示例#8
0
 protected override void OnItemSelected(CtrlExtendedListItemBase item, bool selected)
 {
     base.OnItemSelected(item, selected);
 }
示例#9
0
 protected override void OnItemSelected(CtrlExtendedListItemBase item, bool selected)
 {
     base.OnItemSelected(item, selected);
 }
示例#10
0
 private void Item_OnItemSelectedChanged(CtrlExtendedListItemBase item, bool selected)
 {
 }
示例#11
0
        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);
        }
示例#12
0
 private void RaiseSelectedItem(CtrlExtendedListItemBase item)
 {
     ListItemEventHandler tmp = OnItemSelect;
     if (tmp != null)
     {
         tmp(item);
     }
 }
示例#13
0
 private void Item_OnItemSelectedChanged(CtrlExtendedListItemBase item, bool selected)
 {
 }
示例#14
0
 protected virtual void OnItemSelected(CtrlExtendedListItemBase item, bool selected)
 {
     ExtendedListItemHandler tmp = ItemSelectedEvent;
     if (tmp != null)
     {
         tmp(item, selected);
     }
 }