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); }
public LayerElement() { Name = ""; IsGroup = false; IsSectionDivider = false; Parent = null; _children = new List <LayerElement>(); }
public void RemoveChild(LayerElement element) { _children.Remove(element); }
public void AddChild(LayerElement element) { _children.Add(element); }