ComponentFactory.Krypton.Toolkit.VisualPopup.OnNeedPaint C# (CSharp) Method

OnNeedPaint() protected method

Processes a notification from palette storage of a paint and optional layout required.
protected OnNeedPaint ( object sender, NeedLayoutEventArgs e ) : void
sender object Source of notification.
e NeedLayoutEventArgs An NeedLayoutEventArgs containing event data.
return void
        protected virtual void OnNeedPaint(object sender, NeedLayoutEventArgs e)
        {
            Debug.Assert(e != null);

            // Validate incoming reference
            if (e == null) throw new ArgumentNullException("e");

            // If required, layout the control
            if (e.NeedLayout && !_layoutDirty)
                _layoutDirty = true;

            if (IsHandleCreated && (!_refreshAll || !e.InvalidRect.IsEmpty))
            {
                // Always request the repaint immediately
                if (e.InvalidRect.IsEmpty)
                {
                    _refreshAll = true;
                    Invalidate();
                }
                else
                    Invalidate(e.InvalidRect);

                // Do we need to use an Invoke to force repaint?
                if (!_refresh && EvalInvokePaint)
                    BeginInvoke(_refreshCall);

                // A refresh is outstanding
                _refresh = true;
            }
        }