/// <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), },
public static List <LocationPoint> GetLocations(Enums.LocationType locationType) { using (var db = new ModelContainer()) { return(db.Locations.Where(x => x.LocationType == locationType).ToList()); } }
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) }); }
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); } }