예제 #1
0
        private void WlanService_WlanConnectionNotification(Wlan.WlanNotificationData notifyData, Wlan.WlanConnectionNotificationData connNotifyData)
        {
            var dot11Ssid = connNotifyData.dot11Ssid;
            var wlanNMAE  = WlanService.GetWlanNameBySsid(dot11Ssid);

            Debug.WriteLine(wlanNMAE);
        }
예제 #2
0
 private void DisconnectButton_OnClick(object sender, RoutedEventArgs e)
 {
     if (sender is FrameworkElement element && element.DataContext is WlanInfoItem wlanInfoItem)
     {
         WlanService.DisConnectToWlan(wlanInfoItem);
     }
 }
예제 #3
0
 public MainWindow()
 {
     InitializeComponent();
     Loaded     += MainWindow_Loaded;
     WlanService = new WlanService();
     WlanService.WlanConnectionNotification += WlanService_WlanConnectionNotification;
     WlanService.WlanNotification           += WlanService_WlanNotification;
     WlanService.WlanReasonNotification     += WlanService_WlanReasonNotification;
 }
예제 #4
0
 private void InitializeServices()
 {
     if (_event != null)
     {
         _event.Dispose();
     }
     _wlan         = WlanService.Instance;
     _wpCollection = WallpaperCollection.ReadXml();
     _event        = new EventService(_wpCollection);
     _event.RegisterEvent();
 }
예제 #5
0
 private void WifiPasswardInputWindow_Comfirmed(object sender, EventArgs e)
 {
     if (sender is WifiPasswardInputWindow wifiInfoWindow)
     {
         var wlanInfoItem   = wifiInfoWindow.WlanInfoItem;
         var connectSuccess = WlanService.ConnectToWlan(wlanInfoItem, wifiInfoWindow.Password, wifiInfoWindow.IsAutoConnect, out var errorMsg);
         if (!connectSuccess)
         {
             MessageBox.Show(errorMsg);
         }
     }
 }