Пример #1
0
 private Visual.TreeNode AddNode(TreeNodes nodes, XElement element)
 {
     Visual.TreeNode node = new Visual.TreeNode();
     node.IsExpanded = !_expandOnDemand;
     node.Element    = element;
     foreach (XElement child in element.Elements())
     {
         if (child.Name.LocalName.IndexOf(".") < 1)
         {
             AddNode(node.Children, child);
         }
     }
     nodes.Add(node);
     return(node);
 }
Пример #2
0
        private void ExpandNode(IElementDesigner designer)
        {
            if (designer != null)
            {
                Visual.TreeNode node = (Visual.TreeNode)designer.Element;

                // Collapse all children
                foreach (Visual.TreeNode child in node.Children)
                {
                    child.Collapse(false);
                }

                // Expand this node
                node.Expand(false);
            }
        }
Пример #3
0
        public SimplePlanNodeBox(Visual.TreeNode node)
        {
            _node = node;
            XElement element = (XElement)((Visual.TreeNode)node).Element;

            XAttribute description = element.Attribute("Description");

            if ((description == null) || (description.Value == String.Empty))
            {
                Text = element.Name.LocalName;
            }
            else
            {
                Text = description.Value;
            }

            XAttribute deviceSupported = element.Attribute("DeviceSupported");

            if ((deviceSupported == null) || (deviceSupported.Value.ToLower() != "true"))
            {
                SurfaceColor = Color.FromArgb(200, 230, 200);
            }
            else
            {
                SurfaceColor = Color.FromArgb(230, 200, 200);
            }

            XAttribute category = element.Attribute("Category");

            if (category != null)
            {
                if (category.Value == "Instruction")
                {
                    RoundRadius = 10;
                }
                else if (category.Value == "Unknown")
                {
                    RoundRadius = 20;
                }
            }
        }