Ejemplo n.º 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),
                        },
Ejemplo n.º 2
0
 public static List <LocationPoint> GetLocations(Enums.LocationType locationType)
 {
     using (var db = new ModelContainer())
     {
         return(db.Locations.Where(x => x.LocationType == locationType).ToList());
     }
 }
Ejemplo n.º 3
0
        public List <Canvas> GetList(Enums.LocationType locationType)
        {
            var list = new List <Canvas>();

            _items = Locations.GetLocations(locationType);
            foreach (var location in _items)
            {
                list.Add(Get(location));
            }

            return(list);
        }
 public void AddLocation(int LocationId, Enums.LocationType LocationType)
 {
     if (LocationType == (Enums.LocationType.DistributionCenter))
     {
         locations.Add(new DistributionCenter());
     }
     if (LocationType == (Enums.LocationType.Branch))
     {
         locations.Add(new Branch());
     }
     locations.Add(new Location()
     {
         LocationId = LocationId, LocationType = (Enums.LocationType)(LocationType)
     });
 }
Ejemplo n.º 5
0
        private void ShowLocations(Enums.LocationType locationType)
        {
            Title.Content   = EnumHelper.Description(locationType);
            MyMap.ZoomLevel = locationType == Enums.LocationType.Base ? 7 : 12;
            MyMap.Center    = locationType == Enums.LocationType.Base
                ? new Location(49.930999, 50.903586)
                : new Location(51.227339, 51.381180);
            var mapButtons = new MapButtons(25, 25, MyMap);
            var canvasList = mapButtons.GetList(locationType);

            foreach (var canvas in canvasList)
            {
                MyMap.Children.Add(canvas);
            }
        }