Exemplo n.º 1
0
        private void AddRouteClick(object sender, RoutedEventArgs e)
        {
            var route = new Route(Route.RouteType.Static)
            {
                NetworkAddress = IPAddress.Parse("192.168.10.1"),
                NetworkMask    = IPAddress.Parse("255.255.255.0"),
                NextHop        = null
            };
            var routeDetailWindow = new RouteDetail(route);

            routeDetailWindow.ShowDialog();
        }
Exemplo n.º 2
0
        private void RouteDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (sender != null)
            {
                var row = sender as DataGridRow;

                if (row?.DataContext is Route route)
                {
                    var routeDetailWindow = new RouteDetail(route);
                    routeDetailWindow.ShowDialog();
                }
            }
        }
Exemplo n.º 3
0
        private void AddRouteClick(object sender, RoutedEventArgs e)
        {
            var route = new Route(Route.RouteType.Static)
            {
                NetworkAddress = IPAddress.Parse("192.168.10.1"),
                NetworkMask    = IPAddress.Parse("255.255.255.0"),
                NextHop        = null
            };
            var routeDetailWindow = new RouteDetail(route);

            routeDetailWindow.ShowDialog();

            if (!CurrentApp.RouterInstance.Routes.Contains(route))
            {
                CurrentApp.RouterInstance.Routes.Add(route);
            }

            RoutingTable.Items.Refresh();
        }