Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/13/11 19:39:50 (13 years ago)
Author:
ascheibe
Message:

#1233 fixed bug in PermissionView in JobManager

Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionListView.cs

    r6792 r6924  
    2121
    2222using System;
     23using System.ComponentModel;
    2324using System.Windows.Forms;
    2425using HeuristicLab.Core.Views;
     
    4445      return new JobPermission() { JobId = this.hiveExperimentId };
    4546    }
     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    }
    4689  }
    4790}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionView.Designer.cs

    r6792 r6924  
    6060      this.usernameTextBox.Size = new System.Drawing.Size(281, 20);
    6161      this.usernameTextBox.TabIndex = 3;
    62       this.usernameTextBox.Validated += new System.EventHandler(this.usernameTextBox_Validated);
     62      this.usernameTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.usernameTextBox_Validating);
    6363      //
    6464      // permissionComboBox
     
    7272      this.permissionComboBox.Size = new System.Drawing.Size(281, 21);
    7373      this.permissionComboBox.TabIndex = 4;
    74       this.permissionComboBox.Validated += new System.EventHandler(this.permissionComboBox_Validated);
     74      this.permissionComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.permissionComboBox_Validating);
    7575      //
    76       // HiveExperimentPermissionView
     76      // HiveJobPermissionView
    7777      //
    7878      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     
    8282      this.Controls.Add(this.permissionLabel);
    8383      this.Controls.Add(this.usernameTextBox);
    84       this.Name = "HiveExperimentPermissionView";
     84      this.Name = "HiveJobPermissionView";
    8585      this.Controls.SetChildIndex(this.usernameTextBox, 0);
    8686      this.Controls.SetChildIndex(this.permissionLabel, 0);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionView.cs

    r6792 r6924  
    4747      } else {
    4848        usernameTextBox.Text = Content.GrantedUserName;
    49         permissionComboBox.SelectedValue = Content.Permission;
     49        permissionComboBox.SelectedItem = Content.Permission;
    5050      }
    5151    }
     
    6767      Content.GrantedUserName = usernameTextBox.Text;
    6868    }
    69     private void usernameTextBox_Validated(object sender, System.EventArgs e) {
    70 
    71     }
    7269
    7370    private void permissionComboBox_Validating(object sender, CancelEventArgs e) {
    7471      Content.Permission = (Permission)permissionComboBox.SelectedItem;
    7572    }
    76     private void permissionComboBox_Validated(object sender, System.EventArgs e) {
    77 
    78     }
    7973    #endregion
    8074  }
Note: See TracChangeset for help on using the changeset viewer.