Changeset 1628 for trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs
- Timestamp:
- 04/23/09 15:37:05 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs
r1626 r1628 88 88 #endregion 89 89 90 private Guid ConvertStringToGuid(string stringGuid) { 91 Guid guid = Guid.Empty; 92 return (Guid)TypeDescriptor.GetConverter(guid).ConvertFrom(stringGuid); 93 } 94 95 90 96 private void Init() { 91 97 … … 94 100 IJobManager jobManager = ServiceLocator.GetJobManager(); 95 101 if (lvJobControl.SelectedItems.Count == 1) { 96 Guid jobID = Guid.Empty; 97 jobID = (Guid)TypeDescriptor.GetConverter(jobID).ConvertFrom(lvJobControl.SelectedItems[0].Text); 98 jobManager.AbortJob(jobID); 102 jobManager.AbortJob(ConvertStringToGuid(lvJobControl.SelectedItems[0].Text)); 99 103 } 100 104 }; … … 103 107 IJobManager jobManager = ServiceLocator.GetJobManager(); 104 108 if (lvJobControl.SelectedItems.Count == 1) { 105 Guid jobID = Guid.Empty; 106 jobID = (Guid)TypeDescriptor.GetConverter(jobID).ConvertFrom(lvJobControl.SelectedItems[0].Text); 107 jobManager.RequestSnapshot(jobID); 109 jobManager.RequestSnapshot(ConvertStringToGuid(lvJobControl.SelectedItems[0].Text)); 108 110 } 109 111 }; … … 113 115 private void lvJobControl_MouseUp(object sender, MouseEventArgs e) { 114 116 // If the right mouse button was clicked and released, 115 // display the shortcut menu assigned to the TreeView. 116 if (e.Button == MouseButtons.Right && lvJobControl.SelectedItems.Count == 1) { 117 lvJobControl.ContextMenuStrip.Show(new Point(e.X, e.Y)); 118 } 117 // display the shortcut menu assigned to the ListView. 118 lvJobControl.ContextMenuStrip.Items.Clear(); 119 ListViewHitTestInfo hitTestInfo = lvJobControl.HitTest(e.Location); 120 if (e.Button == MouseButtons.Right && hitTestInfo.Item != null && lvJobControl.SelectedItems.Count == 1) { 121 Guid selectedJobGuid = ConvertStringToGuid(lvJobControl.SelectedItems[0].Text); 122 Job selectedJob = jobs.List.FirstOrDefault(x => x.Id == selectedJobGuid); 123 124 if (selectedJob != null && selectedJob.State == State.calculating) { 125 lvJobControl.ContextMenuStrip.Items.Add(menuItemAbortJob); 126 lvJobControl.ContextMenuStrip.Items.Add(menuItemGetSnapshot); 127 } 128 } 129 lvJobControl.ContextMenuStrip.Show(new Point(e.X, e.Y)); 119 130 } 120 131 … … 287 298 } 288 299 } 289 pbClientControl.Image = il ClientControl.Images[usage];300 pbClientControl.Image = ilLargeImgJob.Images[usage]; 290 301 lblClientName.Text = currentClient.Name; 291 302 lblLogin.Text = currentClient.Login.ToString(); … … 305 316 lvSnapshots.Enabled = true; 306 317 currentJob = jobs.List[i]; 307 pbJobControl.Image = il JobControl.Images[0];318 pbJobControl.Image = ilLargeImgClient.Images[0]; 308 319 lblJobName.Text = currentJob.Id.ToString(); 309 320 progressJob.Value = (int)(currentJob.Percentage * 100); … … 334 345 if (currentJob.State != State.offline) { 335 346 lvSnapshots.Items.Clear(); 336 if (currentJob.State == State.finished) 347 if (currentJob.State == State.finished) 337 348 GetSnapshotList(); 338 349 lvSnapshots.Visible = true; … … 722 733 #endregion 723 734 735 private void largeIconsToolStripMenuItem_Click(object sender, EventArgs e) { 736 lvClientControl.View = View.LargeIcon; 737 lvJobControl.View = View.LargeIcon; 738 largeIconsToolStripMenuItem.CheckState = CheckState.Checked; 739 smallIconsToolStripMenuItem.CheckState = CheckState.Unchecked; 740 listToolStripMenuItem.CheckState = CheckState.Unchecked; 741 } 742 743 private void smallIconsToolStripMenuItem_Click(object sender, EventArgs e) { 744 lvClientControl.View = View.SmallIcon; 745 lvJobControl.View = View.SmallIcon; 746 largeIconsToolStripMenuItem.CheckState = CheckState.Unchecked; 747 smallIconsToolStripMenuItem.CheckState = CheckState.Checked; 748 listToolStripMenuItem.CheckState = CheckState.Unchecked; 749 } 750 751 private void listToolStripMenuItem_Click(object sender, EventArgs e) { 752 lvClientControl.View = View.List; 753 lvJobControl.View = View.List; 754 largeIconsToolStripMenuItem.CheckState = CheckState.Unchecked; 755 smallIconsToolStripMenuItem.CheckState = CheckState.Unchecked; 756 listToolStripMenuItem.CheckState = CheckState.Checked; 757 } 758 724 759 725 760
Note: See TracChangeset
for help on using the changeset viewer.