public override object ConvertTo(
System.ComponentModel.ITypeDescriptorContext context,
System.Globalization.CultureInfo culture,
object value,
Type destinationType
)
{
if ( typeof( string ) == destinationType )
{
Source_FrequencyBandList channelList = value as Source_FrequencyBandList;
if ( null == channelList )
{
throw new ArgumentException( "Expected a Source_FrequencyBandList", "value" );
}
StringBuilder sb = new StringBuilder( );
foreach ( Source_FrequencyBand channel in channelList )
{
Object obj = TypeDescriptor.GetConverter( typeof( Source_FrequencyBand ) ).ConvertToString( channel );
if ( null == obj )
{
// Should NOT be possible ~ should get exception for bad arg
// before seeing a null == obj return value
}
else
{
sb.Append( obj as String );
sb.Append( ';' );
}
}
return sb.ToString( );
}
return base.ConvertTo( context, culture, value, destinationType );
}