Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
        /// <summary>Initializes a new instance of the <see cref="SplitContainerTools"/> class.</summary>
        /// <param name="container">
        /// The <see cref="System.Windows.Forms.SplitContainer"/> to which this instance will be bound.
        /// </param>
        public SplitContainerTools(SplitContainer container)
        {
            split = container;
            _keepFocus = false;
            _showGripper = true;
            _showButtons = SplitContainerButtons.None;
            _panel1Border = false;
            _panel2Border = false;
            _buttons = new SplitContainerButton[] { };
            _tooltip = new ToolTip();

            _splitRectInternal = typeof(SplitContainer).GetField("splitterRect", Reflection.BindingFlags.NonPublic |
                                                                                 Reflection.BindingFlags.GetField |
                                                                                 Reflection.BindingFlags.Instance);

            split.Paint += split_Paint;
            split.MouseDown += split_MouseDown;
            split.MouseUp += split_MouseUp;
            split.MouseClick += split_MouseClick;
            split.MouseMove += split_MouseMove;
            split.MouseLeave += (o, e) => split.Cursor = Cursors.Default;
            split.SplitterMoved += split_SplitterMoved;
            split.SizeChanged += split_Resize;
            split.Disposed += (o, e) => _tooltip.Dispose();

            ((Panel)split.Panel1).ClientSizeChanged += Split_Panel_CollapsedChanged;
            ((Panel)split.Panel2).LocationChanged += Split_Panel_CollapsedChanged;
        }
示例#2
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!DesignMode)
                {
                    GlobalEvents.StaticIdle -= new EventHandler(OnIdle);
                    Menu = null;
                }
                if (components != null)
                {
                    components.Dispose();
                    components = null;
                }

                if (_toolTip != null)
                {
                    _toolTip.Dispose();
                    _toolTip = null;
                }

                if (_actions != null)
                {
                    _actions.Dispose();
                    _actions = null;
                }
            }
            base.Dispose(disposing);
        }
示例#3
0
        /// <summary>Initializes a new instance of the <see cref="SplitContainerTools"/> class.</summary>
        /// <param name="container">
        /// The <see cref="System.Windows.Forms.SplitContainer"/> to which this instance will be bound.
        /// </param>
        public SplitContainerTools(SplitContainer container)
        {
            split         = container;
            _keepFocus    = false;
            _showGripper  = true;
            _showButtons  = SplitContainerButtons.None;
            _panel1Border = false;
            _panel2Border = false;
            _buttons      = new SplitContainerButton[] { };
            _tooltip      = new ToolTip();

            _splitRectInternal = typeof(SplitContainer).GetField("splitterRect", Reflection.BindingFlags.NonPublic |
                                                                 Reflection.BindingFlags.GetField |
                                                                 Reflection.BindingFlags.Instance);

            split.Paint         += split_Paint;
            split.MouseDown     += split_MouseDown;
            split.MouseUp       += split_MouseUp;
            split.MouseClick    += split_MouseClick;
            split.MouseMove     += split_MouseMove;
            split.MouseLeave    += (o, e) => split.Cursor = Cursors.Default;
            split.SplitterMoved += split_SplitterMoved;
            split.SizeChanged   += split_Resize;
            split.Disposed      += (o, e) => _tooltip.Dispose();

            ((Panel)split.Panel1).ClientSizeChanged += Split_Panel_CollapsedChanged;
            ((Panel)split.Panel2).LocationChanged   += Split_Panel_CollapsedChanged;
        }
示例#4
0
        public Session(Alphora.Dataphor.DAE.Client.DataSession dataSession, bool ownsDataSession) : base(dataSession, ownsDataSession)
        {
            _toolTip = new WinForms.ToolTip();
            try
            {
                _toolTip.Active = true;
            }
            catch
            {
                _toolTip.Dispose();
                _toolTip = null;
                throw;
            }

            // Ensure we are setup for SafelyInvoke.  This must happen on the main windows thread and thus is not in a static constructor.
            lock (_invokeControlLock)
            {
                if (_invokeControl == null)
                {
                    _invokeControl = new WinForms.Control();
                    _invokeControl.CreateControl();
                }
            }

            // Ensure the assembly resolver is loaded
            Alphora.Dataphor.Windows.AssemblyUtility.Initialize();
        }
 public void Dispose()
 {
     if (toolTip != null)
     {
         toolTip.Dispose();
         toolTip = null;
     }
 }
示例#6
0
 public void DestroyToolTip(Control ctrl)
 {
     if (tooltip != null)
     {
         tooltip.SetToolTip(ctrl, String.Empty);
         tooltip.Dispose();
         tooltip = null;
     }
 }
