internal void Save(XmlWriter xmlw, DataTable table)
{
this._xmlw = DataTextWriter.CreateWriter(xmlw);
this._xmlw.WriteStartElement("diffgr", "diffgram", "urn:schemas-microsoft-com:xml-diffgram-v1");
this._xmlw.WriteAttributeString("xmlns", "msdata", null, "urn:schemas-microsoft-com:xml-msdata");
if (!this.EmptyData())
{
if (table != null)
{
new XmlDataTreeWriter(table, this._writeHierarchy).SaveDiffgramData(this._xmlw, this.rowsOrder);
}
else
{
new XmlDataTreeWriter(this._ds).SaveDiffgramData(this._xmlw, this.rowsOrder);
}
if (table == null)
{
for (int i = 0; i < this._ds.Tables.Count; i++)
{
this.GenerateTable(this._ds.Tables[i]);
}
}
else
{
for (int j = 0; j < this._tables.Count; j++)
{
this.GenerateTable((DataTable)this._tables[j]);
}
}
if (this.fBefore)
{
this._xmlw.WriteEndElement();
}
if (table == null)
{
for (int k = 0; k < this._ds.Tables.Count; k++)
{
this.GenerateTableErrors(this._ds.Tables[k]);
}
}
else
{
for (int m = 0; m < this._tables.Count; m++)
{
this.GenerateTableErrors((DataTable)this._tables[m]);
}
}
if (this.fErrors)
{
this._xmlw.WriteEndElement();
}
}
this._xmlw.WriteEndElement();
this._xmlw.Flush();
}