Changeset 5676 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/Administration/SlaveView.cs
- Timestamp:
- 03/14/11 16:49:58 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/Administration/SlaveView.cs
r5638 r5676 20 20 #endregion 21 21 22 using System; 22 23 using System.Windows.Forms; 23 24 using HeuristicLab.Core.Views; … … 27 28 namespace HeuristicLab.Clients.Hive.Views.Administration { 28 29 [View("SlaveView")] 29 [Content(typeof( Slave), IsDefaultView = true)]30 [Content(typeof(Resource), IsDefaultView = true)] 30 31 public partial class SlaveView : ItemView { 31 public new Slave Content {32 get { return ( Slave)base.Content; }32 public new Resource Content { 33 get { return (Resource)base.Content; } 33 34 set { base.Content = value; } 34 35 } … … 50 51 base.OnContentChanged(); 51 52 if (Content == null) { 53 ShowSlaveUI(true); 52 54 txtName.Clear(); 53 55 txtCPU.Clear(); … … 60 62 txtId.Clear(); 61 63 } else { 62 txtName.Text = Content.Name; 63 txtCPU.Text = Content.Cores.ToString() + " Cores @ " + Content.CpuSpeed.ToString() + " Mhz, Arch.: " + Content.CpuArchitecture.ToString(); 64 txtDetailsDescription.Text = Content.Description; 65 txtMemory.Text = Content.Memory.ToString(); 66 txtOS.Text = Content.OperatingSystem; 67 txtSlaveState.Text = Content.SlaveState.ToString(); 68 txtLastHeartbeat.Text = Content.LastHeartbeat.ToString(); 69 txtFreeMemory.Text = Content.FreeMemory.ToString(); 70 txtId.Text = Content.Id.ToString(); 64 if (Content.GetType() == typeof(Slave)) { 65 ShowSlaveUI(true); 66 Slave ct = (Slave)Content; 67 txtName.Text = ct.Name; 68 txtCPU.Text = ct.Cores.ToString() + " Cores @ " + ct.CpuSpeed.ToString() + " Mhz, Arch.: " + ct.CpuArchitecture.ToString(); 69 txtDetailsDescription.Text = ct.Description; 70 txtMemory.Text = ct.Memory.ToString(); 71 txtOS.Text = ct.OperatingSystem; 72 txtSlaveState.Text = ct.SlaveState.ToString(); 73 txtLastHeartbeat.Text = ct.LastHeartbeat.ToString(); 74 txtFreeMemory.Text = ct.FreeMemory.ToString(); 75 txtId.Text = ct.Id.ToString(); 76 } else if (Content.GetType() == typeof(SlaveGroup)) { 77 SlaveGroup ct = (SlaveGroup)Content; 78 txtName.Text = ct.Name; 79 ShowSlaveUI(false); 80 } else 81 throw new Exception("Unknown Resource in SlaveView"); 82 71 83 } 84 } 85 86 void txtName_TextChanged(object sender, EventArgs e) { 87 throw new NotImplementedException(); 88 } 89 90 private void ShowSlaveUI(bool show) { 91 label2.Visible = show; 92 label1.Visible = show; 93 label10.Visible = show; 94 label11.Visible = show; 95 label12.Visible = show; 96 label13.Visible = show; 97 label14.Visible = show; 98 label15.Visible = show; 99 txtCPU.Visible = show; 100 txtDetailsDescription.Visible = show; 101 txtMemory.Visible = show; 102 txtOS.Visible = show; 103 txtSlaveState.Visible = show; 104 txtLastHeartbeat.Visible = show; 105 txtFreeMemory.Visible = show; 106 txtId.Visible = show; 72 107 } 73 108 … … 75 110 base.SetEnabledStateOfControls(); 76 111 } 112 113 private void txtName_TextChanged_1(object sender, EventArgs e) { 114 if (Content != null && Content is SlaveGroup) { 115 Content.Name = txtName.Text; 116 } 117 } 77 118 } 78 119 }
Note: See TracChangeset
for help on using the changeset viewer.