public ButtonState(ChromeButton button, ChromeButtonState state, bool draw, Rectangle bounds)
 {
     Button = button;
     State = state;
     Draw = draw;
     Bounds = bounds;
 }
 public ButtonState(ChromeButton button, ChromeButtonState state, bool draw, Rectangle bounds, VisualStudioButton extraButton)
 {
     Button      = button;
     State       = state;
     Draw        = draw;
     Bounds      = bounds;
     ExtraButton = extraButton;
 }
 public ButtonState(ChromeButton button, ChromeButtonState state, bool draw, Rectangle bounds, VisualStudioButton extraButton)
 {
     Button = button;
     State = state;
     Draw = draw;
     Bounds = bounds;
     ExtraButton = extraButton;
 }
 private void SetOverButton(VisualStudioButton extraButton)
 {
     if (_overExtraButton != extraButton)
     {
         _overButton      = ChromeButton.None;
         _overExtraButton = extraButton;
         _formChrome.PaintNonClientArea();
     }
 }
 private void SetDownButton(VisualStudioButton extraButton)
 {
     if (_downExtraButton != extraButton)
     {
         _downButton      = ChromeButton.None;
         _downExtraButton = extraButton;
         _formChrome.PaintNonClientArea();
     }
 }
 private void SetDownButton(ChromeButton button)
 {
     if (_downButton != button)
     {
         _downButton      = button;
         _downExtraButton = null;
         _formChrome.PaintNonClientArea();
     }
 }
 private void SetOverButton(ChromeButton button)
 {
     if (_overButton != button)
     {
         _overButton      = button;
         _overExtraButton = null;
         _formChrome.PaintNonClientArea();
     }
 }
 private void SetDownButton(ChromeButton button)
 {
     if (_downButton != button)
     {
         _downButton = button;
         FormChrome.PaintNonClientArea();
     }
 }
            private ButtonState GetButtonState(VisualStudioFormChrome parent, ref int offset, ChromeButton button, bool enabled, VisualStudioButton extraButton)
            {
                offset -= ButtonSize.Width;

                var bounds = new Rectangle(
                    offset,
                    parent._formChrome.AdjustedResizeBorderThickness.Top,
                    ButtonSize.Width,
                    ButtonSize.Height
                );

                var location = parent._formChrome.PointToClient(Cursor.Position);
                bool over = bounds.Contains(location);

                ChromeButtonState state;

                if (!enabled)
                {
                    state = ChromeButtonState.Disabled;
                }
                else if (parent.CaptureStart.HasValue)
                {
                    if (bounds.Contains(parent.CaptureStart.Value))
                        state = over ? ChromeButtonState.Down : ChromeButtonState.Over;
                    else
                        state = ChromeButtonState.Enabled;
                }
                else
                {
                    state = over ? ChromeButtonState.Over : ChromeButtonState.Enabled;
                }

                if (extraButton != null)
                {
                    extraButton.IsOver = false;
                    extraButton.IsDown = false;
                }

                if (state == ChromeButtonState.Over)
                {
                    OverButton = button;
                    OverExtraButton = extraButton;
                    if (extraButton != null)
                        extraButton.IsOver = true;
                }
                else if (state == ChromeButtonState.Down)
                {
                    DownButton = button;
                    DownExtraButton = extraButton;
                    if (extraButton != null)
                        extraButton.IsDown = true;
                }

                return new ButtonState(button, state, true, bounds, extraButton);
            }
 public ButtonState(ChromeButton button)
     : this(button, ChromeButtonState.Disabled, false, Rectangle.Empty, null)
 {
 }
 private void SetDownButton(ChromeButton button)
 {
     if (_downButton != button)
     {
         _downButton = button;
         _downExtraButton = null;
         _formChrome.PaintNonClientArea();
     }
 }
 private void SetDownButton(VisualStudioButton extraButton)
 {
     if (_downExtraButton != extraButton)
     {
         _downButton = ChromeButton.None;
         _downExtraButton = extraButton;
         _formChrome.PaintNonClientArea();
     }
 }
 public ButtonState(ChromeButton button)
     : this(button, ChromeButtonState.Disabled, false, Rectangle.Empty, null)
 {
 }
            private ButtonState GetButtonState(VisualStudioFormChrome parent, ref int offset, ChromeButton button, bool enabled, VisualStudioButton extraButton)
            {
                offset -= ButtonSize.Width;

                var bounds = new Rectangle(
                    offset,
                    parent._formChrome.AdjustedResizeBorderThickness.Top,
                    ButtonSize.Width,
                    ButtonSize.Height
                    );

                var  location = parent._formChrome.PointToClient(Cursor.Position);
                bool over     = bounds.Contains(location);

                ChromeButtonState state;

                if (!enabled)
                {
                    state = ChromeButtonState.Disabled;
                }
                else if (parent.CaptureStart.HasValue)
                {
                    if (bounds.Contains(parent.CaptureStart.Value))
                    {
                        state = over ? ChromeButtonState.Down : ChromeButtonState.Over;
                    }
                    else
                    {
                        state = ChromeButtonState.Enabled;
                    }
                }
                else
                {
                    state = over ? ChromeButtonState.Over : ChromeButtonState.Enabled;
                }

                if (extraButton != null)
                {
                    extraButton.IsOver = false;
                    extraButton.IsDown = false;
                }

                if (state == ChromeButtonState.Over)
                {
                    OverButton      = button;
                    OverExtraButton = extraButton;
                    if (extraButton != null)
                    {
                        extraButton.IsOver = true;
                    }
                }
                else if (state == ChromeButtonState.Down)
                {
                    DownButton      = button;
                    DownExtraButton = extraButton;
                    if (extraButton != null)
                    {
                        extraButton.IsDown = true;
                    }
                }

                return(new ButtonState(button, state, true, bounds, extraButton));
            }
 private void SetOverButton(ChromeButton button)
 {
     if (_overButton != button)
     {
         _overButton = button;
         FormChrome.PaintNonClientArea();
     }
 }
 private void SetOverButton(VisualStudioButton extraButton)
 {
     if (_overExtraButton != extraButton)
     {
         _overButton = ChromeButton.None;
         _overExtraButton = extraButton;
         _formChrome.PaintNonClientArea();
     }
 }
 private void SetOverButton(ChromeButton button)
 {
     if (_overButton != button)
     {
         _overButton = button;
         _overExtraButton = null;
         _formChrome.PaintNonClientArea();
     }
 }