Exemplo n.º 1
0
        /// <summary>
        /// Called by a child TabItem that wants to remove itself by clicking on the close button
        /// </summary>
        /// <param name="item"></param>
        internal void RemoveItem(TabItem item)
        {
            try
            {
                // gives an opertunity to cancel the removal of the tabitem
                TabItemCancelEventArgs c = new TabItemCancelEventArgs(item);
                if (TabItemClosing != null)
                {
                    TabItemClosing(item, c);
                }

                if (c.Cancel == true)
                {
                    return;
                }

                this.Items.Remove(item);

                if (TabItemClosed != null)
                {
                    TabItemClosed(this, new TabItemEventArgs(item));
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RemoveItem()", "Controls\\VMuktiGrid\\Tab\\TabControl.cs");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called by a child TabItem that wants to remove itself by clicking on the close button
        /// </summary>
        /// <param name="item"></param>
        internal void RemoveItem(TabItem item)
        {
            try
            {
                // gives an opertunity to cancel the removal of the tabitem
                TabItemCancelEventArgs c = new TabItemCancelEventArgs(item);
                if (TabItemClosing != null)
                    TabItemClosing(item, c);

                if (c.Cancel == true)
                    return;

                this.Items.Remove(item);

                if (TabItemClosed != null)
                    TabItemClosed(this, new TabItemEventArgs(item));
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RemoveItem()", "Controls\\VMuktiGrid\\Tab\\TabControl.cs");
            }
        }