public override object ConvertTo(
System.ComponentModel.ITypeDescriptorContext context,
System.Globalization.CultureInfo culture,
object value,
Type destinationType
)
{
if ( typeof( string ) == destinationType )
{
Source_FrequencyBand channel = value as Source_FrequencyBand;
if ( null == channel )
{
throw new ArgumentException( "Expected a Source_FrequencyBand", "value" );
}
StringBuilder sb = new StringBuilder( );
sb.AppendFormat
(
"{0},{1},{2},{3},{4},{5},{6},{7}",
( UInt32 ) channel.band,
channel.state.ToString( ),
( UInt16 ) channel.multiplier,
( UInt16 ) channel.divider,
( UInt16 ) channel.guardBand,
( UInt16 ) channel.maxDACBand,
( UInt16 ) channel.affinityBand,
( UInt16 ) channel.minDACBand
);
return sb.ToString( );
}
return base.ConvertTo( context, culture, value, destinationType );
}