Exemplo n.º 1
0
        private void OnPropertyGridAttributesChanged(object s, PropertyValueChangedEventArgs e)
        {
            NodeCondition condition = selectedTreeNode.Tag as NodeCondition;
            NodeAction    action    = selectedTreeNode.Tag as NodeAction;
            NodeFlag      flag      = selectedTreeNode.Tag as NodeFlag;

            //Refresh node text
            if (condition != null)
            {
                selectedTreeNode.Text = condition.GetTreeText();
            }
            if (action != null)
            {
                selectedTreeNode.Text = action.GetTreeText();
            }
            if (flag != null)
            {
                selectedTreeNode.Text = flag.GetTreeText();
            }

            document.RefreshTreeNode(treeNode);
            document.SetDirty();
        }
Exemplo n.º 2
0
        private void AddTreeNodeCondition(NodeCondition condition, TreeNode parent)
        {
            TreeNode treeNodeAttribute = parent.Nodes.Add(condition.GetTreeText());

            treeNodeAttribute.ContextMenuStrip = menuAttributes;
            treeNodeAttribute.Tag = condition;

            if (condition is NodeConditionGroup)
            {
                EditorHelper.SetNodeIcon(treeNodeAttribute, ENodeIcon.ListItemConditionGroup);

                foreach (NodeCondition subCondition in ((NodeConditionGroup)condition).Conditions)
                {
                    AddTreeNodeCondition(subCondition, treeNodeAttribute);
                }
            }
            else
            {
                EditorHelper.SetNodeIcon(treeNodeAttribute, ENodeIcon.ListItemCondition);
            }

            parent.ExpandAll();
        }