Ejemplo n.º 1
0
        public void GetNetworkListDone(bool success)
        {
            if (this.WirelessUnblockPage())
            {
                return;
            }
            WlanProfileList  networkList      = this.wirelessGetNetworkListHelper.NetworkList;
            ArrayListDataSet arrayListDataSet = new ArrayListDataSet();

            if (success && networkList != null)
            {
                foreach (WlanProfile profile in networkList)
                {
                    arrayListDataSet.Add(new WlanCommand(profile));
                }
            }
            if (!success)
            {
                if (string.IsNullOrEmpty(this.wirelessDeviceErrorDescription))
                {
                    this.wirelessDeviceErrorDescription = this.wirelessGetNetworkListHelper.Error;
                }
                if (this.wirelessDeviceErrorCode == HRESULT._S_OK)
                {
                    this.wirelessDeviceErrorCode = this.wirelessGetNetworkListHelper.Hr;
                }
            }
            this.WirelessNetworksList = arrayListDataSet;
        }
Ejemplo n.º 2
0
 private void ResetState()
 {
     if (!this.Idle && !this.Finished)
         return;
     this._computerNetworks = new WlanProfileList();
     this._deviceNetworks = new WlanProfileList();
     this._networkList = new WlanProfileList();
 }
Ejemplo n.º 3
0
 private void ResetState()
 {
     if (!this.Idle && !this.Finished)
     {
         return;
     }
     this._computerProfiles = new WlanProfileList();
     this._connectedNetwork = null;
 }
Ejemplo n.º 4
0
        private void RestoreProfile()
        {
            WlanProfileList list = new WlanProfileList();

            this._device.WiFiProfilesSentEvent += new FallibleEventHandler(this.Device_RestoreDeviceWlanProfilesCompleteEvent);
            if (this._deviceProfile != null)
            {
                list.Add(this._deviceProfile);
            }
            if (this._device.SetWiFiProfileList(list).IsSuccess)
            {
                this._device.SendWiFiProfiles();
            }
            this._restore.WaitOne(5000, false);
            this._device.WiFiProfilesSentEvent -= new FallibleEventHandler(this.Device_RestoreDeviceWlanProfilesCompleteEvent);
        }
Ejemplo n.º 5
0
        private void Device_GetDeviceWlanProfilesCompleteEvent(object sender, FallibleEventArgs args)
        {
            HRESULT hr = args.HR;

            this.SetResult(hr);
            if (hr.IsSuccess)
            {
                WlanProfileList list = new WlanProfileList();
                hr = this._device.GetWiFiProfileList(ref list);
                this._deviceProfile = list.Count <= 0 ? null : list[0];
            }
            if (hr.IsSuccess)
            {
                this.StepComplete(WirelessStateResults.Success);
            }
            else
            {
                this.StepComplete(WirelessStateResults.Error);
            }
        }
Ejemplo n.º 6
0
        protected override WirelessStateResults DoStep(WirelessStates state)
        {
            HRESULT hr;

            switch (state)
            {
            case WirelessStates.CommitProfileToDevice:
                WlanProfileList list = new WlanProfileList();
                list.Add(this._attemptingProfile);
                hr = this._device.SetWiFiProfileList(list);
                if (hr.IsSuccess)
                {
                    hr = this._device.SendWiFiProfiles();
                    break;
                }
                break;

            case WirelessStates.TestDeviceProfile:
                hr = this._device.TestWiFi();
                break;

            case WirelessStates.GetDeviceProfiles:
                hr = this._device.ReceiveWiFiProfiles();
                break;

            case WirelessStates.AssociateWlanDevice:
                hr = this._device.AssociateWiFi();
                break;

            default:
                hr = HRESULT._E_ABORT;
                break;
            }
            if (hr.IsSuccess)
            {
                return(WirelessStateResults.Success);
            }
            this.SetResult(hr);
            return(WirelessStateResults.Error);
        }