protected void SetDisplayRectLocation(int x, int y)
{
int nXAmount = 0;
int nYAmount = 0;
Rectangle clientRectangle = base.ClientRectangle;
Rectangle displayRect = this.displayRect;
int num3 = Math.Min(clientRectangle.Width - displayRect.Width, 0);
int num4 = Math.Min(clientRectangle.Height - displayRect.Height, 0);
if (x > 0)
{
x = 0;
}
if (y > 0)
{
y = 0;
}
if (x < num3)
{
x = num3;
}
if (y < num4)
{
y = num4;
}
if (displayRect.X != x)
{
nXAmount = x - displayRect.X;
}
if (displayRect.Y != y)
{
nYAmount = y - displayRect.Y;
}
this.displayRect.X = x;
this.displayRect.Y = y;
if ((nXAmount != 0) || ((nYAmount != 0) && base.IsHandleCreated))
{
Rectangle rectangle3 = base.ClientRectangle;
System.Windows.Forms.NativeMethods.RECT rectClip = System.Windows.Forms.NativeMethods.RECT.FromXYWH(rectangle3.X, rectangle3.Y, rectangle3.Width, rectangle3.Height);
System.Windows.Forms.NativeMethods.RECT prcUpdate = System.Windows.Forms.NativeMethods.RECT.FromXYWH(rectangle3.X, rectangle3.Y, rectangle3.Width, rectangle3.Height);
System.Windows.Forms.SafeNativeMethods.ScrollWindowEx(new HandleRef(this, base.Handle), nXAmount, nYAmount, null, ref rectClip, System.Windows.Forms.NativeMethods.NullHandleRef, ref prcUpdate, 7);
}
for (int i = 0; i < base.Controls.Count; i++)
{
Control control = base.Controls[i];
if ((control != null) && control.IsHandleCreated)
{
control.UpdateBounds();
}
}
}