1541 {
1543 bool flag = false;
1546 {
1548 }
1549 xmlElement.SetAttribute(
"name", table.EncodedTableName);
1550 if (table.Namespace.Length == 0)
1551 {
1554 while (
string.IsNullOrEmpty(
text))
1555 {
1558 {
1560 break;
1561 }
1562 int num = -1;
1564 {
1566 {
1568 break;
1569 }
1570 }
1571 if (num == -1)
1572 {
1573 break;
1574 }
1577 }
1578 if (table.Namespace !=
text)
1579 {
1580 xmlElement.SetAttribute(
"form",
"unqualified");
1582 }
1583 }
1584 if (table.ShouldSerializeCaseSensitive())
1585 {
1586 xmlElement.SetAttribute(
"CaseSensitive",
"urn:schemas-microsoft-com:xml-msdata", table.CaseSensitive.ToString());
1587 }
1588 if (table.ShouldSerializeLocale())
1589 {
1590 xmlElement.SetAttribute(
"Locale",
"urn:schemas-microsoft-com:xml-msdata", table.Locale.ToString());
1591 }
1593 DataColumnCollection
columns = table.Columns;
1597 {
1599 {
1601 if (
dataColumn.ColumnMapping == MappingType.Hidden)
1602 {
1605 {
1607 {
1609 }
1610 }
1611 }
1612 if (
dataColumn.ColumnMapping == MappingType.Element)
1613 {
1615 }
1616 }
1617 }
1618 if (table._repeatableElement &&
num2 == 1)
1619 {
1623 {
1625 }
1628 }
1631 {
1633 if (string.IsNullOrEmpty(table.TypeName.Namespace))
1634 {
1636 }
1638 {
1640 }
1641 xmlElement2.SetAttribute(
"name", table.TypeName.Name);
1642 }
1643 else
1644 {
1646 }
1648 {
1649 xmlElement.SetAttribute(
"type", NewDiffgramGen.QualifiedName((
string)
_prefixes[table.TypeName.Namespace], table.TypeName.Name));
1650 }
1652 DataColumn
xmlText = table.XmlText;
1654 {
1657 {
1659 }
1660 else
1661 {
1663 }
1666 {
1668 }
1669 if (!
xmlText.DefaultValueIsNull)
1670 {
1672 xmlElement5.SetAttribute(
"DefaultValue",
"urn:schemas-microsoft-com:xml-msdata",
xmlText.ConvertObjectToXml(
xmlText.DefaultValue));
1673 }
1674 xmlElement5.SetAttribute(
"ColumnName",
"urn:schemas-microsoft-com:xml-msdata",
xmlText.ColumnName);
1681 }
1682 xmlElement4 =
dc.CreateElement(
"xs",
"sequence",
"http://www.w3.org/2001/XMLSchema");
1686 {
1689 {
1694 }
1695 }
1697 {
1700 {
1702 {
1703 continue;
1704 }
1708 {
1709 xmlElement8 =
dc.CreateElement(
"xs",
"element",
"http://www.w3.org/2001/XMLSchema");
1711 }
1713 {
1714 xmlElement8 =
dc.CreateElement(
"xs",
"element",
"http://www.w3.org/2001/XMLSchema");
1716 }
1717 else
1718 {
1720 }
1722 {
1724 xmlElement8.SetAttribute(
"maxOccurs",
"unbounded");
1725 }
1727 {
1729 }
1730 else
1731 {
1733 {
1735 }
1736 xmlElement8 =
dc.CreateElement(
"xs",
"element",
"http://www.w3.org/2001/XMLSchema");
1739 }
1741 {
1747 }
1748 }
1749 }
1751 {
1753 }
1754 ConstraintCollection
constraints = table.Constraints;
1757 {
1760 }
1762 {
1765 {
1768 {
1769 continue;
1770 }
1772 xmlElement11 =
dc.CreateElement(
"xs",
"unique",
"http://www.w3.org/2001/XMLSchema");
1774 {
1776 }
1779 {
1781 }
1787 {
1788 xmlElement11.SetAttribute(
"PrimaryKey",
"urn:schemas-microsoft-com:xml-msdata",
"true");
1789 }
1791 {
1794 {
1797 {
1800 {
1802 }
1804 }
1805 else
1806 {
1808 }
1810 {
1812 }
1816 }
1817 }
1819 }
1820 else
1821 {
1823 {
1824 continue;
1825 }
1828 {
1829 continue;
1830 }
1836 {
1837 xmlElement11 =
dc.CreateElement(
"xs",
"key",
"http://www.w3.org/2001/XMLSchema");
1840 {
1841 xmlElement11.SetAttribute(
"TableNamespace",
"urn:schemas-microsoft-com:xml-msdata", table.Namespace);
1842 }
1843 xmlElement12 =
dc.CreateElement(
"xs",
"selector",
"http://www.w3.org/2001/XMLSchema");
1847 {
1850 {
1853 {
1856 {
1858 }
1860 }
1861 else
1862 {
1864 }
1866 {
1868 }
1872 }
1873 }
1875 }
1876 xmlElement11 =
dc.CreateElement(
"xs",
"keyref",
"http://www.w3.org/2001/XMLSchema");
1879 {
1881 }
1883 {
1885 }
1886 else
1887 {
1889 }
1892 {
1894 }
1896 {
1897 xmlElement11.SetAttribute(
"ConstraintOnly",
"urn:schemas-microsoft-com:xml-msdata",
"true");
1898 }
1899 else
1900 {
1902 {
1903 xmlElement11.SetAttribute(
"IsNested",
"urn:schemas-microsoft-com:xml-msdata",
"true");
1904 }
1907 {
1909 }
1910 }
1911 xmlElement12 =
dc.CreateElement(
"xs",
"selector",
"http://www.w3.org/2001/XMLSchema");
1915 {
1917 }
1919 {
1921 }
1923 {
1925 }
1928 {
1931 {
1934 {
1937 {
1939 }
1941 }
1942 else
1943 {
1945 }
1947 {
1949 }
1953 }
1954 }
1956 }
1957 }
1960 }
virtual bool Contains(object? item)
DataTableCollection Tables
int InternalIndexOf(string tableName)
static void ValidateColumnMapping(Type columnType)
readonly ArrayList _tables
static string TranslateRule(Rule rule)
static string XmlDataTypeName(Type type)
void HandleColumnType(DataColumn col, XmlDocument dc, XmlElement root, XmlElement schema)
XmlElement HandleColumn(DataColumn col, XmlDocument dc, XmlElement schema, bool fWriteOrdinal)
XmlElement GetSchema(string NamespaceURI)
static string TranslateAcceptRejectRule(AcceptRejectRule rule)
void AddXdoProperties(object instance, XmlElement root, XmlDocument xd)
void AddColumnProperties(DataColumn col, XmlElement root)
XmlElement HandleRelation(DataRelation rel, XmlDocument dc)
readonly SchemaFormat _schFormat
bool IsAutoGenerated(object o)
static void AddExtendedProperties(PropertyCollection props, XmlElement node)
XmlElement _constraintSeparator
XmlElement FindTypeNode(XmlElement node, string strType)
XmlElement HandleTable(DataTable table, XmlDocument dc, XmlElement schema)
bool HasMixedColumns(DataTable table)
static CultureInfo InvariantCulture
static ? string EncodeLocalName(string? name)
XmlElement CreateElement(string name)
virtual void SetAttribute(string name, string? value)
virtual ? XmlNode AppendChild(XmlNode newChild)
virtual ? XmlNode PrependChild(XmlNode newChild)
virtual ? XmlNode InsertAfter(XmlNode newChild, XmlNode? refChild)
virtual ? XmlNode InsertBefore(XmlNode newChild, XmlNode? refChild)
virtual XmlNode RemoveChild(XmlNode oldChild)