Beispiel #1
0
 private void menuItemWorkGroupNew_Click(object sender, EventArgs e)
 {
     if (this._selectedNode != null)
     {
         this.treeViewWorkGroup.SelectedNode = this._selectedNode;
         if (!this._selectedNode.IsEditing)
         {
             if (((WorkGroupControl.SimpleWorkGroupTreeNode) this._selectedNode).Conditions.Count > 0)
             {
                 if (!Utility.InputYesNoFromWarning(LocalizeText.Get(380)))
                 {
                     return;
                 }
                 foreach (object obj in ((WorkGroupControl.SimpleWorkGroupTreeNode) this._selectedNode).Conditions)
                 {
                     WorkGroupCondition condition = (WorkGroupCondition)obj;
                     this.DecreaseConditionCountWorkGroup(condition);
                 }
                 ((WorkGroupControl.SimpleWorkGroupTreeNode) this._selectedNode).ClearCondition();
             }
             WorkGroupControl.SimpleWorkGroupTreeNode simpleWorkGroupTreeNode = new WorkGroupControl.SimpleWorkGroupTreeNode("", ((WorkGroupControl.SimpleWorkGroupTreeNode) this._selectedNode).Authority);
             this._selectedNode.Nodes.Add(simpleWorkGroupTreeNode);
             this._selectedNode.Expand();
             this.treeViewWorkGroup.SelectedNode = simpleWorkGroupTreeNode;
             this._modified = true;
             simpleWorkGroupTreeNode.BeginEdit();
         }
     }
 }
Beispiel #2
0
 private void ListViewUnboundProcess_DragDrop(object sender, DragEventArgs args)
 {
     if (this._validDragToUnboundList)
     {
         WorkGroupControl.ConditionItem[] array = (WorkGroupControl.ConditionItem[])args.Data.GetData(typeof(WorkGroupControl.ConditionItem[]));
         if (array == null)
         {
             return;
         }
         if (Utility.InputYesNoFromWarning(LocalizeText.Get(389)))
         {
             foreach (WorkGroupControl.ConditionItem conditionItem in array)
             {
                 foreach (object obj in this.treeViewWorkGroup.Nodes)
                 {
                     WorkGroupControl.SimpleWorkGroupTreeNode node = (WorkGroupControl.SimpleWorkGroupTreeNode)obj;
                     this.RemoveSpecifiedCondition(node, conditionItem.Condition);
                 }
             }
         }
         this._modified = true;
         TreeNode selectedNode = this.treeViewWorkGroup.SelectedNode;
         if (selectedNode != null)
         {
             this.TreeViewWorkGroup_AfterSelect(sender, new TreeViewEventArgs(selectedNode));
         }
     }
 }
Beispiel #3
0
 private void menuItemWorkGroupNewRoot_Click(object sender, EventArgs e)
 {
     WorkGroupControl.SimpleWorkGroupTreeNode simpleWorkGroupTreeNode = new WorkGroupControl.SimpleWorkGroupTreeNode("", Authority.Supervisor);
     this.treeViewWorkGroup.Nodes.Add(simpleWorkGroupTreeNode);
     this.treeViewWorkGroup.SelectedNode = simpleWorkGroupTreeNode;
     this._modified = true;
     simpleWorkGroupTreeNode.BeginEdit();
 }
Beispiel #4
0
 private void RemoveSpecifiedCondition(WorkGroupControl.SimpleWorkGroupTreeNode node, WorkGroupCondition targetCondition)
 {
     foreach (object obj in node.Nodes)
     {
         WorkGroupControl.SimpleWorkGroupTreeNode node2 = (WorkGroupControl.SimpleWorkGroupTreeNode)obj;
         this.RemoveSpecifiedCondition(node2, targetCondition);
     }
     if (node.RemoveCondition(targetCondition))
     {
         this.DecreaseConditionCountWorkGroup(targetCondition);
     }
 }
Beispiel #5
0
 private void RemoveCondition(WorkGroupControl.SimpleWorkGroupTreeNode node)
 {
     foreach (object obj in node.Nodes)
     {
         WorkGroupControl.SimpleWorkGroupTreeNode node2 = (WorkGroupControl.SimpleWorkGroupTreeNode)obj;
         this.RemoveCondition(node2);
     }
     foreach (object obj2 in node.Conditions)
     {
         WorkGroupCondition condition = (WorkGroupCondition)obj2;
         this.DecreaseConditionCountWorkGroup(condition);
     }
     node.ClearCondition();
 }
Beispiel #6
0
 private void AddTo(TreeNodeCollection nodeList, WorkGroupStructureNode node)
 {
     WorkGroupControl.SimpleWorkGroupTreeNode simpleWorkGroupTreeNode = new WorkGroupControl.SimpleWorkGroupTreeNode(node.Name, node.Authority);
     nodeList.Add(simpleWorkGroupTreeNode);
     if (node.ChildNodes != null)
     {
         foreach (WorkGroupStructureNode node2 in node.ChildNodes)
         {
             this.AddTo(simpleWorkGroupTreeNode.Nodes, node2);
         }
     }
     if (node.Childs != null)
     {
         foreach (WorkGroupCondition condition in node.Childs)
         {
             simpleWorkGroupTreeNode.AddCondition(condition);
             this.IncreaseConditionCountWorkGroup(condition);
         }
     }
 }
Beispiel #7
0
 private void RemoveWorkGroup(WorkGroupControl.SimpleWorkGroupTreeNode node)
 {
     node.Remove();
     this.RemoveCondition(node);
 }