public override object ConvertTo(
System.ComponentModel.ITypeDescriptorContext context,
System.Globalization.CultureInfo culture,
object value,
Type destinationType
)
{
if ( typeof( string ) == destinationType )
{
Source_Antenna antenna = value as Source_Antenna;
if ( null == antenna )
{
throw new ArgumentException( "Expected a Source_Antenna", "value" );
}
StringBuilder sb = new StringBuilder( );
sb.AppendFormat
(
"{0},{1},{2},{3},{4},{5}", // ,{7}", if with threshold value
antenna.Port,
antenna.State,
antenna.PowerLevel,
antenna.DwellTime,
antenna.NumberInventoryCycles,
antenna.PhysicalPort
//antenna.AntennaSenseThreshold
);
return sb.ToString( );
}
return base.ConvertTo( context, culture, value, destinationType );
}