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);
                }
            }
        }
예제 #2
0
		public Status Off(Element element)
		{
			return ElementsHelper.TurnOffElement(element.Id);
		}
예제 #3
0
		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);
					}
				}
			}

		}