internal void SetMapCenter(object sender, MapLocationEventArgs e) { if (LocationChanged != null) { LocationChanged(sender, e); } }
private void EventPublisher_MainMapLocationChanged(object sender, MapLocationEventArgs e) { if (sender != this) { if (e.OldLocation == null) { // First time the main map has been set var miniMapStart = new Location(DisplayTypes.Shape, e.NewLocation.Point, MiniMapDrawerFactory.MaxZoomLevel); _map.SetCenter(miniMapStart); } else if (e.NewLocation.Zoom != e.OldLocation.Zoom || GetDistance(e.NewLocation, _map.Location) > MoveVisibleRectangleDistance) { _map.SetCenter(e.NewLocation.Point, GetZoomLevel()); _map.Invalidate(false); } else { _map.Invalidate(false); } } else { _map.Invalidate(false); } }
/// <summary> /// New location /// </summary> private void EventPublisher_LocationChanged(object sender, MapLocationEventArgs e) { _updatingZoom = true; ZoomControl.Minimum = e.ZoomInfo.Minimum; ZoomControl.Maximum = e.ZoomInfo.Maximum; ZoomControl.Value = e.NewLocation.Zoom; _updatingZoom = false; }
/// <summary> /// Update visibility of villages after map move /// </summary> private void EventPublisher_LocationChanged(object sender, MapLocationEventArgs e) { var villageDs = (PolygonDataSet)GridExVillage.DataSource; foreach (var record in villageDs.VILLAGE.Rows.OfType <PolygonDataSet.VILLAGERow>()) { record.ISVISIBLE = World.Default.Map.Display.IsVisible(record.Village); } }
private void EventPublisher_LocationChanged(object sender, MapLocationEventArgs e) { foreach (var row in Table.TableModel.Rows.OfType <Row>()) { var twRow = row as ITwContextMenu; if (twRow != null) { row.Cells[0].Image = GetVisibleImage(twRow.GetVillages()); } } }
private void EventPublisher_OwnLocationChanged(object sender, MapLocationEventArgs e) { if (sender != _map) { _mainMap.SetCenter(new Location(e.NewLocation.Display, e.NewLocation.Point, _mainMap.Location.Zoom)); _map.Invalidate(false); } else { _map.Invalidate(false); } }
private void EventPublisher_LocationChanged(object sender, MapLocationEventArgs e) { if (e.IsDisplayChange) { bool isInShapeDisplay = e.NewLocation.Display == DisplayTypes.Shape; ToolStripIconDisplay.CheckState = !isInShapeDisplay ? CheckState.Checked : CheckState.Unchecked; ToolStripShapeDisplay.CheckState = isInShapeDisplay ? CheckState.Checked : CheckState.Unchecked; MenuMapIconDisplay.CheckState = ToolStripIconDisplay.CheckState; MenuMapShapeDisplay.CheckState = ToolStripShapeDisplay.CheckState; } }
private void EventPublisher_LocationChanged(object sender, MapLocationEventArgs e) { Invalidate(); }
private void EventPublisherOnLocationChanged(object sender, MapLocationEventArgs mapLocationEventArgs) { GridExVillage.Refresh(); }
private void EventPublisher_LocationChanged(object sender, MapLocationEventArgs e) { _ruler.ClearCache(); XRuler.Invalidate(); YRuler.Invalidate(); }