private void AddNodes(List <Element> elements, ElementNode elementNode) { var element = new Element { Id = elementNode.Id, Name = elementNode.Name }; element.Colors = ColorModule.getValidColorsForElementNode(elementNode, true).Select(ColorTranslator.ToHtml).ToList(); elements.Add(element); if (!elementNode.IsLeaf) { var children = new List <Element>(); element.Children = children; foreach (var childNode in elementNode.Children) { AddNodes(children, childNode); } } }
public Status Off(Element element) { return ElementsHelper.TurnOffElement(element.Id); }
private void AddNodes(List<Element> elements, ElementNode elementNode, bool addChildren = true) { var element = new Element { Id = elementNode.Id, Name = elementNode.Name, Colors = ColorModule.getValidColorsForElementNode(elementNode, true).Select(ColorTranslator.ToHtml).ToList() }; elements.Add(element); if (addChildren) { if (!elementNode.IsLeaf) { var children = new List<Element>(); element.Children = children; foreach (var childNode in elementNode.Children) { AddNodes(children, childNode); } } } }