/// <summary> /// Handles the iteration of the children or qualfier </summary> /// <param name="iterator"> an iterator </param> /// <returns> Returns if there are more elements available. </returns> private bool IterateChildren(IEnumerator iterator) { if (_outerInstance._skipSiblings) { // setSkipSiblings(false); _outerInstance._skipSiblings = false; _subIterator = EmptyList.GetEnumerator(); } // create sub iterator for every child, // if its the first child visited or the former child is finished bool subIteratorMoveNext = _subIterator.MoveNext(); if (!subIteratorMoveNext && iterator.MoveNext()) { XmpNode child = (XmpNode)iterator.Current; _index++; _subIterator = new NodeIterator(_outerInstance, child, _path, _index); } if (subIteratorMoveNext) { _returnProperty = (IXmpPropertyInfo)_subIterator.Current; return(true); } return(false); }
/// <summary> /// Get the value for items with the name without namespace /// </summary> /// <param name="property">IXmpPropertyInfo read from string</param> /// <param name="xmpName">xmpName, for example dc:subject[1]</param> /// <returns>value or null</returns> private static string GetNullNameSpace(IXmpPropertyInfo property, string xmpName) { if (property.Path == xmpName && !string.IsNullOrEmpty(property.Value) && string.IsNullOrEmpty(property.Namespace)) { return(property.Value); } return(null); }
/// <summary>Sets the returnProperty as next item or recurses into <c>hasNext()</c>.</summary> /// <returns>Returns if there is a next item to return.</returns> private bool ReportNode() { _state = IterateChildren; if (_visitedNode.Parent != null && (!_enclosing.Options.IsJustLeafNodes || !_visitedNode.HasChildren)) { _returnProperty = CreatePropertyInfo(_visitedNode, _enclosing.BaseNamespace, _path); return(true); } return(HasNext()); }
/// <summary> /// Get the value for items with the name with a namespace /// </summary> /// <param name="property">IXmpPropertyInfo read from string</param> /// <param name="xmpName">xmpName, for example dc:subject[1]</param> /// <returns>value or null</returns> private string GetContentNameSpace(IXmpPropertyInfo property, string xmpName) { if (property.Path == xmpName && !string.IsNullOrEmpty(property.Value) && !string.IsNullOrEmpty(property.Namespace)) // the difference it this ^^!^^ { return(property.Value); } return(null); }
/// <summary>Calls hasNext() and returns the prepared node.</summary> /// <remarks> /// Calls hasNext() and returns the prepared node. Afterward it's set to null. /// The existence of returnProperty indicates if there is a next node, otherwise /// an exception is thrown. /// </remarks> public virtual object Next() { if (HasNext()) { var result = _returnProperty; _returnProperty = null; return(result); } throw new InvalidOperationException("There are no more nodes to return"); }
/// <summary> /// Sets the returnProperty as next item or recurses into <code>hasNext()</code>. </summary> /// <returns> Returns if there is a next item to return. </returns> protected internal virtual bool ReportNode() { _state = ITERATE_CHILDREN; if (_visitedNode.Parent != null && (!_outerInstance.Options.JustLeafnodes || !_visitedNode.HasChildren())) { _returnProperty = CreatePropertyInfo(_visitedNode, _outerInstance.BaseNs, _path); return(true); } return(MoveNext()); }
/// <summary>Handles the iteration of the children or qualfier</summary> /// <param name="iterator">an iterator</param> /// <returns>Returns if there are more elements available.</returns> private bool IterateChildrenMethod(IIterator iterator) { if (_enclosing._skipSiblings) { // setSkipSiblings(false); _enclosing._skipSiblings = false; _subIterator = Enumerable.Empty <object>().Iterator(); } // create sub iterator for every child, // if its the first child visited or the former child is finished if (!_subIterator.HasNext() && iterator.HasNext()) { var child = (XmpNode)iterator.Next(); _index++; _subIterator = new NodeIterator(_enclosing, child, _path, _index); } if (_subIterator.HasNext()) { _returnProperty = (IXmpPropertyInfo)_subIterator.Next(); return(true); } return(false); }
/// <param name="returnProperty">the returnProperty to set</param> protected void SetReturnProperty(IXmpPropertyInfo returnProperty) => _returnProperty = returnProperty;
/** * @param prop an <code>XmpPropertyInfo</code> from the <code>XmpIterator</code>. */ private static void printPropertyInfo(IXmpPropertyInfo prop) { log.WriteLine("NS ({0}) PATH ({1}) VALUE ({2}) OPTIONS ({3})", prop.Namespace, prop.Path, prop.Value, prop.Options.GetOptionsString()); }
private TreeDirectory(IXmpPropertyInfo x) { Element = x; }
/// <summary> /// Handles the iteration of the children or qualfier </summary> /// <param name="iterator"> an iterator </param> /// <returns> Returns if there are more elements available. </returns> private bool IterateChildren(IEnumerator iterator) { if (_outerInstance._skipSiblings) { // setSkipSiblings(false); _outerInstance._skipSiblings = false; _subIterator = EmptyList.GetEnumerator(); } // create sub iterator for every child, // if its the first child visited or the former child is finished bool subIteratorMoveNext = _subIterator.MoveNext(); if (!subIteratorMoveNext && iterator.MoveNext()) { XmpNode child = (XmpNode) iterator.Current; _index++; _subIterator = new NodeIterator(_outerInstance, child, _path, _index); } if (subIteratorMoveNext) { _returnProperty = (IXmpPropertyInfo) _subIterator.Current; return true; } return false; }
/// <summary> /// Sets the returnProperty as next item or recurses into <code>hasNext()</code>. </summary> /// <returns> Returns if there is a next item to return. </returns> protected internal virtual bool ReportNode() { _state = ITERATE_CHILDREN; if (_visitedNode.Parent != null && (!_outerInstance.Options.JustLeafnodes || !_visitedNode.HasChildren())) { _returnProperty = CreatePropertyInfo(_visitedNode, _outerInstance.BaseNs, _path); return true; } return MoveNext(); }
private TreeDirectory(IXmpPropertyInfo x) { this.Element = x; }
/// <param name="returnProperty">the returnProperty to set</param> protected void SetReturnProperty(IXmpPropertyInfo returnProperty) { _returnProperty = returnProperty; }
/// <summary>Calls hasNext() and returns the prepared node.</summary> /// <remarks> /// Calls hasNext() and returns the prepared node. Afterward it's set to null. /// The existence of returnProperty indicates if there is a next node, otherwise /// an exception is thrown. /// </remarks> public virtual object Next() { if (HasNext()) { var result = _returnProperty; _returnProperty = null; return result; } throw new InvalidOperationException("There are no more nodes to return"); }
/// <summary>Handles the iteration of the children or qualfier</summary> /// <param name="iterator">an iterator</param> /// <returns>Returns if there are more elements available.</returns> private bool IterateChildrenMethod(IIterator iterator) { if (_enclosing._skipSiblings) { // setSkipSiblings(false); _enclosing._skipSiblings = false; _subIterator = Enumerable.Empty<object>().Iterator(); } // create sub iterator for every child, // if its the first child visited or the former child is finished if ((!_subIterator.HasNext()) && iterator.HasNext()) { var child = (XmpNode)iterator.Next(); _index++; _subIterator = new NodeIterator(_enclosing, child, _path, _index); } if (_subIterator.HasNext()) { _returnProperty = (IXmpPropertyInfo)_subIterator.Next(); return true; } return false; }
/// <summary>Sets the returnProperty as next item or recurses into <c>hasNext()</c>.</summary> /// <returns>Returns if there is a next item to return.</returns> private bool ReportNode() { _state = IterateChildren; if (_visitedNode.Parent != null && (!_enclosing.Options.IsJustLeafNodes || !_visitedNode.HasChildren)) { _returnProperty = CreatePropertyInfo(_visitedNode, _enclosing.BaseNamespace, _path); return true; } return HasNext(); }