private void AddOrUpdateConnection(IPHelper.I_OWNER_MODULE b) { var ic = _connectionsRoutes.Count % LineChart.ColorsDic.Count; var br = new SolidColorBrush(LineChart.ColorsDic[ic]); GeoConnection existingRoute = _connectionsRoutes.SingleOrDefault(l => l.RemoteAddress.Equals(b.RemoteAddress)); if (existingRoute == null) { _connectionsRoutes.Add(new GeoConnection(b) { Brush = br }); } }
async void Map_Loaded(object sender, RoutedEventArgs e) { if (!GeoConnection.CheckDB()) { MessageBox.Show("The IP database cannot be found. The Map feature is disabled.", "Missing database"); return; } var ok = await GeoConnection.InitCache(); initialPoint.SetValue(MapLayer.PositionProperty, CurrentCoordinates); ProgressStack.Visibility = Visibility.Collapsed; timer.Tick += timer_Tick; await Dispatcher.InvokeAsync(() => timer_Tick(null, null)); }