예제 #1
0
        private async void OnUpdateButtonClick(object sender, RoutedEventArgs e)
        {
            WifiNetworkInfo info = ComboBoxWifi.SelectedItem as WifiNetworkInfo;

            if (info != null && info.SSID == "disabled")
            {
                info = null;
            }

            device.CameraInfo.WifiNetwork = info;

            string error = await device.UpdateWifiSettings();

            if (error != null)
            {
                ShowError(error);
                return;
            }

            if (CheckBoxAll.IsChecked == true)
            {
                await UpdateWifiOnAllCameras(info);
            }

            this.CloseCurrentFlyout();
        }
예제 #2
0
 private async Task UpdateWifiOnAllCameras(WifiNetworkInfo info)
 {
     foreach (var camera in DataStore.Instance.Cameras)
     {
         if (camera != this.device.CameraInfo)
         {
             FoscamDevice temp = new FoscamDevice()
             {
                 CameraInfo = camera
             };
             if (camera.WifiNetwork == null || camera.WifiNetwork.SSID != info.SSID || camera.WifiPassword != device.CameraInfo.WifiPassword)
             {
                 camera.WifiPassword         = device.CameraInfo.WifiPassword;
                 temp.CameraInfo.WifiNetwork = info;
                 await temp.UpdateWifiSettings();
             }
         }
     }
 }