AcManager.Controls.CustomShowroom.LiteShowroomWrapperWithTools.GoToToolMode C# (CSharp) Method

GoToToolMode() protected method

protected GoToToolMode ( ) : void
return void
        protected override void GoToToolMode() {
            _switchingInProgress = true;

            try {
                var area = Screen.PrimaryScreen.WorkingArea;
                var size = ValuesStorage.GetPoint(KeyToolSize, new Point(400, 240));
                var pos = ValuesStorage.GetPoint(KeyToolPos, new Point(80, Screen.PrimaryScreen.WorkingArea.Height - 300));

                FullscreenEnabled = false;
                Form.WindowState = FormWindowState.Normal;
                Form.Width = MathF.Clamp((int)size.X, 320, area.Width);
                Form.Height = MathF.Clamp((int)size.Y, 200, area.Height);
                Form.Top = MathF.Clamp((int)pos.Y, 0, area.Height - Form.Height);
                Form.Left = MathF.Clamp((int)pos.X, 0, area.Width - Form.Width);

                Form.FormBorderStyle = FormBorderStyle.SizableToolWindow;
                Form.TopMost = true;

                Renderer.Width = Form.ClientSize.Width;
                Renderer.Height = Form.ClientSize.Height;

                _lastVisibleTools = _helper.Visible;
                _helper.Visible = false;
            } finally {
                _switchingInProgress = false;
            }
        }