예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NavigableNavigator"/> class with a content source,
 /// and an optional root content.
 /// </summary>
 /// <param name="source">The content source.</param>
 /// <param name="content">The root content.</param>
 /// <remarks>When no root content is supplied then the root of the source is used.</remarks>
 public NavigableNavigator(INavigableSource source, INavigableContent content = null)
     : this(source)
 {
     _nameTable = new NameTable();
     _lastAttributeIndex = source.LastAttributeIndex;
     _state = new State(content ?? source.Root, null, null, 0, StatePosition.Root);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NavigableNavigator"/> class with a content source,
 /// and an optional root content.
 /// </summary>
 /// <param name="source">The content source.</param>
 /// <param name="content">The root content.</param>
 /// <remarks>When no root content is supplied then the root of the source is used.</remarks>
 public NavigableNavigator(INavigableSource source, INavigableContent content = null)
     : this(source)
 {
     _nameTable          = new NameTable();
     _lastAttributeIndex = source.LastAttributeIndex;
     _state = new State(content ?? source.Root, null, null, 0, StatePosition.Root);
 }
        ///// <summary>
        ///// Initializes a new instance of the <see cref="NavigableNavigator"/> class with a content source.
        ///// </summary>
        ///// <param name="source">The content source.</param>
        ///// <param name="maxDepth">The maximum depth.</param>
        //private NavigableNavigator(INavigableSource source, int maxDepth)
        //{
        //    _source = source;
        //    _lastAttributeIndex = source.LastAttributeIndex;
        //    _maxDepth = maxDepth;
        //}

        /// <summary>
        /// Initializes a new instance of the <see cref="NavigableNavigator"/> class with a content source,
        /// and an optional root content.
        /// </summary>
        /// <param name="source">The content source.</param>
        /// <param name="rootId">The root content identifier.</param>
        /// <param name="maxDepth">The maximum depth.</param>
        /// <remarks>When no root content is supplied then the root of the source is used.</remarks>
        public NavigableNavigator(INavigableSource source, int rootId = 0, int maxDepth = int.MaxValue)
        //: this(source, maxDepth)
        {
            _source             = source;
            _lastAttributeIndex = source.LastAttributeIndex;
            _maxDepth           = maxDepth;

            _nameTable          = new NameTable();
            _lastAttributeIndex = source.LastAttributeIndex;
            var content = rootId <= 0 ? source.Root : source.Get(rootId);

            if (content == null)
            {
                throw new ArgumentException("Not the identifier of a content within the source.", nameof(rootId));
            }
            _state = new State(content, null, null, 0, StatePosition.Root);

            _contents = new ConcurrentDictionary <int, INavigableContent>();
        }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NavigableNavigator"/> class with a content source, a name table and a state.
 /// </summary>
 /// <param name="source">The content source.</param>
 /// <param name="nameTable">The name table.</param>
 /// <param name="state">The state.</param>
 /// <remarks>Privately used for cloning a navigator.</remarks>
 private NavigableNavigator(INavigableSource source, XmlNameTable nameTable, State state)
     : this(source)
 {
     _nameTable = nameTable;
     _state = state;
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NavigableNavigator"/> class with a content source.
 /// </summary>
 private NavigableNavigator(INavigableSource source)
 {
     _source = source;
     _lastAttributeIndex = source.LastAttributeIndex;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NavigableNavigator"/> class with a content source, a name table and a state.
 /// </summary>
 /// <param name="source">The content source.</param>
 /// <param name="nameTable">The name table.</param>
 /// <param name="state">The state.</param>
 /// <remarks>Privately used for cloning a navigator.</remarks>
 private NavigableNavigator(INavigableSource source, XmlNameTable nameTable, State state)
     : this(source)
 {
     _nameTable = nameTable;
     _state     = state;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NavigableNavigator"/> class with a content source.
 /// </summary>
 private NavigableNavigator(INavigableSource source)
 {
     _source             = source;
     _lastAttributeIndex = source.LastAttributeIndex;
 }