コード例 #1
0
 private void customTreeView2_ItemDelete(string deleteFunction, ProcessingNode deletedItem)
 {
     DeleteBlockTimelineCell(deletedItem.NodeID);
 }
コード例 #2
0
ファイル: CustomTreeView.cs プロジェクト: wshanshan/DDD
 public void OnItemDelete(String deleteFunction, ProcessingNode deletedItem)
 {
     if (ItemDelete != null)
     {
         ItemDelete(deleteFunction, deletedItem);
     }
     NoActionProcessingNode node = new NoActionProcessingNode(-1, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty);
     OnAfterSelect(new TreeViewEventArgs(node));
 }
コード例 #3
0
 void customTreeView1_FunctionProc(ProcessingNode node, string functionName, string functionValue)
 {
     //throw new NotImplementedException();
     if (functionName == "Rename" && (node.NodeType == "Classification" || node.NodeType == "State"))
     {
         String oldVal = node.Text;
         int id = node.NodeID;
         IXPathNavigable iNavComponents = vsgController.GetComponent(id);
         XPathNavigator navComponents = iNavComponents.CreateNavigator();
         XPathNavigator component = navComponents.SelectSingleNode("/Components/Component");
         String newVal = component.GetAttribute("Name", component.NamespaceURI);
         //update classification rules
         UpdateAllClassificationRules(node.NodeType, id, oldVal, newVal);
     }
 }
コード例 #4
0
ファイル: CustomTreeView.cs プロジェクト: wshanshan/DDD
 public NodeFunctionListEventArgs(ProcessingNode node, List<Function> functions)
 {
     this.node = node;
     this.functions = functions;
 }
コード例 #5
0
ファイル: CustomTreeView.cs プロジェクト: wshanshan/DDD
 public void OnFunctionProcessed(ProcessingNode node, String functionName, String functionValue)
 {
     if (FunctionProc != null)
     {
         FunctionProc(node, functionName, functionValue);
     }
 }
コード例 #6
0
ファイル: CustomTreeView.cs プロジェクト: wshanshan/DDD
        public CustomContextMenuTag(ProcessingNode p_node, String p_functionName, String p_functionValue)
        {
            node = p_node;
            functionName = p_functionName;
            functionValue = p_functionValue;

            arguments = new List<String>();
        }
コード例 #7
0
ファイル: CustomTreeView.cs プロジェクト: wshanshan/DDD
       public void AddNodeToMap(ProcessingNode node)
       {
           if (!nodeMap.ContainsKey(node.NodeID))
           {
               nodeMap.Add(node.NodeID, new List<ProcessingNode>());
 
           }
           nodeMap[node.NodeID].Add(node);
       }
コード例 #8
0
ファイル: CustomTreeView.cs プロジェクト: wshanshan/DDD
 private void CheckNodeExpansion(ProcessingNode n)
 {
     //if (this.SelectedNode != null && this.SelectedNode.Equals(n))
     //{
     //    selectedItemPath = DisplayID + n.FullPath + n.Index; *************************
     //}
     if (n.IsExpanded)
     {
         if (isIDExpanded.ContainsKey(n.LinkType + this.GetCustomTreeDisplayId(n.LinkType) + n.FullPath + n.Index))
         {
             isIDExpanded[n.LinkType + this.GetCustomTreeDisplayId(n.LinkType) + n.FullPath + n.Index] = true;
         }
         else
         {
             isIDExpanded.Add(n.LinkType + this.GetCustomTreeDisplayId(n.LinkType) + n.FullPath + n.Index, true);
         }
     }
     else
     {
         if (isIDExpanded.ContainsKey(n.LinkType + this.GetCustomTreeDisplayId(n.LinkType) + n.FullPath + n.Index))
         {
             isIDExpanded[n.LinkType + this.GetCustomTreeDisplayId(n.LinkType) + n.FullPath + n.Index] = false;
         }
         else
         {
             isIDExpanded.Add(n.LinkType + this.GetCustomTreeDisplayId(n.LinkType) + n.FullPath + n.Index, false);
         }
     }
     // check children
     foreach (ProcessingNode child in n.Nodes)
     {
         CheckNodeExpansion(child);
     }
 }
コード例 #9
0
ファイル: CustomTreeView.cs プロジェクト: wshanshan/DDD
        private void RestoreNodeExpansion(ProcessingNode n)
        {
            //if (DisplayID + n.FullPath + n.Index == selectedItemPath)
            //{
            //    //this.SelectedNode = n; ***********************************
            //}
            if (isIDExpanded.ContainsKey(n.LinkType + this.GetCustomTreeDisplayId(n.LinkType) + n.FullPath + n.Index))
            {

                bool check = isIDExpanded[n.LinkType + this.GetCustomTreeDisplayId(n.LinkType) + n.FullPath + n.Index];
                if (check)
                {
                    n.Expand();
                }
                else
                {
                    n.Collapse();
                }
            }
            // check children
            foreach (ProcessingNode child in n.Nodes)
            {
                RestoreNodeExpansion(child);
            }
        }
コード例 #10
0
ファイル: CustomTreeView.cs プロジェクト: wshanshan/DDD
        private void loadNodes(CustomTreeRoot root, XPathNavigator nav, ProcessingNode tParent)
        {
            XPathNodeIterator nodes = nav.Select("Component");

            foreach (XPathNavigator navChild in nodes)
            {
                ProcessingNode childNode = CreateNodeAndProcessFunctions(navChild, tParent.LinkType);

                if (useNodeMap)
                {
                    root.AddNodeToMap(childNode);
                }

                // do we need to branch?
                if (childNode.Functions.Count > 0 && childNode.Functions[0].FunctionName.Equals("RootBranch") && !branching)
                {
                    branching = true;
                    String dynamicLink = this.Controller.GetDynamicLinkType(root.LinkType, ""+childNode.NodeID);
                    IXPathNavigable iRootNav = this.Controller.GetComponentAndChildren(childNode.NodeID, childNode.NodeID, dynamicLink, new ComponentOptions());
                    XPathNavigator newRootNav = iRootNav.CreateNavigator();
                    // optional transform
                    try
                    {
                        CustomTreeRoot xslBuilder = new CustomTreeRoot();
                        xslBuilder.Controller = this.Controller;
                        xslBuilder.Xsl = childNode.Functions[0].FunctionAction;
                        if (xslBuilder.Transform != null)
                        {
                            XmlDocument newDocument = new XmlDocument();
                            using (XmlWriter writer = newDocument.CreateNavigator().AppendChild())
                            {
                                xslBuilder.Transform.Transform(iRootNav, (XsltArgumentList)null, writer);
                            }
                            newRootNav = newDocument.CreateNavigator();
                        }
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(e.Message);
                    }
                    finally
                    {
                        newRootNav.SelectSingleNode("Components/Component/@LinkID").SetValue("" + childNode.LinkID.Value);
                        XPathNavigator newRootComponents = newRootNav.SelectSingleNode("Components");
                        if (newRootComponents != null)
                        {
                            tParent.LinkType = dynamicLink;
                            loadNodes(root, newRootComponents, tParent);
                            branching = false;
                        }
                    }
                }
                else
                {
                    tParent.Nodes.Add(childNode);

                    if (navChild.HasChildren)
                    {
                        loadNodes(root, navChild, childNode);
                    }
                }
            }
        }