private void AddTreeNodeFlag(NodeFlag flag) { TreeNode treeNodeAttribute = treeNodeRootFlags.Nodes.Add(flag.GetTreeText()); treeNodeAttribute.ContextMenuStrip = menuAttributes; treeNodeAttribute.Tag = flag; EditorHelper.SetNodeIcon(treeNodeAttribute, ENodeIcon.ListItemFlag); treeNodeRootFlags.ExpandAll(); }
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(); }