Example #1
0
        private void barDocuments_DockTabClosing(object sender, DevComponents.DotNetBar.DockTabClosingEventArgs e)
        {
            if (!XContext.AllowClose)
            {
                if (e.DockContainerItem.Tag.GetType() == typeof(StartWF))
                {
                    e.Cancel = true;
                }
                return;
            }

            e.RemoveDockTab = true;

            if (((Bar)sender).Items.Count == 1) // Remove bar if last item is closed...
            {
                dotNetBarManager1.Bars.Remove((Bar)sender);
            }

            //删除事件订阅。
            if (this.m_AddIns.Contains(e.DockContainerItem.Tag))
            {
                MessageExchange.Singleton.Unsubscribe(e.DockContainerItem.Tag);
                MessageExchange.RemoveNotify(e.DockContainerItem.Tag);
                this.m_AddIns.Remove(e.DockContainerItem.Tag);
            }
        }
 private void bar4_DockTabClosing(object sender, DockTabClosingEventArgs e)
 {
     foreach (object b in e.DockContainerItem.Control.Controls)
     {
         if (b is Scintilla)
         {
             Scintilla saveme = (Scintilla)b;
             save(saveme.Text, saveme.Tag.ToString());
         }
     }
 }
Example #3
0
 internal void InvokeDockTabClosing(DockTabClosingEventArgs e)
 {
     if (DockTabClosing != null)
         DockTabClosing(this, e);
     if (this.Owner is DotNetBarManager)
     {
         ((DotNetBarManager)this.Owner).InvokeDockTabClosing(this, e);
     }
 }
Example #4
0
 private void InvokeDockTabClosed(DockTabClosingEventArgs e)
 {
     if (DockTabClosed != null)
         DockTabClosed(this, e);
     if (this.Owner is DotNetBarManager)
     {
         ((DotNetBarManager)this.Owner).InvokeDockTabClosed(this, e);
     }
     OnBarStateChanged(new BarStateChangedEventArgs(this, eBarStateChange.DockTabClosed, e.DockContainerItem));
 }
Example #5
0
        /// <summary>
        /// Closes the DockContainerItem.
        /// </summary>
        /// <param name="dockTab">DockContainerItem to close.</param>
        /// <param name="source">Source of the event.</param>
        public void CloseDockTab(DockContainerItem dockTab, eEventSource source)
        {
            DockTabClosingEventArgs e = new DockTabClosingEventArgs(dockTab, source);
            InvokeDockTabClosing(e);
            if (e.Cancel)
                return;

            if (this.VisibleItemCount > 1)
            {
                if (e.RemoveDockTab)
                    this.Items.Remove(dockTab);
                else
                    BarUtilities.SetDockContainerVisible(dockTab, false);
            }
            else
            {
                if (e.RemoveDockTab)
                    this.Items.Remove(dockTab);
                CloseBar();
                if (!this.Visible)
                    dockTab.Visible = false;
            }

            InvokeDockTabClosed(e);
        }
Example #6
0
 internal void InvokeDockTabClosed(Bar bar, DockTabClosingEventArgs e)
 {
     if (DockTabClosed != null)
         DockTabClosed(this, e);
 }