Inheritance: RealignObject
Beispiel #1
0
        // Find the left most node(s) -- parent nodes. Perpare all the child nodes for finding the relationships between them 
        private void Initialise(RealignStyle realignStyle = RealignStyle.Horizontal)
        {
            foreach (var nodeControl in _nodeControls)
            {
                var realignNode = new RealignNode(nodeControl);

                if (nodeControl.ParentNodes.Count == 0)
                {
                    AddChild(realignNode);
                }
                else
                {
                    _nodesNeedToBePlaced.Add(realignNode);
                }
            }

            //If no parent can be found, set the top left node to parent
            if (ChildNodes.Count == 0)
            {
                AddTopLeftNodeToParentNode();
            }
            PlaceNodesToMap(realignStyle);
            ReCheckForIncorrectDepth(realignStyle);

            if (_isPartlyRealign)
            {
                var nodesToLoop = ChildNodes.ToList();
                foreach (var realignNode in nodesToLoop)
                {
                    if (!realignNode.HasChild)
                    {
                        ChildNodes.Remove(realignNode);
                    }
                }
            }
        }
Beispiel #2
0
        // Find the left most node(s) -- parent nodes. Perpare all the child nodes for finding the relationships between them
        private void Initialise(RealignStyle realignStyle = RealignStyle.Horizontal)
        {
            foreach (var nodeControl in _nodeControls)
            {
                var realignNode = new RealignNode(nodeControl);

                if (nodeControl.ParentNodes.Count == 0)
                {
                    AddChild(realignNode);
                }
                else
                {
                    _nodesNeedToBePlaced.Add(realignNode);
                }
            }

            //If no parent can be found, set the top left node to parent
            if (ChildNodes.Count == 0)
            {
                AddTopLeftNodeToParentNode();
            }
            PlaceNodesToMap(realignStyle);
            ReCheckForIncorrectDepth(realignStyle);

            if (_isPartlyRealign)
            {
                var nodesToLoop = ChildNodes.ToList();
                foreach (var realignNode in nodesToLoop)
                {
                    if (!realignNode.HasChild)
                    {
                        ChildNodes.Remove(realignNode);
                    }
                }
            }
        }
Beispiel #3
0
 public void AddChild(RealignNode node)
 {
     ChildNodes.Add(node);
 }
Beispiel #4
0
 public void AddChild(RealignNode node)
 {
     ChildNodes.Add(node);
 }