Example #1
0
 protected virtual void OnItemsChanged(object sender, RadPageViewItemsChangedEventArgs args)
 {
     if (this.ItemsChanged != null)
     {
         this.ItemsChanged(sender, args);
     }
 }
Example #2
0
        private void tabStripElement_ItemsChanged(object sender, RadPageViewItemsChangedEventArgs e)
        {
            if (this.Disposing || this.IsDisposed || !this.IsHandleCreated)
            {
                return;
            }

            if (this.suspendStripItemsChanged > 0)
            {
                return;
            }

            this.SuspendStripNotifications(true, true);

            //we need to sync item and panel indexes
            switch (e.Operation)
            {
            case ItemsChangeOperation.Inserted:
            case ItemsChangeOperation.Set:
                TabStripItem item = e.ChangedItem as TabStripItem;
                if (item != null)
                {
                    int index = this.tabStripElement.Items.IndexOf(item);
                    this.Controls.SetChildIndex(item.TabPanel, index);
                    this.selectedIndex = index;
                    this.UpdateTabSelection(true);
                }
                break;
            }

            this.ResumeStripNotifications(true, true);
        }
Example #3
0
        protected virtual void RemoveItemCore(RadPageViewItem item)
        {
            int index = this.items.IndexOf(item);

            this.items.RemoveAt(index);
            item.Owner = null;

            RadPageViewItemsChangedEventArgs itemsChangedEventArgs = new RadPageViewItemsChangedEventArgs(item, ItemsChangeOperation.Removed);

            this.OnItemsChanged(this, itemsChangedEventArgs);

            RadElement parent = this.ItemsParent;

            if (parent != null)
            {
                parent.Children.Remove(item);
            }

            if (item != this.selectedItem)
            {
                return;
            }

            item.IsSelected = false;

            if (index >= this.items.Count)
            {
                index--;
            }

            RadPageViewItem newSelected = null;

            if (index >= 0 && index < this.items.Count)
            {
                newSelected = this.items[index];
            }

            this.SelectItem(newSelected);
        }
Example #4
0
        protected virtual void InsertItemCore(int index, RadPageViewItem item)
        {
            this.items.Insert(index, item);
            item.Owner = this;
            this.SyncronizeItem(item);

            RadPageViewItemsChangedEventArgs itemsChangedEventArgs = new RadPageViewItemsChangedEventArgs(item, ItemsChangeOperation.Inserted);

            this.OnItemsChanged(this, itemsChangedEventArgs);

            RadElement parent = this.ItemsParent;

            if (parent != null)
            {
                parent.Children.Insert(index, item);
            }

            if (this.selectedItem == null)
            {
                this.SelectItem(item);
            }
        }
Example #5
0
 private void tabStripElement_ItemsChanged(object sender, RadPageViewItemsChangedEventArgs e)
 {
     if (this.Disposing || this.IsDisposed || (!this.IsHandleCreated || this.suspendStripItemsChanged > 0))
     {
         return;
     }
     this.SuspendStripNotifications(true, true);
     switch (e.Operation)
     {
     case ItemsChangeOperation.Inserted:
     case ItemsChangeOperation.Set:
         TabStripItem changedItem = e.ChangedItem as TabStripItem;
         if (changedItem != null)
         {
             int newIndex = this.tabStripElement.Items.IndexOf((RadPageViewItem)changedItem);
             this.Controls.SetChildIndex((Control)changedItem.TabPanel, newIndex);
             this.selectedIndex = newIndex;
             this.UpdateTabSelection(true);
             break;
         }
         break;
     }
     this.ResumeStripNotifications(true, true);
 }