Example #1
0
        /*
         * OnTabCloseButtonClick
         */

        /// <summary>
        /// Will bubble the <see cref="E:Genetibase.Controls.NuGenTabbedMdi.TabCloseButtonClick"/> event.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnTabCloseButtonClick(NuGenTabCancelEventArgs e)
        {
            base.OnTabCloseButtonClick(e);
            e.Cancel = (e.TabPage == this.BlankTabPage)
                                ? true
                                : false
            ;
        }
Example #2
0
        /// <summary>
        /// Will bubble the <see cref="TabCloseButtonClick"/> event.
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnTabCloseButtonClick(NuGenTabCancelEventArgs e)
        {
            NuGenTabCancelEventHandler handler = this.Events[_tabCloseButtonClick] as NuGenTabCancelEventHandler;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Example #3
0
        private void tabButton_Close(object sender, EventArgs e)
        {
            Debug.Assert(sender is NuGenTabButton, "sender is NuGenTabButton");
            Debug.Assert(this.ButtonPageDictionary.ContainsKey((NuGenTabButton)sender), "this.ButtonPageDictionary.ContainsKey((NuGenTabButton)sender)");

            NuGenTabPage            tabPage   = this.ButtonPageDictionary[(NuGenTabButton)sender];
            NuGenTabCancelEventArgs eventArgs = new NuGenTabCancelEventArgs(tabPage);

            this.OnTabCloseButtonClick(eventArgs);

            if (!eventArgs.Cancel)
            {
                this.TabPages.Remove(this.ButtonPageDictionary[(NuGenTabButton)sender]);
            }
        }
		/// <summary>
		/// Will bubble the <see cref="TabCloseButtonClick"/> event.
		/// </summary>
		/// <param name="e"></param>
		protected virtual void OnTabCloseButtonClick(NuGenTabCancelEventArgs e)
		{
			NuGenTabCancelEventHandler handler = this.Events[_tabCloseButtonClick] as NuGenTabCancelEventHandler;

			if (handler != null)
			{
				handler(this, e);
			}
		}
		private void tabButton_Close(object sender, EventArgs e)
		{
			Debug.Assert(sender is NuGenTabButton, "sender is NuGenTabButton");
			Debug.Assert(this.ButtonPageDictionary.ContainsKey((NuGenTabButton)sender), "this.ButtonPageDictionary.ContainsKey((NuGenTabButton)sender)");

			NuGenTabPage tabPage = this.ButtonPageDictionary[(NuGenTabButton)sender];
			NuGenTabCancelEventArgs eventArgs = new NuGenTabCancelEventArgs(tabPage);
			this.OnTabCloseButtonClick(eventArgs);

			if (!eventArgs.Cancel)
			{
				this.TabPages.Remove(this.ButtonPageDictionary[(NuGenTabButton)sender]);
			}
		}
		/*
		 * OnTabCloseButtonClick
		 */

		/// <summary>
		/// Will bubble the <see cref="E:Genetibase.Controls.NuGenTabbedMdi.TabCloseButtonClick"/> event.
		/// </summary>
		/// <param name="e"></param>
		protected override void OnTabCloseButtonClick(NuGenTabCancelEventArgs e)
		{
			base.OnTabCloseButtonClick(e);
			e.Cancel = (e.TabPage == this.BlankTabPage)
				? true
				: false
				;
		}