Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/21/11 17:54:32 (14 years ago)
Author:
cneumuel
Message:

#1233

  • show owner of experimens in listview
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/HiveExperimentPermissionView.cs

    r6463 r6465  
    3434    public HiveExperimentPermissionView() {
    3535      InitializeComponent();
    36       permissionComboBox.Items.Add(Permission.ReadOnly);
     36      permissionComboBox.Items.Add(Permission.Read);
    3737      permissionComboBox.Items.Add(Permission.Full);
    38       permissionComboBox.SelectedItem = Permission.ReadOnly;
     38      permissionComboBox.SelectedItem = Permission.Read;
    3939    }
    4040
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentListView.cs

    r6381 r6465  
    3333    public RefreshableHiveExperimentListView() {
    3434      InitializeComponent();
     35      this.itemsListView.View = View.Details;
     36      this.itemsListView.Columns.Clear();
     37      this.itemsListView.Columns.Add(new ColumnHeader("Date") { Text = "Date" });
     38      this.itemsListView.Columns.Add(new ColumnHeader("Name") { Text = "Name" });
     39      this.itemsListView.HeaderStyle = ColumnHeaderStyle.Clickable;
     40      this.itemsListView.FullRowSelect = true;
    3541    }
    3642
     
    4551      }
    4652    }
     53
     54    protected override ListViewItem CreateListViewItem(RefreshableHiveExperiment item) {
     55      ListViewItem listViewItem = base.CreateListViewItem(item);
     56      listViewItem.SubItems.Clear();
     57      listViewItem.SubItems.Insert(0, new ListViewItem.ListViewSubItem(listViewItem, item.HiveExperiment.DateCreated.ToString("dd.MM.yyyy HH:mm")));
     58      listViewItem.SubItems.Insert(1, new ListViewItem.ListViewSubItem(listViewItem, item.HiveExperiment.Name));
     59      listViewItem.Group = GetListViewGroup(item.HiveExperiment.OwnerUsername);
     60      return listViewItem;
     61    }
     62
     63    private ListViewGroup GetListViewGroup(string groupName) {
     64      foreach (ListViewGroup group in itemsListView.Groups) {
     65        if (group.Name == groupName)
     66          return group;
     67      }
     68      var newGroup = new ListViewGroup(string.Format("Owner ({0})", groupName), HorizontalAlignment.Left) { Name = groupName };
     69      itemsListView.Groups.Add(newGroup);
     70      return newGroup;
     71    }
    4772  }
    4873}
Note: See TracChangeset for help on using the changeset viewer.