System.Xml.DataSetMapper.GetColumnSchemaForNode C# (CSharp) Méthode

GetColumnSchemaForNode() private méthode

private GetColumnSchemaForNode ( XmlBoundElement rowElem, XmlNode node ) : DataColumn
rowElem XmlBoundElement
node XmlNode
Résultat System.Data.DataColumn
        internal DataColumn GetColumnSchemaForNode(XmlBoundElement rowElem, XmlNode node)
        {
            Debug.Assert(rowElem != null);
            // The caller must make sure that node is not a row-element
            Debug.Assert((node is XmlBoundElement) ? ((XmlBoundElement)node).Row == null : true);

            object tid = GetIdentity(rowElem.LocalName, rowElem.NamespaceURI);
            object cid = GetIdentity(node.LocalName, node.NamespaceURI);

            Hashtable columns = (Hashtable)_columnSchemaMap[tid];
            if (columns != null)
            {
                DataColumn col = (DataColumn)(columns[cid]);
                if (col == null)
                {
                    return null;
                }

                MappingType mt = col.ColumnMapping;

                if (node.NodeType == XmlNodeType.Attribute && mt == MappingType.Attribute)
                {
                    return col;
                }

                if (node.NodeType == XmlNodeType.Element && mt == MappingType.Element)
                {
                    return col;
                }

                // node's (localName, ns) matches a column, but the MappingType is different (i.e. node is elem, MT is attr)
                return null;
            }
            return null;
        }
        internal DataTable GetTableSchemaForElement(XmlElement elem)