Changeset 7942
- Timestamp:
- 05/31/12 12:42:45 (12 years ago)
- 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 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container(); 26 27 this.changePasswordButton = new System.Windows.Forms.Button(); 27 28 this.label3 = new System.Windows.Forms.Label(); … … 29 30 this.label4 = new System.Windows.Forms.Label(); 30 31 this.label1 = new System.Windows.Forms.Label(); 31 this.groupsListBox = new System.Windows.Forms.ListBox();32 this.rolesListBox = new System.Windows.Forms.ListBox();33 32 this.label2 = new System.Windows.Forms.Label(); 34 33 this.userNameTextBox = new System.Windows.Forms.TextBox(); 35 34 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())); 36 40 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 37 41 this.splitContainer.Panel1.SuspendLayout(); … … 87 91 this.label1.Text = "User Name:"; 88 92 // 89 // groupsListBox90 //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 // rolesListBox102 //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 //113 93 // label2 114 94 // … … 139 119 // splitContainer.Panel1 140 120 // 141 this.splitContainer.Panel1.Controls.Add(this.rolesList Box);121 this.splitContainer.Panel1.Controls.Add(this.rolesListView); 142 122 this.splitContainer.Panel1.Controls.Add(this.label3); 143 123 // 144 124 // splitContainer.Panel2 145 125 // 126 this.splitContainer.Panel2.Controls.Add(this.groupsListView); 146 127 this.splitContainer.Panel2.Controls.Add(this.label4); 147 this.splitContainer.Panel2.Controls.Add(this.groupsListBox);148 128 this.splitContainer.Size = new System.Drawing.Size(425, 148); 149 129 this.splitContainer.SplitterDistance = 211; 150 130 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; 151 179 // 152 180 // LightweightUserInformationView … … 180 208 private System.Windows.Forms.Label label4; 181 209 private System.Windows.Forms.Label label1; 182 private System.Windows.Forms.ListBox groupsListBox;183 private System.Windows.Forms.ListBox rolesListBox;184 210 private System.Windows.Forms.Label label2; 185 211 private System.Windows.Forms.TextBox userNameTextBox; 186 212 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; 187 218 } 188 219 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/LightweightUserInformationView.cs
r7611 r7942 20 20 #endregion 21 21 22 using System.Windows.Forms; 22 23 using HeuristicLab.MainForm; 23 24 using HeuristicLab.MainForm.WindowsForms; … … 38 39 protected override void OnContentChanged() { 39 40 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(); 42 45 43 46 if (Content == null) { … … 47 50 userNameTextBox.Text = Content.UserName; 48 51 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); 51 61 } 52 62 } … … 57 67 } 58 68 } 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 } 59 91 } 60 92 }
Note: See TracChangeset
for help on using the changeset viewer.