ACAT.Lib.Core.Utility.Windows.GetScannerPosition C# (CSharp) Метод

GetScannerPosition() публичный статический Метод

Gets the position of the specified form. which corner is the scanner at?
public static GetScannerPosition ( Form form ) : WindowPosition
form System.Windows.Forms.Form the scanner form
Результат WindowPosition
        public static WindowPosition GetScannerPosition(Form form)
        {
            WindowPosition retVal;

            if (form.Left == 0 && form.Top == 0)
            {
                retVal = WindowPosition.TopLeft;
            }
            else if (form.Left == 0 && form.Top == Screen.PrimaryScreen.WorkingArea.Height - form.Height)
            {
                retVal = WindowPosition.BottomLeft;
            }
            else if (form.Left == 0)
            {
                retVal = WindowPosition.MiddleLeft;
            }
            else if (form.Top == 0 && form.Left == Screen.PrimaryScreen.WorkingArea.Width - form.Width)
            {
                retVal = WindowPosition.TopRight;
            }
            else if (form.Top == Screen.PrimaryScreen.WorkingArea.Height - form.Height &&
                     form.Left == Screen.PrimaryScreen.WorkingArea.Width - form.Width)
            {
                retVal = WindowPosition.BottomRight;
            }
            else
            {
                retVal = WindowPosition.MiddleRight;
            }

            return retVal;
        }