Ejemplo n.º 1
0
        private protected virtual IReadOnlyIndexCollection BrowseNodeBlockList(IReadOnlyBrowseContext browseNodeContext, INode node, string propertyName, IReadOnlyList <INodeTreeBlock> childBlockList)
        {
            Debug.Assert(!string.IsNullOrEmpty(propertyName));

            IReadOnlyBrowsingBlockNodeIndexList NodeIndexList = CreateBrowsingBlockNodeIndexList();

            for (int BlockIndex = 0; BlockIndex < childBlockList.Count; BlockIndex++)
            {
                INodeTreeBlock ChildBlock = childBlockList[BlockIndex];
                BrowseBlock(browseNodeContext, node, propertyName, BlockIndex, ChildBlock, NodeIndexList);
            }

            return(CreateBlockIndexCollection(browseNodeContext, propertyName, NodeIndexList));
        }
        /// <summary>
        /// Gets indexes for all nodes in the inner.
        /// </summary>
        public virtual IReadOnlyBrowsingBlockNodeIndexList AllIndexes()
        {
            IReadOnlyBrowsingBlockNodeIndexList Result = CreateBlockNodeIndexList();

            foreach (IReadOnlyBlockState BlockState in BlockStateList)
            {
                foreach (IReadOnlyPlaceholderNodeState NodeState in BlockState.StateList)
                {
                    IReadOnlyBrowsingBlockNodeIndex ParentIndex = NodeState.ParentIndex as IReadOnlyBrowsingBlockNodeIndex;
                    Debug.Assert(ParentIndex != null);

                    Result.Add(ParentIndex);
                }
            }

            return(Result);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a IxxxIndexCollection with IxxxBrowsingBlockNodeIndex objects.
 /// </summary>
 private protected override IReadOnlyIndexCollection CreateBlockIndexCollection(IReadOnlyBrowseContext browseNodeContext, string propertyName, IReadOnlyBrowsingBlockNodeIndexList nodeIndexList)
 {
     ControllerTools.AssertNoOverride(this, typeof(FocusPlaceholderNodeState <IInner>));
     return(new FocusIndexCollection <IFocusBrowsingBlockNodeIndex>(propertyName, (IFocusBrowsingBlockNodeIndexList)nodeIndexList));
 }
 /// <summary>
 /// Creates a IxxxIndexCollection with IxxxBrowsingBlockNodeIndex objects.
 /// </summary>
 private protected override IReadOnlyIndexCollection CreateBlockIndexCollection(IReadOnlyBrowseContext browseNodeContext, string propertyName, IReadOnlyBrowsingBlockNodeIndexList nodeIndexList)
 {
     ControllerTools.AssertNoOverride(this, typeof(WriteableOptionalNodeState <IInner>));
     return(new WriteableIndexCollection <IWriteableBrowsingBlockNodeIndex>(propertyName, (IWriteableBrowsingBlockNodeIndexList)nodeIndexList));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Creates a IxxxIndexCollection with IxxxBrowsingBlockNodeIndex objects.
 /// </summary>
 private protected virtual IReadOnlyIndexCollection CreateBlockIndexCollection(IReadOnlyBrowseContext browseNodeContext, string propertyName, IReadOnlyBrowsingBlockNodeIndexList nodeIndexList)
 {
     ControllerTools.AssertNoOverride(this, typeof(ReadOnlyNodeState <IInner>));
     return(new ReadOnlyIndexCollection <IReadOnlyBrowsingBlockNodeIndex>(propertyName, nodeIndexList));
 }
Ejemplo n.º 6
0
        private protected virtual void BrowseBlock(IReadOnlyBrowseContext browseNodeContext, INode node, string propertyName, int blockIndex, INodeTreeBlock childBlock, IReadOnlyBrowsingBlockNodeIndexList nodeIndexList)
        {
            Debug.Assert(!string.IsNullOrEmpty(propertyName));

            for (int Index = 0; Index < childBlock.NodeList.Count; Index++)
            {
                INode ChildNode = childBlock.NodeList[Index];

                IReadOnlyBrowsingBlockNodeIndex NewNodeIndex;
                if (Index == 0) // For the first node, we use a IxxxBrowsingNewBlockNodeIndex, otherwise a IxxxBrowsingExistingBlockNodeIndex.
                {
                    NewNodeIndex = CreateNewBlockNodeIndex(browseNodeContext, node, propertyName, blockIndex, ChildNode);
                }
                else
                {
                    NewNodeIndex = CreateExistingBlockNodeIndex(browseNodeContext, node, propertyName, blockIndex, Index, ChildNode);
                }

                nodeIndexList.Add(NewNodeIndex);
            }
        }