/// <summary> /// Initializes a new instance of the <see cref="ReadOnlyBrowseContext"/> class. /// </summary> /// <param name="state">The state that will be browsed.</param> public ReadOnlyBrowseContext(IReadOnlyNodeState state) { State = state; InternalIndexCollectionList = CreateIndexCollectionList(); IndexCollectionList = InternalIndexCollectionList.ToReadOnly(); _ValuePropertyTypeTable = new Dictionary <string, ValuePropertyType>(); }
/// <summary> /// Adds a collection of indexes to <see cref="IndexCollectionList"/>: /// . For placeholder node and optional nodes, the collection is just one index. /// . For list of nodes, the collection contains as many indexes as nodes. /// . For block lists, the collection contains as many indexes as nodes. The first index of each block is a new block index, and others existing block indexes. /// </summary> /// <param name="collection">The collection to add.</param> public virtual void AddIndexCollection(IReadOnlyIndexCollection collection) { Debug.Assert(IsCollectionSeparate(collection, IndexCollectionList)); InternalIndexCollectionList.Add(collection); Debug.Assert(collection.IsEmpty || !IsCollectionSeparate(collection, IndexCollectionList)); }