예제 #1
0
        //public static void ArrangeLayersBackgroundItemClick(Layerage layerage)
        //{
        //    bool hasParentsSelected = LayerageCollection._getLayersParentsIsSelected(layerage);
        //    if (hasParentsSelected) return;
        //    else LayerageCollection._arrangeLayersBackgroundNullParents(layerage);
        //}

        //Judge Recursive
        private static void _arrangeLayersBackgroundNullParents(Layerage layerage)
        {
            ILayer layer = layerage.Self;

            if (layer.IsSelected)
            {
                layer.Control.BackgroundMode = BackgroundMode.Selected;
                foreach (Layerage child in layerage.Children)
                {
                    LayerageCollection._arrangeLayersBackgroundHasParentsSelected(child);
                }
            }
            else
            {
                bool childrenIsSelected = LayerageCollection._getLayersChildrenIsSelected(layerage);
                if (childrenIsSelected)
                {
                    LayerageCollection._arrangeLayersBackgroundWithoutParentsSelected(layerage);
                }
                else
                {
                    LayerageCollection._arrangeLayersBackgroundIsNotSelected(layerage);
                }
            }
        }