Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7942


Ignore:
Timestamp:
05/31/12 12:42:45 (12 years ago)
Author:
ascheibe
Message:

#1648 improved user information dialog

Location:
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/LightweightUserInformationView.Designer.cs

    r7611 r7942  
    2424    /// </summary>
    2525    private void InitializeComponent() {
     26      this.components = new System.ComponentModel.Container();
    2627      this.changePasswordButton = new System.Windows.Forms.Button();
    2728      this.label3 = new System.Windows.Forms.Label();
     
    2930      this.label4 = new System.Windows.Forms.Label();
    3031      this.label1 = new System.Windows.Forms.Label();
    31       this.groupsListBox = new System.Windows.Forms.ListBox();
    32       this.rolesListBox = new System.Windows.Forms.ListBox();
    3332      this.label2 = new System.Windows.Forms.Label();
    3433      this.userNameTextBox = new System.Windows.Forms.TextBox();
    3534      this.splitContainer = new System.Windows.Forms.SplitContainer();
     35      this.groupsListView = new System.Windows.Forms.ListView();
     36      this.rolesListView = new System.Windows.Forms.ListView();
     37      this.imageList = new System.Windows.Forms.ImageList(this.components);
     38      this.columnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     39      this.groupsColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    3640      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    3741      this.splitContainer.Panel1.SuspendLayout();
     
    8791      this.label1.Text = "User Name:";
    8892      //
    89       // groupsListBox
    90       //
    91       this.groupsListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    92                   | System.Windows.Forms.AnchorStyles.Left)
    93                   | System.Windows.Forms.AnchorStyles.Right)));
    94       this.groupsListBox.FormattingEnabled = true;
    95       this.groupsListBox.Location = new System.Drawing.Point(0, 17);
    96       this.groupsListBox.Margin = new System.Windows.Forms.Padding(0);
    97       this.groupsListBox.Name = "groupsListBox";
    98       this.groupsListBox.Size = new System.Drawing.Size(210, 121);
    99       this.groupsListBox.TabIndex = 14;
    100       //
    101       // rolesListBox
    102       //
    103       this.rolesListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    104                   | System.Windows.Forms.AnchorStyles.Left)
    105                   | System.Windows.Forms.AnchorStyles.Right)));
    106       this.rolesListBox.FormattingEnabled = true;
    107       this.rolesListBox.Location = new System.Drawing.Point(0, 17);
    108       this.rolesListBox.Margin = new System.Windows.Forms.Padding(0);
    109       this.rolesListBox.Name = "rolesListBox";
    110       this.rolesListBox.Size = new System.Drawing.Size(211, 121);
    111       this.rolesListBox.TabIndex = 13;
    112       //
    11393      // label2
    11494      //
     
    139119      // splitContainer.Panel1
    140120      //
    141       this.splitContainer.Panel1.Controls.Add(this.rolesListBox);
     121      this.splitContainer.Panel1.Controls.Add(this.rolesListView);
    142122      this.splitContainer.Panel1.Controls.Add(this.label3);
    143123      //
    144124      // splitContainer.Panel2
    145125      //
     126      this.splitContainer.Panel2.Controls.Add(this.groupsListView);
    146127      this.splitContainer.Panel2.Controls.Add(this.label4);
    147       this.splitContainer.Panel2.Controls.Add(this.groupsListBox);
    148128      this.splitContainer.Size = new System.Drawing.Size(425, 148);
    149129      this.splitContainer.SplitterDistance = 211;
    150130      this.splitContainer.TabIndex = 20;
     131      //
     132      // groupsListView
     133      //
     134      this.groupsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     135                  | System.Windows.Forms.AnchorStyles.Left)
     136                  | System.Windows.Forms.AnchorStyles.Right)));
     137      this.groupsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     138            this.groupsColumnHeader});
     139      this.groupsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
     140      this.groupsListView.HideSelection = false;
     141      this.groupsListView.Location = new System.Drawing.Point(3, 16);
     142      this.groupsListView.Name = "groupsListView";
     143      this.groupsListView.Size = new System.Drawing.Size(204, 129);
     144      this.groupsListView.SmallImageList = this.imageList;
     145      this.groupsListView.TabIndex = 19;
     146      this.groupsListView.UseCompatibleStateImageBehavior = false;
     147      this.groupsListView.View = System.Windows.Forms.View.Details;
     148      //
     149      // rolesListView
     150      //
     151      this.rolesListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     152                  | System.Windows.Forms.AnchorStyles.Left)
     153                  | System.Windows.Forms.AnchorStyles.Right)));
     154      this.rolesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     155            this.columnHeader});
     156      this.rolesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
     157      this.rolesListView.HideSelection = false;
     158      this.rolesListView.Location = new System.Drawing.Point(3, 16);
     159      this.rolesListView.Name = "rolesListView";
     160      this.rolesListView.Size = new System.Drawing.Size(205, 129);
     161      this.rolesListView.SmallImageList = this.imageList;
     162      this.rolesListView.TabIndex = 18;
     163      this.rolesListView.UseCompatibleStateImageBehavior = false;
     164      this.rolesListView.View = System.Windows.Forms.View.Details;
     165      //
     166      // imageList
     167      //
     168      this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     169      this.imageList.ImageSize = new System.Drawing.Size(16, 16);
     170      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
     171      //
     172      // columnHeader
     173      //
     174      this.columnHeader.Width = 100;
     175      //
     176      // groupsColumnHeader
     177      //
     178      this.groupsColumnHeader.Width = 100;
    151179      //
    152180      // LightweightUserInformationView
     
    180208    private System.Windows.Forms.Label label4;
    181209    private System.Windows.Forms.Label label1;
    182     private System.Windows.Forms.ListBox groupsListBox;
    183     private System.Windows.Forms.ListBox rolesListBox;
    184210    private System.Windows.Forms.Label label2;
    185211    private System.Windows.Forms.TextBox userNameTextBox;
    186212    private System.Windows.Forms.SplitContainer splitContainer;
     213    private System.Windows.Forms.ListView rolesListView;
     214    private System.Windows.Forms.ListView groupsListView;
     215    private System.Windows.Forms.ImageList imageList;
     216    private System.Windows.Forms.ColumnHeader columnHeader;
     217    private System.Windows.Forms.ColumnHeader groupsColumnHeader;
    187218  }
    188219}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/LightweightUserInformationView.cs

    r7611 r7942  
    2020#endregion
    2121
     22using System.Windows.Forms;
    2223using HeuristicLab.MainForm;
    2324using HeuristicLab.MainForm.WindowsForms;
     
    3839    protected override void OnContentChanged() {
    3940      base.OnContentChanged();
    40       rolesListBox.Items.Clear();
    41       groupsListBox.Items.Clear();
     41      rolesListView.Items.Clear();
     42      groupsListView.Items.Clear();
     43      rolesListView.SmallImageList.Images.Clear();
     44      groupsListView.SmallImageList.Images.Clear();
    4245
    4346      if (Content == null) {
     
    4750        userNameTextBox.Text = Content.UserName;
    4851        fullNameTextBox.Text = Content.FullName;
    49         rolesListBox.Items.AddRange(Content.Roles.ToArray());
    50         groupsListBox.Items.AddRange(Content.Groups.ToArray());
     52
     53        foreach (Role r in Content.Roles)
     54          rolesListView.Items.Add(CreateListViewRoleItem(r));
     55
     56        foreach (UserGroup g in Content.Groups)
     57          groupsListView.Items.Add(CreateListViewGroupItem(g));
     58
     59        rolesListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
     60        groupsListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
    5161      }
    5262    }
     
    5767      }
    5868    }
     69
     70    private ListViewItem CreateListViewRoleItem(Role item) {
     71      ListViewItem listViewItem = new ListViewItem();
     72
     73      listViewItem.Text = item.ToString();
     74      rolesListView.SmallImageList.Images.Add(item.ItemImage);
     75      listViewItem.ImageIndex = rolesListView.SmallImageList.Images.Count - 1;
     76      listViewItem.Tag = item;
     77
     78      return listViewItem;
     79    }
     80
     81    private ListViewItem CreateListViewGroupItem(UserGroup item) {
     82      ListViewItem listViewItem = new ListViewItem();
     83
     84      listViewItem.Text = item.ToString();
     85      groupsListView.SmallImageList.Images.Add(item.ItemImage);
     86      listViewItem.ImageIndex = rolesListView.SmallImageList.Images.Count - 1;
     87      listViewItem.Tag = item;
     88
     89      return listViewItem;
     90    }
    5991  }
    6092}
Note: See TracChangeset for help on using the changeset viewer.