public void FindAccessPoints(object sender, System.EventArgs e) { UpdateStatus("Getting available access points", ""); var task = AccessPointHelper.FindAccessPoints(_AvailableAccessPoints); task.ContinueWith(t => { HandleException(t.Exception); }, TaskContinuationOptions.OnlyOnFaulted); }
async void WifiFindAccessPoints(object sender, EventArgs e) { UpdateStatus("WifiFindAccessPoints", ""); _AvailableAccessPoints.Clear(); IEnumerable <AccessPoint> accessPoints = await AccessPointHelper.FindAccessPoints(); foreach (AccessPoint accessPoint in accessPoints) { _AvailableAccessPoints.Add(accessPoint); } HandleState(State.AccessPointsEnumerated); UpdateStatus("WifiFindAccessPoints", "Enumerated"); }
public MainPage() { InitializeComponent(); _connectButton.IsEnabled = false; _availableAccessPointListView.ItemsSource = _AvailableAccessPoints; _availableNetworkListView.ItemsSource = _AvailableNetworks; AccessPointHelper.AccessPointConnectedEvent += AccessPointHelper_AccessPointConnectedEvent; AccessPointHelper.AccessPointsEnumeratedEvent += AccessPointHelper_AccessPointsEnumeratedEvent; AccessPointHelper.ClientNetworkConnectedEvent += AccessPointHelper_ClientNetworkConnectedEvent; AccessPointHelper.ClientNetworksEnumeratedEvent += AccessPointHelper_ClientNetworksEnumeratedEvent; AccessPointsScanned = false; AccessPointConnected = false; ClientNetworkConnected = false; ClientNetworksEnumerated = false; _clientNetworkPassword.IsEnabled = false; _connectClientNetwork.IsEnabled = false; _connectButton.IsEnabled = false; _requestClientNetworks.IsEnabled = false; _ScanApsGrouping.OutlineColor = Color.Yellow; _ConnectApGrouping.OutlineColor = Color.Default; _NetworksGrouping.OutlineColor = Color.Default; _DisconnectGrouping.OutlineColor = Color.Default; _ConnectGrouping.OutlineColor = Color.Default; _StatusAction = ""; _StatusResult = ""; #if AUTOMATE_FOR_TESTING AccessPointHelper.FindAccessPoints(_AvailableAccessPoints); #endif }