/// <summary>
/// Gets the current state of the radio.
/// </summary>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public RadioState State
{
/// -or- <br/>
/// <paramref name="value"/> is greater than <see cref="Range.Max"/> of <see cref="FrequencyRange"/>.
/// </exception>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public int Frequency
{
/// <summary>
/// Gets the current signal strength in the range of -128 ~ 128 dBm.
/// </summary>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public int SignalStrength
{
/// true if the radio is muted; otherwise, false.
/// The default is false.
/// </value>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public bool IsMuted
{
/// <summary>
/// Gets the channel spacing for the current region.
/// </summary>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public int ChannelSpacing
{
/// -or-<br/>
/// <paramref name="value"/> is greater than 1.0.
/// </exception>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public float Volume
{
/// <summary>
/// Gets the frequency for the region in the range of 87500 ~ 108000 kHz.
/// </summary>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public Range FrequencyRange
{
/// </summary>
/// <remarks>The radio must be in the <see cref="RadioState.Ready"/> state.</remarks>
/// <exception cref="InvalidOperationException">The radio is not in the valid state.</exception>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public void Start()
{
/// </summary>
/// <remarks>The radio must be in the <see cref="RadioState.Playing"/> state.</remarks>
/// <exception cref="InvalidOperationException">The radio is not in the valid state.</exception>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public void Stop()
{
/// </summary>
/// <remarks>The radio must be in the <see cref="RadioState.Ready"/> or <see cref="RadioState.Playing"/> state.</remarks>
/// <exception cref="InvalidOperationException">The radio is not in the valid state.</exception>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <seealso cref="ScanUpdated"/>
/// <seealso cref="ScanCompleted"/>
/// <since_tizen> 3 </since_tizen>
/// </summary>
/// <remarks>The radio must be in the <see cref="RadioState.Scanning"/> state.</remarks>
/// <exception cref="InvalidOperationException">The radio is not in the valid state.</exception>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <seealso cref="ScanStopped"/>
/// <since_tizen> 3 </since_tizen>
public void StopScan()
/// -or-<br/>
/// Seeking is in progress.
/// </exception>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public Task<int> SeekUpAsync()
{
/// -or-<br/>
/// Seeking is in progress.
/// </exception>
+ /// <exception cref="ObjectDisposedException">The radio already has been disposed.</exception>
/// <since_tizen> 3 </since_tizen>
public Task<int> SeekDownAsync()
{
private void ValidateRadioState(params RadioState[] required)
{
+ ValidateNotDisposed();
+
RadioState curState = State;
if (required.Contains(curState) == false)
{
Dispose(true);
}
+
+ private void ValidateNotDisposed()
+ {
+ if (_disposed)
+ {
+ throw new ObjectDisposedException(nameof(Radio));
+ }
+ }
#endregion
}
}