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

MoveToChild() public method

public MoveToChild ( XPathNodeType type ) : bool
type XPathNodeType
return bool
        public virtual bool MoveToChild(XPathNodeType type)
        {
            if (MoveToFirstChild())
            {
                int mask = GetContentKindMask(type);
                do
                {
                    if (((1 << (int)NodeType) & mask) != 0)
                        return true;
                }
                while (MoveToNext());

                MoveToParent();
            }

            return false;
        }

Same methods

XPathNavigator::MoveToChild ( string localName, string namespaceURI ) : bool

Usage Example

Example #1
0
        public CreateCone(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            alineAxis = (Axis)Enum.Parse(typeof(Axis), navigator.GetAttribute("axis", string.Empty));

            //Bottom radius of cylinder
            navigator.MoveToChild("BottomRadius", string.Empty);
            bottomRadius = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent( );

            //Top radius of cylinder
            navigator.MoveToChild("TopRadius", string.Empty);
            topRadius = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent( );

            //Height of cylinder
            navigator.MoveToChild("Height", string.Empty);
            height = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent( );

            //Center of cylinder
            navigator.MoveToChild("Center", string.Empty);
            center   = new Vector3WithUnit( );
            center.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            center.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            center.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent( );
        }
All Usage Examples Of System.Xml.XPath.XPathNavigator::MoveToChild