public void WriteXml(XmlWriter writer, XmlWriteMode mode)
{
long logScopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.WriteXml|API> {0}, mode={1}", ObjectID, mode);
try
{
// Generate SchemaTree and write it out
if (writer != null)
{
if (mode == XmlWriteMode.DiffGram)
{
// Create and save the updates
new NewDiffgramGen(this).Save(writer);
}
else
{
// Create and save xml data
new XmlDataTreeWriter(this).Save(writer, mode == XmlWriteMode.WriteSchema);
}
}
}
finally
{
DataCommonEventSource.Log.ExitScope(logScopeId);
}
}