public void Invalidate (Rectangle rc, bool invalidateChildren)
{
// Win32 invalidates control including when Width and Height is equal 0
// or is not visible, only Paint event must be care about this.
if (!IsHandleCreated)
return;
if (rc.IsEmpty)
rc = ClientRectangle;
if (rc.Width > 0 && rc.Height > 0)
{
NotifyInvalidate (rc);
NSViewForControl.SetNeedsDisplayInRect (rc);
if (invalidateChildren)
{
Control[] controls = child_controls.GetAllControls ();
for (int i = 0; i < controls.Length; i++)
controls[i].Invalidate ();
}
else
{
// If any of our children are transparent, we
// have to invalidate them anyways
foreach (Control c in Controls)
if (c.BackColor.A != 255)
c.Invalidate ();
}
}
OnInvalidated (new InvalidateEventArgs (rc));
}