SilverlightMappingToolBasic.UI.SuperGraph.View.SuperGraphControl.RecheckIncorrectVisibility C# (CSharp) Method

RecheckIncorrectVisibility() public method

public RecheckIncorrectVisibility ( ) : void
return void
        public void RecheckIncorrectVisibility()
        {
            var needCheck = true;
            while (needCheck)
            {
                needCheck = false;

                foreach (NodeControl nodeControl in GetNodeControls().ToList())
                {
                    if (!nodeControl.IsCollapsed)
                    {
                        if (nodeControl.ParentNodes.Count > 0 && nodeControl.ParentNodes.All(q => q.IsCollapsed))
                        {
                            nodeControl.IsCollapsed = true;
                            needCheck = true;
                            break;
                        }
                    }
                    else
                    {
                        if (nodeControl.ParentNodes.Count == 0)
                        {
                            nodeControl.IsCollapsed = false;
                            needCheck = true;
                            break;
                        }
                    }
                }
            }

            foreach (ArrowControl arrowControl in GetArrowControls())
            {
                if (!arrowControl.To.IsCollapsed && !arrowControl.From.IsCollapsed)
                {
                    arrowControl.IsCollapsed = false;
                }
                else
                {
                    arrowControl.IsCollapsed = true;
                }
            }
        }
SuperGraphControl