コード例 #1
0
 private IEnumerable <KeyValuePair <int, string> > GetAllSubProcess(IWorkGroupStructureNode node)
 {
     if (node != null)
     {
         if (node.IsLeafNode)
         {
             foreach (IWorkGroupCondition i in node.Childs)
             {
                 WorkGroupCondition c = i as WorkGroupCondition;
                 if (c != null && this.clientNames.ContainsKey(c.ClientName))
                 {
                     yield return(new KeyValuePair <int, string>(this.clientNames[c.ClientName].ID, c.ProcessName));
                 }
             }
         }
         else
         {
             foreach (IWorkGroupStructureNode j in node.ChildNodes)
             {
                 foreach (KeyValuePair <int, string> k in this.GetAllSubProcess(j))
                 {
                     yield return(k);
                 }
             }
         }
     }
     yield break;
 }
コード例 #2
0
        public IEnumerable <KeyValuePair <int, string> > FindAllSubProcess(string groupName)
        {
            IWorkGroupStructureNode        found     = null;
            List <IWorkGroupStructureNode> subGroups = new List <IWorkGroupStructureNode>();

            found = this.FindSubGroup(groupName, this.workGroups, subGroups);
            if (found == null)
            {
                List <IWorkGroupStructureNode> list = new List <IWorkGroupStructureNode>();
                while (found == null && subGroups.Count > 0)
                {
                    List <IWorkGroupStructureNode> list2 = list;
                    list      = subGroups;
                    subGroups = list2;
                    found     = this.FindSubGroup(groupName, list, subGroups);
                }
            }
            if (found != null)
            {
                foreach (KeyValuePair <int, string> i in this.GetAllSubProcess(found))
                {
                    yield return(i);
                }
            }
            yield break;
        }
コード例 #3
0
 public WorkGroupTreeNode(IWorkGroupStructureNode node, WorkGroup _parent) : base(node.Name)
 {
     this.Title        = node.Name;
     this.items        = new List <ClientProcessItem>();
     this.parent       = _parent;
     this.priority     = this.parent.GetNextPriority();
     this.naConditions = new HashSet <string>();
     if (node.IsLeafNode)
     {
         if (node.Childs != null)
         {
             IWorkGroupCondition[] childs = node.Childs;
             for (int i = 0; i < childs.Length; i++)
             {
                 IWorkGroupCondition condition = childs[i];
                 string key = condition.ToString();
                 this.parent[key] = this;
                 this.naConditions.Add(key);
             }
             return;
         }
     }
     else
     {
         IWorkGroupStructureNode[] childNodes = node.ChildNodes;
         for (int j = 0; j < childNodes.Length; j++)
         {
             IWorkGroupStructureNode childNode = childNodes[j];
             base.Nodes.Add(new WorkGroupTreeNode(childNode, this.parent));
         }
     }
 }