private String BuildAtml()
{
var tw = new StringWriter();
try
{
var serializerObj = new XmlSerializer( typeof (InstrumentDescription) );
serializerObj.Serialize( tw, InstrumentDescription );
}
catch (Exception e)
{
var error = new StringBuilder( "Error Building ATML Document for the Instrument.\n" );
error.Append( e.Message ).Append( "\n" );
Exception innerException = e.InnerException;
while (innerException != null)
{
error.Append( " * " ).Append( innerException.Message ).Append( "\n" );
innerException = innerException.InnerException;
}
MessageBox.Show( error.ToString() );
}
return tw.ToString();
}