private void OnNotificationReceived(object sender, WLAN_NOTIFICATION_DATA e) { Debug.WriteLine($"NotificationReceived: {(WLAN_NOTIFICATION_ACM)e.NotificationCode}"); switch ((WLAN_NOTIFICATION_ACM)e.NotificationCode) { case WLAN_NOTIFICATION_ACM.wlan_notification_acm_scan_list_refresh: NetworkRefreshed?.Invoke(this, EventArgs.Empty); break; case WLAN_NOTIFICATION_ACM.wlan_notification_acm_network_available: case WLAN_NOTIFICATION_ACM.wlan_notification_acm_network_not_available: case WLAN_NOTIFICATION_ACM.wlan_notification_acm_start: case WLAN_NOTIFICATION_ACM.wlan_notification_acm_end: AvailabilityChanged?.Invoke(this, EventArgs.Empty); break; case WLAN_NOTIFICATION_ACM.wlan_notification_acm_interface_arrival: case WLAN_NOTIFICATION_ACM.wlan_notification_acm_interface_removal: InterfaceChanged?.Invoke(this, EventArgs.Empty); break; case WLAN_NOTIFICATION_ACM.wlan_notification_acm_connection_complete: case WLAN_NOTIFICATION_ACM.wlan_notification_acm_disconnected: ConnectionChanged?.Invoke(this, EventArgs.Empty); break; case WLAN_NOTIFICATION_ACM.wlan_notification_acm_profile_change: case WLAN_NOTIFICATION_ACM.wlan_notification_acm_profile_name_change: ProfileChanged?.Invoke(this, EventArgs.Empty); break; } }
private void OnDataChanged() { if (initialized && ipValidInput && subnetMaskValidInput) { InterfaceChanged?.Invoke(labelName.Text, IPAddress.Parse(textBoxIpAddress.Text), IPAddress.Parse(textBoxSubnetMask.Text)); } }
public async Task ScanNetworkAsync(TimeSpan timeout) { // Netsh has no function to directly prompt to scan wireless LANs. await DeferAsync(() => { NetworkRefreshed?.Invoke(this, EventArgs.Empty); AvailabilityChanged?.Invoke(this, EventArgs.Empty); InterfaceChanged?.Invoke(this, EventArgs.Empty); }); }
public async Task ScanNetworkAsync(TimeSpan timeout) { await Task.Delay(TimeSpan.FromSeconds(1)); // Dummy deferTask = DeferAsync(() => { NetworkRefreshed?.Invoke(this, EventArgs.Empty); AvailabilityChanged?.Invoke(this, EventArgs.Empty); InterfaceChanged?.Invoke(this, EventArgs.Empty); }); }
/// <summary> /// Handler for the InterfaceChanged event of an InterfaceConfigControl. /// </summary> /// <param name="InterfaceName">The name of the interface</param> /// <param name="IpAddress">The IP address of the interface</param> /// <param name="SubnetMask">The subnet mask of the interface</param> private void InterfaceConfigControl_InterfaceChanged(string InterfaceName, IPAddress IpAddress, IPAddress SubnetMask) { InterfaceChanged?.Invoke(InterfaceName, IpAddress, SubnetMask); }