protected override WirelessStateResults DoStep(WirelessStates state) { HRESULT hr = state != WirelessStates.GetComputerProfiles ? HRESULT._E_ABORT : this._device.LoadComputerWiFiProfiles(); if (hr.IsSuccess) { return(WirelessStateResults.Success); } this.SetResult(hr); return(WirelessStateResults.Error); }
protected override WirelessStateResults DoStep(WirelessStates state) { HRESULT hr; switch (state) { case WirelessStates.SniffNetworks: hr = this._device.ScanForWiFiNetworks(); break; case WirelessStates.GetComputerProfiles: hr = this._device.LoadComputerWiFiProfiles(); break; default: hr = HRESULT._E_ABORT; break; } if (hr.IsSuccess) return WirelessStateResults.Success; this.SetResult(hr); return WirelessStateResults.Error; }
protected override WirelessStateResults DoStep(WirelessStates state) { HRESULT hr; switch (state) { case WirelessStates.CommitProfileToDevice: hr = this._device.SetWiFiProfileList(new WlanProfileList()); if (hr.IsSuccess) { hr = this._device.SendWiFiProfiles(); break; } break; case WirelessStates.UnassociateWlanDevice: hr = this._device.RemoveWiFiAssociation(); break; case WirelessStates.UnassociateNetwork: hr = this._device.SetWifiMediaSyncSSID(string.Empty); if (hr.IsSuccess || this._fIgnoreErrors) { ShipAssert.Assert(hr.IsSuccess); this.StepComplete(WirelessStateResults.Success); break; } break; default: hr = HRESULT._E_ABORT; break; } if (hr.IsSuccess || this._fIgnoreErrors) { ShipAssert.Assert(hr.IsSuccess); return(WirelessStateResults.Success); } this.SetResult(hr); return(WirelessStateResults.Error); }
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); }
protected abstract WirelessStateResults DoStep(WirelessStates state);