System.Xml.XmlDataDocument.CloneTree C# (CSharp) Méthode

CloneTree() private méthode

private CloneTree ( DataPointer other ) : XmlNode
other DataPointer
Résultat XmlNode
        internal XmlNode CloneTree(DataPointer other)
        {
            EnsurePopulatedMode();

            bool oldIgnoreDataSetEvents = _ignoreDataSetEvents;
            bool oldIgnoreXmlEvents = _ignoreXmlEvents;
            bool oldFoliationEnabled = IsFoliationEnabled;
            bool oldAssociateDataRow = _fAssociateDataRow;

            // Caller should ensure that the EnforceConstraints == false. See 60486 for more info about why this was changed from DataSet.EnforceConstraints = false to an assert.
            Debug.Assert(DataSet.EnforceConstraints == false);
            XmlNode newNode;

            try
            {
                _ignoreDataSetEvents = true;
                _ignoreXmlEvents = true;
                IsFoliationEnabled = false;
                _fAssociateDataRow = false;

                // Create the diconnected tree based on the other navigator
                newNode = CloneTreeInternal(other);
                Debug.Assert(newNode != null);

                // Synchronize DataSet from XML
                LoadRows(null, newNode);
                SyncRows(null, newNode, false);
            }
            finally
            {
                _ignoreDataSetEvents = oldIgnoreDataSetEvents;
                _ignoreXmlEvents = oldIgnoreXmlEvents;
                IsFoliationEnabled = oldFoliationEnabled;
                _fAssociateDataRow = oldAssociateDataRow;
            }
            return newNode;
        }
XmlDataDocument