Changeset 7951 for branches/HiveResourcePermissionManagement (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.cs
- Timestamp:
- 06/04/12 14:48:55 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveResourcePermissionManagement (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.cs
r7862 r7951 22 22 using System; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Clients.Access; 24 25 using HeuristicLab.Core.Views; 25 26 using HeuristicLab.MainForm; … … 63 64 txtHbIntervall.Clear(); 64 65 cbxDisposable.Checked = false; 66 cbxPublic.Checked = false; 65 67 } else { 66 68 if (Content.GetType() == typeof(Slave)) { 67 69 ShowSlaveUI(true); 68 70 Slave ct = (Slave)Content; 71 bool authorized = HiveServiceLocator.Instance.CallHiveService<bool>(service => service.AuthorizesForResourceAdministration(ct.Id)); 69 72 txtName.Text = ct.Name; 70 73 txtHbIntervall.Text = ct.HbInterval.ToString(); 71 cbxDisposable.Checked = ct.IsDisposable.GetValueOrDefault(); 74 cbxPublic.Enabled = authorized; 75 cbxPublic.CheckedChanged -= new EventHandler(cbxPublic_CheckedChanged); 76 cbxPublic.Checked = ct.OwnerUserId == null; 77 cbxPublic.CheckedChanged += new EventHandler(cbxPublic_CheckedChanged); 72 78 txtCPU.Text = string.Format("{0} Cores @ {1} Mhz, Arch.: {2}", ct.Cores.ToString(), ct.CpuSpeed.ToString(), ct.CpuArchitecture.ToString()); 73 79 txtDetailsDescription.Text = ct.Description; … … 78 84 txtFreeMemory.Text = ct.FreeMemory.ToString(); 79 85 txtId.Text = ct.Id.ToString(); 86 cbxDisposable.Enabled = authorized; 87 cbxDisposable.Checked = ct.IsDisposable.GetValueOrDefault(); 80 88 } else if (Content.GetType() == typeof(SlaveGroup)) { 81 89 SlaveGroup ct = (SlaveGroup)Content; 82 90 txtName.Text = ct.Name; 83 91 txtHbIntervall.Text = ct.HbInterval.ToString(); 92 cbxPublic.Enabled = ct.Name != "UNGROUPED" && HiveRoles.CheckAdminUserPermissions(); 93 cbxPublic.CheckedChanged -= new EventHandler(cbxPublic_CheckedChanged); 94 cbxPublic.Checked = ct.OwnerUserId == null; 95 cbxPublic.CheckedChanged += new EventHandler(cbxPublic_CheckedChanged); 84 96 ShowSlaveUI(false); 85 97 } else { … … 136 148 } 137 149 138 private void c heckBox1_CheckedChanged(object sender, EventArgs e) {150 private void cbxDisposable_CheckedChanged(object sender, EventArgs e) { 139 151 if (Content != null) { 140 152 ((Slave)Content).IsDisposable = cbxDisposable.Checked; 141 153 } 142 154 } 155 156 private void cbxPublic_CheckedChanged(object sender, EventArgs e) { 157 if (Content != null) { 158 Content.OwnerUserId = cbxPublic.Checked ? null : new Guid?(UserInformation.Instance.User.Id); 159 } 160 } 143 161 } 144 162 }
Note: See TracChangeset
for help on using the changeset viewer.