예제 #1
0
 internal void ActivateExistingNode(ViewGroupNode node)
 {
     if (GetActiveView() != node.Value)
     {
         _viewGroupCollection.Remove(node.List);
         _viewGroupCollection.AddLast(node.List);
     }
 }
예제 #2
0
        private void EnsuresViewHasParentAndMatch(ViewGroupNode node, string expectedParentViewInstanceKey)
        {
            var expectedParentView = new View(expectedParentViewInstanceKey);

            if (node.Previous == null || (node.Previous != null && node.Previous.Value != expectedParentView))
            {
                throw new OnlyNewViewInstanceCanBeStackedException(node.Value.ViewInstanceKey, expectedParentViewInstanceKey);
            }
        }
예제 #3
0
 public ViewGroupNode Push(ViewGroupNode newNode)
 {
     if (_internalStack.Count > 0)
     {
         var previousNode = _internalStack.Peek();
         newNode.Previous = previousNode;
     }
     newNode.List = this;
     _internalStack.Push(newNode);
     return(newNode);
 }
예제 #4
0
        internal bool TryFindViewNode(string viewInstanceKey, out ViewGroupNode node)
        {
            var viewInfo = new View(viewInstanceKey);
            var q        = (from viewGroup in _viewGroupCollection
                            from view in viewGroup
                            where view == viewInfo
                            select viewGroup.Find(view)).ToList();

            node = q.FirstOrDefault();
            return(q.Any());
        }
예제 #5
0
        internal void ActivateNewNode(ViewGroupNode newNode, ViewGroup ownerGroup = null)
        {
            if (ownerGroup != null)
            {
                ownerGroup.Push(newNode);
            }
            else
            {
                var newStack = new ViewGroup();
                newStack.Push(newNode);
                _viewGroupCollection.AddLast(newStack);
            }

            if (!newNode.Value.IsMessageBox)
            {
                _viewCollection.Add(newNode.Value);
            }
        }
예제 #6
0
        public ViewGroupNode Push(View view)
        {
            var newNode = new ViewGroupNode(this, view);

            return(Push(newNode));
        }