Exemple #1
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Remove our show instance
                if (_shadow != null)
                {
                    _shadow.Dispose();
                    _shadow = null;
                }
            }

            base.Dispose(disposing);

            // Remove the active view, so the last view element to
            // have mouse input has a chance to cleanup processing
            if (ViewManager != null)
            {
                ViewManager.ActiveView = null;
                ViewManager.Dispose();
            }

            // Do we have a delegate to fire when popup is dismissed?
            if (_dismissedDelegate != null)
            {
                _dismissedDelegate(this, EventArgs.Empty);
                _dismissedDelegate = null;
            }
        }
Exemple #2
0
        /// <summary>
        /// Define the drawing paths for the shadow.
        /// </summary>
        /// <param name="path1">Outer path.</param>
        /// <param name="path2">Middle path.</param>
        /// <param name="path3">Inside path.</param>
        public virtual void DefineShadowPaths(GraphicsPath path1,
                                              GraphicsPath path2,
                                              GraphicsPath path3)
        {
            // Create the shadow control
            if (_needShadow)
            {
                _shadow = CreateShadowControl();
            }

            if (_shadow != null && _shadow is VisualPopupShadow)
            {
                ((VisualPopupShadow)_shadow).DefinePaths(path1, path2, path3);
            }
            else
            {
                path1.Dispose();
                path2.Dispose();
                path3.Dispose();
            }
        }