示例#7
0
 private void HideToolTip()
 {
     if (FToolTip != null)
     {
         FToolTip.Hide(this);
         FToolTip.Dispose();
         FToolTip = null;
     }
 }
示例#8
0
        // Clean up any resources being used.
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                toolTip1.Dispose();
            }

            base.Dispose(disposing);
        }
示例#9
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_toolTip != null)
         {
             _toolTip.Dispose();
         }
     }
     _toolTip = null;
     base.Dispose(disposing);
 }
示例#10
0
        public void Dispose()
        {
            if (!_disposed)
            {
                if (_toolTip != null)
                {
                    _toolTip.Dispose();
                }

                _disposed = true;
            }
        }
        public void createTooltip(ToolTip toolTip)
        {
            if (toolTip != null)
            {
                toolTip.Dispose();
            }
            toolTip = new ToolTip();
            toolTip.AutoPopDelay = 3000;
            toolTip.InitialDelay = 1;
            toolTip.ReshowDelay = 500;
            // Force the ToolTip text to be displayed whether or not the form is active.
            toolTip.ShowAlways = true;

            toolTip.SetToolTip(this.groupBox2, "你选择的是" + this.requestType_cb.Text + "方式");
        }
示例#12
0
        internal void UpdateToolTip(ToolStripItem item)
        {
            if (ShowItemToolTips == false)
            {
                if (toolTip != null)
                {
                    toolTip.Dispose();
                    toolTip = null;
                }

                return;
            }

            if (item == toolTipItem)
            {
                return;
            }

            toolTipItem = item;

            if (item == null)
            {
                if (toolTip != null)
                {
                    toolTip.Show(null, Location);
                }
                return;
            }

            if (toolTip == null)
            {
                toolTip = new ToolTip();
                toolTip.SetToolTip(this, null);
            }

            var itemLocation = PointToClient(item.Bounds.Location);

            if (toolTip.alphaState > 0)
            {
                toolTipNextLocation = itemLocation;
                toolTipNextText     = item.ToolTipText;
                toolTip.alphaState  = 3;
            }
            else
            {
                toolTip.Show(item.ToolTipText, itemLocation);
            }
        }
            protected override void Dispose(bool disposing)
            {
                if (disposing)
                {
                    if (tooltip_timer != null)
                    {
                        tooltip_timer.Dispose();
                    }

                    if (tooltip_window != null)
                    {
                        tooltip_window.Dispose();
                    }
                }

                base.Dispose(disposing);
            }
示例#14
0
		internal override void SystrayRemove(IntPtr handle, ref ToolTip tt)
		{

			SetVisible (handle, false, false);

			// The caller can now re-dock it later...
			if (tt != null) {
				tt.Dispose();
				tt = null;
			}
			// Close any balloon window *we* fired.
			ThemeEngine.Current.HideBalloonWindow (handle);
		}
示例#15
0
		public void SystrayRemove(IntPtr handle, ref ToolTip tt)
		{
#if GTKSOCKET_SUPPORTS_REPARENTING
			X11Hwnd hwnd;

			hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

			/* in the XEMBED spec, it mentions 3 ways for a client window to break the protocol with the embedder.
			 * 1. The embedder can unmap the window and reparent to the root window (we should probably handle this...)
			 * 2. The client can reparent its window out of the embedder window.
			 * 3. The client can destroy its window.
			 *
			 * this call to SetParent is case 2, but in
			 * the spec it also mentions that gtk doesn't
			 * support this at present.  Looking at HEAD
			 * gtksocket-x11.c jives with this statement.
			 *
			 * so we can't reparent.  we have to destroy.
			 */
			SetParent(hwnd.WholeWindow, FosterParent);
#else
			Control	control = Control.FromHandle(handle);
			if (control is NotifyIcon.NotifyIconWindow)
				((NotifyIcon.NotifyIconWindow)control).InternalRecreateHandle ();
#endif

			// The caller can now re-dock it later...
			if (tt != null) {
				tt.Dispose();
				tt = null;
			}
		}
		internal override void SystrayRemove(IntPtr handle, ref ToolTip tt) {

			SetVisible (handle, false, false);

			// The caller can now re-dock it later...
			if (tt != null) {
				tt.Dispose();
				tt = null;
			}
		}
示例#17
0
		internal override void SystrayRemove (IntPtr handle, ref ToolTip tt)
		{
			Hwnd	hwnd;
			
			hwnd = Hwnd.ObjectFromHandle (handle);
			
			XUnmapWindow (DisplayHandle, hwnd.whole_window);
			SetParent (hwnd.whole_window, FosterParent);
			
			// The caller can now re-dock it later...
			if (tt != null) {
				tt.Dispose ();
				tt = null;
			}
		}