Example #1
0
        /// <summary>
        /// An asynchronous operation that attempts to set the state of the radio represented by this object.
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        /// <remarks>
        /// <para/><list type="table">
        /// <listheader><term>Platform</term><description>Version supported</description></listheader>
        /// <item><term>Android</term><description>Android 4.4 and later</description></item>
        /// <item><term>Windows UWP</term><description>Windows 10</description></item>
        /// <item><term>Windows (Desktop Apps)</term><description>Windows 7 or later</description></item></list>
        /// </remarks>
        public async Task <RadioAccessStatus> SetStateAsync(RadioState value)
        {
#if WINDOWS_UWP
            return((RadioAccessStatus)((int)await _radio.SetStateAsync((Windows.Devices.Radios.RadioState)((int)value))));
#elif __ANDROID__ || WIN32
            return(await DoSetStateAsync(value));
#else
            return(RadioAccessStatus.Unspecified);
#endif
        }
Example #2
0
        /// <summary>
        /// An asynchronous operation that attempts to set the state of the radio represented by this object.
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        /// <remarks>
        /// <para/><list type="table">
        /// <listheader><term>Platform</term><description>Version supported</description></listheader>
        /// <item><term>Android</term><description>Android 4.4 and later</description></item>
        /// <item><term>Windows UWP</term><description>Windows 10</description></item>
        /// <item><term>Windows (Desktop Apps)</term><description>Windows 7 or later</description></item></list>
        /// </remarks>
        public Task <RadioAccessStatus> SetStateAsync(RadioState value)
        {
#if WINDOWS_UWP
            return(Task <RadioAccessStatus> .Run(async() =>
            {
                return (RadioAccessStatus)((int)await _radio.SetStateAsync((Windows.Devices.Radios.RadioState)((int)value)));
            }));
#elif __ANDROID__ || WIN32
            return(DoSetStateAsync(value));
#else
            return(Task.FromResult(RadioAccessStatus.Unspecified));
#endif
        }
Example #3
0
 private async Task <RadioAccessStatus> DoSetStateAsync(RadioState state)
 {
     return((RadioAccessStatus)((int)await _radio.SetStateAsync((Windows.Devices.Radios.RadioState)((int)state))));
 }