public MoveToFollowing ( string localName, string namespaceURI, |
||
localName | string | |
namespaceURI | string | |
end | ||
return | bool |
public virtual bool MoveToFollowing(string localName, string namespaceURI, XPathNavigator end)
{
XPathNavigator navSave = Clone();
if (end != null)
{
switch (end.NodeType)
{
case XPathNodeType.Attribute:
case XPathNodeType.Namespace:
// Scan until we come to the next content-typed node
// after the attribute or namespace node
end = end.Clone();
end.MoveToNonDescendant();
break;
}
}
switch (NodeType)
{
case XPathNodeType.Attribute:
case XPathNodeType.Namespace:
if (!MoveToParent())
{
return false;
}
break;
}
do
{
if (!MoveToFirstChild())
{
// Look for next sibling
while (true)
{
if (MoveToNext())
break;
if (!MoveToParent())
{
// Restore previous position and return false
MoveTo(navSave);
return false;
}
}
}
// Have we reached the end of the scan?
if (end != null && IsSamePosition(end))
{
// Restore previous position and return false
MoveTo(navSave);
return false;
}
}
while (NodeType != XPathNodeType.Element
|| localName != LocalName
|| namespaceURI != NamespaceURI);
return true;
}
XPathNavigator::MoveToFollowing ( XPathNodeType type ) : bool | |
XPathNavigator::MoveToFollowing ( XPathNodeType type, |
|
XPathNavigator::MoveToFollowing ( string localName, string namespaceURI ) : bool |
public IList<string> GrabBackDropUrls(XPathNavigator nav) { List<string> urls = new List<string>(); XPathNodeIterator nIter = nav.SelectChildren("backdrop", ""); if (nav.MoveToFollowing("backdrop", "")) { XPathNavigator localNav = nav.CreateNavigator(); nav.MoveToParent(); for (int i = 0; i < nIter.Count; i++) { if (localNav.GetAttribute("size", "").ToUpperInvariant().Equals("original".ToUpperInvariant())) urls.Add(localNav.Value); localNav.MoveToNext(); } } return urls; }