Changeset 6925 for branches/HeuristicLab.Hive-3.4/sources
- Timestamp:
- 10/13/11 20:45:08 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionListView.cs
r6924 r6925 21 21 22 22 using System; 23 using System.ComponentModel;24 23 using System.Windows.Forms; 25 24 using HeuristicLab.Core.Views; … … 45 44 return new JobPermission() { JobId = this.hiveExperimentId }; 46 45 } 47 48 protected override void RegisterContentEvents() {49 base.RegisterContentEvents();50 51 if (Content != null) {52 foreach (JobPermission permission in Content) {53 permission.PropertyChanged += new PropertyChangedEventHandler(permission_PropertyChanged);54 }55 }56 }57 58 protected override void DeregisterContentEvents() {59 base.DeregisterContentEvents();60 61 if (Content != null) {62 foreach (JobPermission permission in Content) {63 permission.PropertyChanged -= new PropertyChangedEventHandler(permission_PropertyChanged);64 }65 }66 }67 68 protected override void Content_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<JobPermission> e) {69 base.Content_ItemsAdded(sender, e);70 71 foreach (JobPermission permission in e.Items) {72 permission.PropertyChanged += new PropertyChangedEventHandler(permission_PropertyChanged);73 }74 }75 76 protected override void Content_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<JobPermission> e) {77 foreach (JobPermission permission in e.Items) {78 permission.PropertyChanged -= new PropertyChangedEventHandler(permission_PropertyChanged);79 }80 }81 82 protected override void Content_CollectionReset(object sender, Collections.CollectionItemsChangedEventArgs<JobPermission> e) {83 Content_ItemsRemoved(sender, e);84 }85 86 void permission_PropertyChanged(object sender, PropertyChangedEventArgs e) {87 OnContentChanged();88 }89 46 } 90 47 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionView.Designer.cs
r6924 r6925 60 60 this.usernameTextBox.Size = new System.Drawing.Size(281, 20); 61 61 this.usernameTextBox.TabIndex = 3; 62 this.usernameTextBox. Validating += new System.ComponentModel.CancelEventHandler(this.usernameTextBox_Validating);62 this.usernameTextBox.TextChanged += new System.EventHandler(this.usernameTextBox_TextChanged); 63 63 // 64 64 // permissionComboBox … … 72 72 this.permissionComboBox.Size = new System.Drawing.Size(281, 21); 73 73 this.permissionComboBox.TabIndex = 4; 74 this.permissionComboBox. Validating += new System.ComponentModel.CancelEventHandler(this.permissionComboBox_Validating);74 this.permissionComboBox.SelectedValueChanged += new System.EventHandler(this.permissionComboBox_SelectedValueChanged); 75 75 // 76 76 // HiveJobPermissionView -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionView.cs
r6924 r6925 20 20 #endregion 21 21 22 using System.ComponentModel;23 22 using HeuristicLab.Clients.Hive.Views; 24 23 using HeuristicLab.MainForm; … … 62 61 } 63 62 64 #region Child Control Events65 66 private void usernameTextBox_Validating(object sender, CancelEventArgs e) {67 Content.GrantedUserName = usernameTextBox.Text;63 private void usernameTextBox_TextChanged(object sender, System.EventArgs e) { 64 if (Content != null) { 65 Content.GrantedUserName = usernameTextBox.Text; 66 } 68 67 } 69 68 70 private void permissionComboBox_Validating(object sender, CancelEventArgs e) { 71 Content.Permission = (Permission)permissionComboBox.SelectedItem; 69 private void permissionComboBox_SelectedValueChanged(object sender, System.EventArgs e) { 70 if (Content != null) { 71 Content.Permission = (Permission)permissionComboBox.SelectedItem; 72 } 72 73 } 73 #endregion74 74 } 75 75 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/ServiceClients/JobPermission.cs
r6756 r6925 37 37 } 38 38 39 #region Constructors and Cloning40 39 public JobPermission() { 41 40 this.Permission = Permission.Read; 42 this.PropertyChanged += new PropertyChangedEventHandler(HiveExperimentPermission_PropertyChanged); 41 } 42 43 protected override void OnPropertyChanged(PropertyChangedEventArgs e) { 44 base.OnPropertyChanged(e); 45 if (e.PropertyName == "GrantedUserName" || e.PropertyName == "Permission") { 46 HiveExperimentPermission_PropertyChanged(this, e); 47 } 43 48 } 44 49 … … 50 55 this.Permission = original.Permission; 51 56 } 57 52 58 public override IDeepCloneable Clone(Cloner cloner) { 53 59 return new JobPermission(this, cloner); 54 60 } 55 #endregion56 61 57 62 private void HiveExperimentPermission_PropertyChanged(object sender, PropertyChangedEventArgs e) {
Note: See TracChangeset
for help on using the changeset viewer.