WriteTraceStartElement static method

void WriteTraceStartElement(
  1. XmlWriter writer,
  2. String traceTag,
  3. bool includeVersion
)
Write trace start element. The writer to write the start element to. The trace tag. If true, include build version attribute.

Implementation

//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Exchange.Usage", "EX0009:DoNotUseDateTimeNowOrFromFileTime", Justification = "Client API")]
/* private */
static void WriteTraceStartElement(
    XmlWriter writer, String traceTag, bool includeVersion) {
  writer.WriteStartElement(localName: "Trace");
  writer.WriteAttributeString(localName: "Tag", value: traceTag);
  // todo("add the Thread Id info")
//            writer.WriteAttributeString(localName: "Tid", value: Thread.CurrentThread.ManagedThreadId.ToString());
  writer.WriteAttributeString(
      localName: "Time", value: DateTime.now().toIso8601String());

  if (includeVersion) {
    writer.WriteAttributeString(
        localName: "Version", value: EwsUtilities.BuildVersion);
  }
}