コード例 #1
0
        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);
        }
コード例 #2
0
 public WirelessStateResults StartOperation(
     UIDevice device,
     AOComplete completeFunc,
     bool fIgnoreErrors)
 {
     this.ResetState(fIgnoreErrors);
     WirelessStates[] states;
     if (device.SupportsWirelessSetupMethod1)
     {
         states = this._clearWirelessSettingsStatesMethod1;
     }
     else if (device.SupportsWirelessSetupMethod2)
     {
         states = this._clearWirelessSettingsStatesMethod2;
     }
     else
     {
         ShipAssert.Assert(false);
         return(WirelessStateResults.Error);
     }
     return(this.StartOperation(device, completeFunc, states));
 }