Example #1
0
        private async void UpdateInterfaceComboBox()
        {
            interfaces = await Task.Run(() => (AnalyzerFacade.GetInterfaces()));

            interfaceNames = interfaces.GetInterfaceNames();
            ComBxInterfaces.ItemsSource = interfaceNames;
            if (interfaceNames.Count > 0)
            {
                ComBxInterfaces.SelectedIndex = 0;
            }
        }
Example #2
0
        private async void UpdateStations()
        {
            int selectedIndex = ComBxInterfaces.SelectedIndex;

            if (selectedIndex != -1)
            {
                string intfaceName = interfaceNames[selectedIndex];
                if (intfaceName != null || intfaceName != "")
                {
                    if (stations != null)
                    {
                        stations.StationList.Clear();
                    }
                    stations = null;
                    stations = await Task.Run(() => (AnalyzerFacade.GetStations(intfaceName)));
                }
                else
                {
                    stations = null;
                }

                if (stations != null)
                {
                    if (apNames != null)
                    {
                        apNames.Clear();
                    }
                    apNames = null;
                    apNames = await Task.Run(() => stations.GetSSIDNames());

                    TbInterfaceDesc.Text = interfaces.InterfaceList[selectedIndex].Description;
                    if (!stations.PoweredDown)
                    {
                        TbMsg.Text = stations.Message;
                        gin.Clear();
                        foreach (var station in stations.StationList)
                        {
                            if (station.GetChannelSignalPair() != null)
                            {
                                gin.Add(new GraphInput(station.Name, station.GetChannelSignalPair()));
                            }
                        }
                        gout = graphMan.GetGraphOutput(gin);
                        foreach (var graphOut in gout)
                        {
                            CanvasGraph.Children.Add(graphOut.GraphLabel);
                            CanvasGraph.Children.Add(graphOut.GraphPolygon);
                        }
                    }
                    else
                    {
                        TbMsg.Text = "Wireless network service is currently powered down";
                    }
                }
                else
                {
                    apNames = null;
                }
                LstBxAPs.ItemsSource = apNames;
            }
            else
            {
                return;
            }
        }