コード例 #1
0
        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
                });
            }
        }
コード例 #2
0
        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));
        }