Пример #1
0
        public static NaviNode FindBaseNode(NaviNode node)
        {
            var parentNode = node;

            while (parentNode != null && parentNode.Parent != null && parentNode.Parent.Parent != null)
            {
                parentNode = parentNode.Parent;
            }
            return(parentNode);
        }
Пример #2
0
        public static int FindExpandableNode(NaviNode node)
        {
            var sectionId = -1;
            var section   = node;

            while (section != null &&
                   section.Parent != null &&
                   section.Parent.Parent != null)
            {
                sectionId = section.Id;
                section   = section.Parent;
            }
            return(sectionId);
        }