Harriet.Models.Chat.ChatWindowPositionModel.OnRelocateRequested C# (CSharp) Method

OnRelocateRequested() private method

private OnRelocateRequested ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void OnRelocateRequested(object sender, EventArgs e)
        {
            double oLeft = _mainWindow.Left;
            double oTop = _mainWindow.Top;
            double oWidth = _mainWindow.Width;
            double oHeight = _mainWindow.Height;

            switch (Layout.RelativePosition)
            {
                case RelativePosition.None:
                    return;
                case RelativePosition.RightTop:
                    Left = oLeft + oWidth;
                    Top = oTop + oHeight * 0.5 - Height;
                    return;
                case RelativePosition.LeftTop:
                    Left = oLeft - Width;
                    Top = oTop + oHeight * 0.5 - Height;
                    return;
                case RelativePosition.RightBottom:
                    Left = oLeft + oWidth;
                    Top = oTop + oHeight * 0.5;
                    return;
                case RelativePosition.LeftBottom:
                    Left = oLeft - Width;
                    Top = oTop + oHeight * 0.5;
                    return;
                default:
                    return;
            }
        }
    }