public void SerializeUserReport( Wrappers.WrappedValidationMessageLevel activityReportLevel, System.String message) { if (this.m_parentSession.ResultsGatheringPaused) return; if (this.m_serializationWriter == null) return; DvtkData.Activities.UserActivityReport userActivityReport = new DvtkData.Activities.UserActivityReport(); userActivityReport.Message = DvtToXml.ConvertString(message,false); userActivityReport.Level = _Convert(activityReportLevel); UInt32 messageIndex = 0; switch(userActivityReport.Level) { case DvtkData.Activities.ActivityReportLevel.Error: case DvtkData.Activities.ActivityReportLevel.Warning: messageIndex = GetNextMessageIndex(); break; default: break; } // stream user activity to detailed output userActivityReport.DvtDetailToXml(m_serializationWriter.DetailStreamWriter, messageIndex, 0); // stream user activity to summary output userActivityReport.DvtSummaryToXml(m_serializationWriter.SummaryStreamWriter, messageIndex, 0); }
public void SerializeHtmlUserReport( Wrappers.WrappedValidationMessageLevel activityReportLevel, System.String message, bool writeToSummary, bool writeToDetail) { if (this.m_parentSession.ResultsGatheringPaused) return; if (this.m_serializationWriter == null) return; DvtkData.Activities.UserActivityReport userActivityReport = new DvtkData.Activities.UserActivityReport(); userActivityReport.IsHtml = true; // All '[' and ']' will be filtered out. // After this, all '<' will be replaced by '[' and all '>' will be replaced by ']'. message = message.Replace("[", ""); message = message.Replace("]", ""); message = message.Replace("<", "["); message = message.Replace(">", "]"); userActivityReport.Message = DvtToXml.ConvertString(message,false); userActivityReport.Level = _Convert(activityReportLevel); if (writeToDetail) { // stream user activity to detailed output userActivityReport.DvtDetailToXml(m_serializationWriter.DetailStreamWriter, 0, 0); } if (writeToSummary) { // stream user activity to summary output userActivityReport.DvtSummaryToXml(m_serializationWriter.SummaryStreamWriter, 0, 0); } }