Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FillDataSetElement()

XmlElement System.Data.XmlTreeGen.FillDataSetElement ( XmlDocument xd,
DataSet ds,
DataTable dt )
inlinepackage

Definition at line 870 of file XmlTreeGen.cs.

871 {
872 DataSet dataSet = ((ds != null) ? ds : dt.DataSet);
873 if (dataSet != null)
874 {
876 _dsElement.SetAttribute("IsDataSet", "urn:schemas-microsoft-com:xml-msdata", "true");
877 if (ds == null)
878 {
879 _dsElement.SetAttribute("MainDataTable", "urn:schemas-microsoft-com:xml-msdata", XmlConvert.EncodeLocalName((dt.Namespace.Length == 0) ? dt.TableName : (dt.Namespace + ":" + dt.TableName)));
880 }
881 if (dataSet.CaseSensitive)
882 {
883 _dsElement.SetAttribute("CaseSensitive", "urn:schemas-microsoft-com:xml-msdata", "true");
884 }
885 if (dataSet.ShouldSerializeLocale() || !dataSet.Locale.Equals(CultureInfo.CurrentCulture))
886 {
887 _dsElement.SetAttribute("Locale", "urn:schemas-microsoft-com:xml-msdata", dataSet.Locale.ToString());
888 }
889 else
890 {
891 _dsElement.SetAttribute("UseCurrentLocale", "urn:schemas-microsoft-com:xml-msdata", "true");
892 }
893 }
894 else if (dt != null)
895 {
896 _dsElement.SetAttribute("name", XmlConvert.EncodeLocalName("NewDataSet"));
897 _dsElement.SetAttribute("IsDataSet", "urn:schemas-microsoft-com:xml-msdata", "true");
898 _dsElement.SetAttribute("MainDataTable", "urn:schemas-microsoft-com:xml-msdata", XmlConvert.EncodeLocalName((dt.Namespace.Length == 0) ? dt.TableName : (dt.Namespace + ":" + dt.TableName)));
899 if (dt.CaseSensitive)
900 {
901 _dsElement.SetAttribute("CaseSensitive", "urn:schemas-microsoft-com:xml-msdata", "true");
902 }
903 if (dt.ShouldSerializeLocale() || !dt.Locale.Equals(CultureInfo.CurrentCulture))
904 {
905 _dsElement.SetAttribute("Locale", "urn:schemas-microsoft-com:xml-msdata", dt.Locale.ToString());
906 }
907 else
908 {
909 _dsElement.SetAttribute("UseCurrentLocale", "urn:schemas-microsoft-com:xml-msdata", "true");
910 }
911 }
912 XmlElement xmlElement = xd.CreateElement("xs", "complexType", "http://www.w3.org/2001/XMLSchema");
914 XmlElement xmlElement2 = xd.CreateElement("xs", "choice", "http://www.w3.org/2001/XMLSchema");
915 xmlElement2.SetAttribute("minOccurs", "0");
916 xmlElement2.SetAttribute("maxOccurs", "unbounded");
917 xmlElement.AppendChild(xmlElement2);
918 return xmlElement2;
919 }
static CultureInfo CurrentCulture
static ? string EncodeLocalName(string? name)
Definition XmlConvert.cs:49
virtual void SetAttribute(string name, string? value)
virtual ? XmlNode AppendChild(XmlNode newChild)
Definition XmlNode.cs:739

References System.Data.XmlTreeGen._dsElement, System.Xml.XmlNode.AppendChild(), System.Globalization.CultureInfo.CurrentCulture, System.Xml.Dictionary, System.Xml.XmlConvert.EncodeLocalName(), and System.Xml.XmlElement.SetAttribute().

Referenced by System.Data.XmlTreeGen.SchemaTree(), and System.Data.XmlTreeGen.SchemaTree().