Пример #1
0
        private static LayerElement BuildLayerTree(LayerElement[] layerElements)
        {
            var rootElement = new LayerElement()
            {
                IsGroup = true
            };

            var parentElement = rootElement;

            foreach (var element in layerElements)
            {
                if (element.IsSectionDivider)
                {
                    parentElement = parentElement.Parent;

                    continue;
                }

                element.Parent = parentElement;

                parentElement.AddChild(element);

                if (element.IsGroup)
                {
                    parentElement = element;
                }
            }

            return(rootElement);
        }
Пример #2
0
        public LayerElement()
        {
            Name             = "";
            IsGroup          = false;
            IsSectionDivider = false;
            Parent           = null;

            _children = new List <LayerElement>();
        }
Пример #3
0
 public void RemoveChild(LayerElement element)
 {
     _children.Remove(element);
 }
Пример #4
0
 public void AddChild(LayerElement element)
 {
     _children.Add(element);
 }