System.Xml.XmlDataDocument.Foliate C# (CSharp) Method

Foliate() private method

private Foliate ( XmlBoundElement node, ElementState newState ) : void
node XmlBoundElement
newState ElementState
return void
        internal void Foliate(XmlBoundElement node, ElementState newState)
        {
            Debug.Assert(newState == ElementState.WeakFoliation || newState == ElementState.StrongFoliation);
#if DEBUG
            // If we want to strong foliate one of the non-row-elem in a region, then the region MUST be strong-foliated (or there must be no region)
            // Do this only when we are not loading
            if (IsFoliationEnabled)
            {
                if (newState == ElementState.StrongFoliation && node.Row == null)
                {
                    XmlBoundElement rowElem;
                    ElementState rowElemState = ElementState.None;
                    if (_mapper.GetRegion(node, out rowElem))
                    {
                        rowElemState = rowElem.ElementState;
                        Debug.Assert(rowElemState == ElementState.StrongFoliation || rowElemState == ElementState.WeakFoliation);
                    }
                    // Add a no-op, so we can still debug in the assert fails

#pragma warning disable 1717 // assignment to self
                    rowElemState = rowElemState;
#pragma warning restore 1717
                }
            }
#endif

            if (IsFoliationEnabled)
            {
                if (node.ElementState == ElementState.Defoliated)
                {
                    ForceFoliation(node, newState);
                }
                else if (node.ElementState == ElementState.WeakFoliation && newState == ElementState.StrongFoliation)
                {
                    // Node must be a row-elem
                    Debug.Assert(node.Row != null);
                    node.ElementState = newState;
                }
            }
        }

Same methods

XmlDataDocument::Foliate ( XmlElement element ) : void

Usage Example

示例#1
0
        private void AutoFoliate()
        {
            XmlDataDocument doc = (XmlDataDocument)OwnerDocument;

            if (doc != null)
            {
                doc.Foliate(this, doc.AutoFoliationState);
            }
        }
All Usage Examples Of System.Xml.XmlDataDocument::Foliate
XmlDataDocument