static bool?ConvertToNullableBoolean(DOT11_RADIO_STATE source) { return(source switch { DOT11_RADIO_STATE.dot11_radio_state_on => true, DOT11_RADIO_STATE.dot11_radio_state_off => false, _ => (bool?)null, });
private static bool TurnInterfaceRadio(Guid interfaceId, DOT11_RADIO_STATE radioState) { using (var client = new Base.WlanClient()) { var phyRadioState = new WLAN_PHY_RADIO_STATE { dot11SoftwareRadioState = radioState, }; return(Base.SetPhyRadioState(client.Handle, interfaceId, phyRadioState)); } }
private static bool?ConvertToNullableBoolean(DOT11_RADIO_STATE source) { switch (source) { case DOT11_RADIO_STATE.dot11_radio_state_on: return(true); case DOT11_RADIO_STATE.dot11_radio_state_off: return(false); default: return(null); } }
private void OnWlanSoftwareRadioStateChanged(object sender, DOT11_RADIO_STATE state) { switch (state) { case DOT11_RADIO_STATE.dot11_radio_state_unknown: Debug.WriteLine("dot11_radio_state_unknown"); break; case DOT11_RADIO_STATE.dot11_radio_state_on: Debug.WriteLine("Software radio_state_on"); break; case DOT11_RADIO_STATE.dot11_radio_state_off: Debug.WriteLine("Software radio_state_off"); break; } }
internal static bool TurnInterfaceRadio(Base.WlanClient client, Guid interfaceId, DOT11_RADIO_STATE radioState) { if (interfaceId == Guid.Empty) { throw new ArgumentException(nameof(interfaceId)); } using (var container = new DisposableContainer <Base.WlanClient>(client)) { var phyRadioState = new WLAN_PHY_RADIO_STATE { dot11SoftwareRadioState = radioState, }; return(Base.SetPhyRadioState(container.Content.Handle, interfaceId, phyRadioState)); } }