Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/27/12 21:27:49 (12 years ago)
Author:
ascheibe
Message:

#1648 worked on user and group selection views

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/Views/LightweightUserView.cs

    r7380 r7426  
    2222using System;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Collections;
    2524using HeuristicLab.Core;
    2625using HeuristicLab.Core.Views;
     
    2928
    3029namespace HeuristicLab.Clients.Access.Views {
    31 
    3230  [View("LightweightUser View")]
    33   [Content(typeof(ReadOnlyCheckedItemList<LightweightUser>), true)]
    34   public partial class LightweightUserView : CheckedItemListView<LightweightUser> {
     31  [Content(typeof(ItemList<UserGroupBase>), true)]
     32  public partial class LightweightUserView : ItemListView<UserGroupBase> {
    3533    public LightweightUserView() {
    3634      InitializeComponent();
    3735      this.showDetailsCheckBox.Checked = false;
    38       this.itemsGroupBox.Text = "Users";
     36      this.itemsGroupBox.Text = "Users and Groups";
     37    }
     38
     39    protected override void addButton_Click(object sender, System.EventArgs e) {
     40      using (LightweightUserGroupSelectionDialog dlg = new LightweightUserGroupSelectionDialog()) {
     41        DialogResult res = dlg.ShowDialog(this);
     42        if (res == DialogResult.OK) {
     43          dlg.SelectedUsersAndGroups.ForEach(x => {
     44            if (!Content.Contains(x)) {
     45              Content.Add(x);
     46              OnSelectedUsersChanged();
     47            }
     48          });
     49        }
     50      }
     51    }
     52
     53    protected override void removeButton_Click(object sender, EventArgs e) {
     54      base.removeButton_Click(sender, e);
     55      OnSelectedUsersChanged();
    3956    }
    4057
     
    4259      base.SetEnabledStateOfControls();
    4360      this.showDetailsCheckBox.Enabled = false;
    44     }
    45 
    46     protected override void Content_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<LightweightUser>> e) {
    47       base.Content_CheckedItemsChanged(sender, e);
    48       OnSelectedUsersChanged();
    4961    }
    5062
Note: See TracChangeset for help on using the changeset viewer.