/// <summary>The main method for adding an Info message.</summary> private void Info(string sTestName, string stringName, OTTag tag, string sDetails) { if (this.dia != null) { ValidationInfo vi = new ValidationInfo( ValidationInfo.ValInfoType.Info, stringName, tag, sDetails, sTestName); SendInfo(vi); } }
public void ValidatorCallback(ValInfoBasic viBasic) { ValidationInfo vi=new ValidationInfo(viBasic); string sCode = (vi.GetErrorID()!=null)? vi.GetErrorID() : "?????"; string sType = ValInfoTypeToString( vi.GetValInfoType() ); string sTable = (vi.GetOTTag()!=null)? "'"+vi.GetOTTag()+"'" : ""; string sMsg = vi.GetString(); string sDetails = vi.GetDetails(); m_xmlWriter.WriteStartElement("Report"); // I do not know why this try-catch is here. try { m_xmlWriter.WriteAttributeString("ErrorType", sType); m_xmlWriter.WriteAttributeString("ErrorCode", sCode); m_xmlWriter.WriteAttributeString("Message", sMsg); if (sDetails != null) { m_xmlWriter.WriteAttributeString("Details", sDetails); } if (viBasic.TestName != null) { m_xmlWriter.WriteAttributeString("TestName", viBasic.TestName); } } catch(Exception) { Debug.Assert(false); } m_xmlWriter.WriteEndElement(); m_xmlWriter.WriteWhitespace("\r\n"); }
/// <summary>Called when there is a caught exception.</summary> private void ApplicationError(string sTestName, string stringName, OTTag tag, string stringDetails) { if (this.dia != null) { ValidationInfo vi = new ValidationInfo( ValidationInfo.ValInfoType.AppError, stringName, tag, stringDetails, sTestName); SendInfo(vi); } }
private string ValInfoTypeToString( ValidationInfo.ValInfoType vt ) { switch( vt ) { case ValidationInfo.ValInfoType.AppError: return "A"; case ValidationInfo.ValInfoType.Error: return "E"; case ValidationInfo.ValInfoType.Warning: return "W"; case ValidationInfo.ValInfoType.Pass: return "P"; case ValidationInfo.ValInfoType.Info: return "I"; default: return "?"; } }