示例#1
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="Screen"></param>
            /// <param name="Edge"></param>
            /// <param name="Width"></param>
            /// <param name="Height"></param>
            /// <param name="Pixel"></param>
            /// <param name="Type"></param>
            /// <returns></returns>
            public static Point Location(Screen Screen, Enums.EdgeLocationType Edge, int Width, int Height, int Pixel = 32, Enums.Type Type = Enums.Type.Simple)
            {
                try
                {
                    Enums.LocationType LocationType = Type switch
                    {
                        Enums.Type.Advanced => Advanced.Position,
                        _ => Simple.Detect(Screen),
                    };

                    return(Edge switch
                    {
                        Enums.EdgeLocationType.TopLeft => LocationType switch
                        {
                            Enums.LocationType.Bot => new Point(Pixel, Pixel),
                            Enums.LocationType.Top => new Point(Pixel, Screen.Bounds.Height - Screen.WorkingArea.Height + Pixel),
                            Enums.LocationType.Left => new Point(Screen.Bounds.Width - Screen.WorkingArea.Width + Pixel, Pixel),
                            _ => new Point(Pixel, Pixel),
                        },
                        Enums.EdgeLocationType.TopCenter => LocationType switch
                        {
                            Enums.LocationType.Bot => new Point((Screen.Bounds.Width / 2) - (Width / 2), Pixel),
                            Enums.LocationType.Top => new Point((Screen.Bounds.Width / 2) - (Width / 2), Screen.Bounds.Height - Screen.WorkingArea.Height + Pixel),
                            Enums.LocationType.Left => new Point(Screen.Bounds.Width - Screen.WorkingArea.Width + (Screen.WorkingArea.Width / 2) - (Width / 2), Pixel),
                            _ => new Point((Screen.WorkingArea.Width / 2) - (Width / 2), Pixel),
                        },