示例#1
0
 public ParentNode(int countArrInNode, ParNode prevNode = null)
 {
     this._prevParNode    = prevNode;
     this._countArrInNode = countArrInNode;
     if (prevNode != null)
     {
         InitParent(countArrInNode, prevNode);
     }
     else
     {
         InitIfPrevNodeIsNull(countArrInNode);
     }
 }
示例#2
0
 private void InitParent(int countArrInNode, ParNode prevNode)
 {
     CollectionParents = _prevParNode.Parent.CollectionParents ?? new List <int> {
         Seek
     };
     if (_prevParNode.CountArrInNode < _countArrInNode)
     {
         CollectionParents.Add(_prevParNode.NodeId);
     }
     if (_prevParNode.CountArrInNode > _countArrInNode)
     {
         var range = GetRange();
         CollectionParents.RemoveRange(range.Item1, range.Item2);
     }
     this.CurrentParentNode = CollectionParents[CollectionParents.Count - 1];
 }
示例#3
0
 public ParNode(string key, ParNode prevNode = null)
 {
     if (prevNode == null)
     {
         InitIfPrevNodeIsNull(key);
     }
     else
     {
         this.PrevNodeId     = prevNode.PrevNodeId;
         this.NodeId         = prevNode.NextNodeId;
         this.NextNodeId     = NodeId + 1;
         this._key           = key.Remove(key.LastIndexOf("."));
         this.Number         = this._key;
         this.CountArrInNode = key.Split('.').Length;
         this.Parent         = new ParentNode(this.CountArrInNode, prevNode);
     }
 }