System.Xml.XPath.XPathNavigator.DeleteSelf C# (CSharp) Method

DeleteSelf() public method

public DeleteSelf ( ) : void
return void
        public virtual void DeleteSelf()
        {
            DeleteRange(this);
        }

Usage Example

Example #1
0
        private void DeleteChildren()
        {
            switch (NodeType)
            {
            case XPathNodeType.Namespace:
                throw new InvalidOperationException("Removing namespace node content is not supported.");

            case XPathNodeType.Attribute:
                return;

            case XPathNodeType.Text:
            case XPathNodeType.SignificantWhitespace:
            case XPathNodeType.Whitespace:
            case XPathNodeType.ProcessingInstruction:
            case XPathNodeType.Comment:
                DeleteSelf();
                return;
            }
            if (!HasChildren)
            {
                return;
            }
            XPathNavigator nav = Clone();

            nav.MoveToFirstChild();
            while (!nav.IsSamePosition(this))
            {
                nav.DeleteSelf();
            }
        }
All Usage Examples Of System.Xml.XPath.XPathNavigator::DeleteSelf