Changeset 2007
- Timestamp:
- 06/04/09 17:31:38 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Hive.Server.Console/3.2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.Designer.cs
r1956 r2007 33 33 this.jobToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 34 34 this.groupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 35 this.projectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 35 36 this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 36 37 this.largeIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); … … 87 88 this.tcManagementConsole = new System.Windows.Forms.TabControl(); 88 89 this.checkBox1 = new System.Windows.Forms.CheckBox(); 89 this.projectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();90 90 this.menuStrip1.SuspendLayout(); 91 91 this.plClientDetails.SuspendLayout(); … … 174 174 this.groupToolStripMenuItem.Click += new System.EventHandler(this.groupToolStripMenuItem_Click); 175 175 // 176 // projectToolStripMenuItem 177 // 178 this.projectToolStripMenuItem.Name = "projectToolStripMenuItem"; 179 this.projectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); 180 this.projectToolStripMenuItem.Size = new System.Drawing.Size(157, 22); 181 this.projectToolStripMenuItem.Text = "Project"; 182 this.projectToolStripMenuItem.Click += new System.EventHandler(this.projectToolStripMenuItem_Click); 183 // 176 184 // viewToolStripMenuItem 177 185 // … … 637 645 this.tvClientControl.Size = new System.Drawing.Size(151, 357); 638 646 this.tvClientControl.TabIndex = 0; 647 this.tvClientControl.DragLeave += new System.EventHandler(this.tvClientControl_DragLeave); 639 648 this.tvClientControl.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tvClientControl_MouseUp); 640 649 this.tvClientControl.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvClientControl_NodeMouseClick); … … 667 676 this.lvClientControl.LargeImageList = this.ilLargeImgClient; 668 677 this.lvClientControl.Location = new System.Drawing.Point(0, 0); 669 this.lvClientControl.MultiSelect = false;670 678 this.lvClientControl.Name = "lvClientControl"; 671 679 this.lvClientControl.Size = new System.Drawing.Size(299, 386); … … 695 703 this.checkBox1.Text = "checkBox1"; 696 704 this.checkBox1.UseVisualStyleBackColor = true; 697 //698 // projectToolStripMenuItem699 //700 this.projectToolStripMenuItem.Name = "projectToolStripMenuItem";701 this.projectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));702 this.projectToolStripMenuItem.Size = new System.Drawing.Size(157, 22);703 this.projectToolStripMenuItem.Text = "Project";704 this.projectToolStripMenuItem.Click += new System.EventHandler(this.projectToolStripMenuItem_Click);705 705 // 706 706 // HiveServerManagementConsole -
trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs
r1956 r2007 56 56 private ClientInfo currentClient = null; 57 57 58 private TreeNode current Node = null;58 private TreeNode currentGroupNode = null; 59 59 Guid parentgroup = Guid.Empty; 60 60 private ToolTip tt = new ToolTip(); … … 80 80 } 81 81 82 private TreeNode hoverNode; // node being hovered over during DnD 82 83 private void Init() { 83 84 … … 113 114 IClientManager clientManager = ServiceLocator.GetClientManager(); 114 115 if (tvClientControl.SelectedNode != null) { 115 // Delete Group 116 Response resp = clientManager.DeleteClientGroup(((ClientGroup)tvClientControl.SelectedNode.Tag).Id); 117 if (tvClientControl.SelectedNode == currentGroupNode) { 118 currentGroupNode = null; 119 } 120 tvClientControl.Nodes.Remove(tvClientControl.SelectedNode); 121 AddClients(); 116 122 } 117 123 }; 124 125 lvClientControl.ItemDrag += delegate(object sender, ItemDragEventArgs e) { 126 List<string> itemIDs = new List<string>((sender as ListView).SelectedItems.Count); 127 foreach (ListViewItem item in (sender as ListView).SelectedItems) { 128 itemIDs.Add(item.Name); 129 } 130 (sender as ListView).DoDragDrop(itemIDs.ToArray(), DragDropEffects.Move); 131 }; 132 133 tvClientControl.DragEnter += delegate(object sender, DragEventArgs e) { 134 e.Effect = DragDropEffects.Move; 135 }; 136 137 tvClientControl.DragOver += delegate(object sender, DragEventArgs e) { 138 Point mouseLocation = tvClientControl.PointToClient(new Point(e.X, e.Y)); 139 TreeNode node = tvClientControl.GetNodeAt(mouseLocation); 140 if (node != null && ((ClientGroup)node.Tag).Id != Guid.Empty) { 141 e.Effect = DragDropEffects.Move; 142 if (hoverNode == null) { 143 node.BackColor = Color.LightBlue; 144 node.ForeColor = Color.White; 145 hoverNode = node; 146 } else if (hoverNode != node) { 147 hoverNode.BackColor = Color.White; 148 hoverNode.ForeColor = Color.Black; 149 node.BackColor = Color.LightBlue; 150 node.ForeColor = Color.White; 151 hoverNode = node; 152 } 153 } else { 154 e.Effect = DragDropEffects.None; 155 } 156 }; 157 158 tvClientControl.DragDrop += delegate(object sender, DragEventArgs e) { 159 if (e.Data.GetDataPresent(typeof(string[]))) { 160 Point dropLocation = (sender as TreeView).PointToClient(new Point(e.X, e.Y)); 161 TreeNode dropNode = (sender as TreeView).GetNodeAt(dropLocation); 162 if (((ClientGroup)dropNode.Tag).Id != Guid.Empty) { 163 List<ClientInfo> clients = new List<ClientInfo>(); 164 foreach (ListViewItem lvi in lvClientControl.SelectedItems) { 165 clients.Add((ClientInfo)lvi.Tag); 166 } 167 ChangeGroup(clients, ((ClientGroup)dropNode.Tag).Id); 168 } 169 tvClientControl_DragLeave(null, EventArgs.Empty); 170 AddClients(); 171 } 172 }; 173 } 174 175 private void ChangeGroup(List<ClientInfo> clients, Guid clientgroupID) { 176 IClientManager clientManager = ServiceLocator.GetClientManager(); 177 Guid groupId = ((ClientGroup)currentGroupNode.Tag).Id; 178 foreach (ClientInfo client in clients) { 179 if (groupId != Guid.Empty) { 180 Response resp = clientManager.DeleteResourceFromGroup(groupId, client.Id); 181 } 182 clientManager.AddResourceToGroup(clientgroupID, client); 183 } 118 184 } 119 185 … … 181 247 182 248 } 183 249 184 250 #endregion 185 251 … … 254 320 } 255 321 256 if (current Node != null) {322 if (currentGroupNode != null) { 257 323 lvClientControl.Items.Clear(); 258 324 lvClientControl.Groups.Clear(); 259 AddGroupsToListView(current Node);325 AddGroupsToListView(currentGroupNode); 260 326 } 261 327 tvClientControl.ExpandAll(); … … 443 509 } 444 510 } 445 511 446 512 447 513 private void RefreshForm() { … … 570 636 lvClientControl.Items.Clear(); 571 637 lvClientControl.Groups.Clear(); 572 current Node = e.Node;638 currentGroupNode = e.Node; 573 639 AddGroupsToListView(e.Node); 574 640 } … … 602 668 tvClientControl.SelectedNode = hitTestInfo.Node; 603 669 if (e.Button != MouseButtons.Right) return; 604 if (hitTestInfo.Node != null) { 605 Resource selectedGroup = (Resource)tvClientControl.SelectedNode.Tag; 606 607 if (selectedGroup != null) { 608 contextMenuGroup.Items.Add(menuItemAddGroup); 609 contextMenuGroup.Items.Add(menuItemDeleteGroup); 610 } 611 } else { 670 if (hitTestInfo.Node != null) { 671 Resource selectedGroup = (Resource)tvClientControl.SelectedNode.Tag; 672 673 if (selectedGroup != null) { 612 674 contextMenuGroup.Items.Add(menuItemAddGroup); 613 } 614 tvClientControl.ContextMenuStrip.Show(tvClientControl, new Point(e.X, e.Y)); 675 contextMenuGroup.Items.Add(menuItemDeleteGroup); 676 } 677 } else { 678 contextMenuGroup.Items.Add(menuItemAddGroup); 679 } 680 tvClientControl.ContextMenuStrip.Show(tvClientControl, new Point(e.X, e.Y)); 615 681 } 616 682 … … 636 702 ClientGroup cg = new ClientGroup() { Name = name }; 637 703 clientManager.AddClientGroup(cg); 638 AddClients();639 }704 } 705 AddClients(); 640 706 } 641 707 … … 688 754 smallIconsToolStripMenuItem.CheckState = CheckState.Unchecked; 689 755 listToolStripMenuItem.CheckState = CheckState.Checked; 756 } 757 758 private void tvClientControl_DragLeave(object sender, EventArgs e) { 759 foreach (TreeNode node in tvClientControl.Nodes) { 760 node.BackColor = Color.White; 761 node.ForeColor = Color.Black; 762 } 690 763 } 691 764 #endregion … … 798 871 #endregion 799 872 873 874 800 875 } 801 876 } -
trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.resx
r1956 r2007 398 398 </value> 399 399 </data> 400 <metadata name="updaterWoker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 401 <value>388, 41</value> 402 </metadata> 400 403 <metadata name="contextMenuJob.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 401 404 <value>246, 40</value> … … 452 455 </value> 453 456 </data> 454 <metadata name="updaterWoker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">455 <value>388, 41</value>456 </metadata>457 457 </root>
Note: See TracChangeset
for help on using the changeset viewer.