Ejemplo n.º 1
0
        /// <summary>
        /// Triggers a callback to control's <see cref="DoPaint"/>, then re-renders canvas.
        /// </summary>
        /// <param name="needBackground">If true, full canvas is repainted to control can render over stuff outside it's own rectangle.</param>
        /// <param name="rm">Determines when canvas is re-rendered after painting.</param>
        protected void MakeMePaint(bool needBackground, RenderMode rm)
        {
            // Request comes from background thread. In the UI thread, parent may just have been removed.
            // If I have no parent, silently do not invoke.
            // Happens when an animation is in progress and user switches to different tab in top form
            ZenControlBase parent = Parent;

            if (parent != null)
            {
                ControlToPaint[] ctrls = new ControlToPaint[1];
                ctrls[0] = new ControlToPaint(this, needBackground, rm);
                parent.MakeControlsPaint(new ReadOnlyCollection <ControlToPaint>(ctrls));
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Triggers a callback to control's <see cref="DoPaint"/>, then re-renders canvas.
 /// </summary>
 /// <param name="needBackground">If true, full canvas is repainted to control can render over stuff outside it's own rectangle.</param>
 /// <param name="rm">Determines when canvas is re-rendered after painting.</param>
 protected void MakeMePaint(bool needBackground, RenderMode rm)
 {
     // Request comes from background thread. In the UI thread, parent may just have been removed.
     // If I have no parent, silently do not invoke.
     // Happens when an animation is in progress and user switches to different tab in top form
     ZenControlBase parent = Parent;
     if (parent != null)
     {
         ControlToPaint[] ctrls = new ControlToPaint[1];
         ctrls[0] = new ControlToPaint(this, needBackground, rm);
         parent.MakeControlsPaint(new ReadOnlyCollection<ControlToPaint>(ctrls));
     }
 }