protected override void OnRemoveComplete(int index, object value)
        {
            WebTab tab = ArgumentUtility.CheckNotNullAndType <WebTab> ("value", value);

            base.OnRemoveComplete(index, value);

            tab.SetTabStrip(null);
            if (_tabStrip != null && tab.IsSelected)
            {
                bool wasLastTab = index == InnerList.Count;
                if (wasLastTab)
                {
                    if (InnerList.Count > 1)
                    {
                        WebTab lastTab = (WebTab)InnerList[index - 1];
                        _tabStrip.SetSelectedTabInternal(lastTab);
                    }
                    else
                    {
                        _tabStrip.SetSelectedTabInternal(null);
                    }
                }
                else
                {
                    WebTab nextTab = (WebTab)InnerList[index];
                    _tabStrip.SetSelectedTabInternal(nextTab);
                }
            }
        }
        protected override void OnInsertComplete(int index, object value)
        {
            WebTab tab = ArgumentUtility.CheckNotNullAndType <WebTab> ("value", value);

            base.OnInsertComplete(index, value);
            tab.SetTabStrip(_tabStrip);
            InitalizeSelectedTab();
        }
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            WebTab oldTab = ArgumentUtility.CheckNotNullAndType <WebTab> ("oldValue", oldValue);
            WebTab newTab = ArgumentUtility.CheckNotNullAndType <WebTab> ("newValue", newValue);

            base.OnSetComplete(index, oldValue, newValue);

            newTab.SetTabStrip(_tabStrip);
            oldTab.SetTabStrip(null);

            DeselectTab(oldTab, index);
        }
 protected override void OnClear()
 {
     base.OnClear();
     for (int i = 0; i < InnerList.Count; i++)
     {
         WebTab tab = (WebTab)InnerList[i];
         tab.SetTabStrip(null);
     }
     if (_tabStrip != null)
     {
         _tabStrip.SetSelectedTabInternal(null);
     }
 }