Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/11/12 14:29:26 (12 years ago)
Author:
ascheibe
Message:

#1648

  • always update the client information
  • allow a normal user to change the FullName and E-Mail
Location:
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews
Files:
4 edited

Legend:

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

    r7942 r7982  
    3333      this.userNameTextBox = new System.Windows.Forms.TextBox();
    3434      this.splitContainer = new System.Windows.Forms.SplitContainer();
     35      this.rolesListView = new System.Windows.Forms.ListView();
     36      this.columnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     37      this.imageList = new System.Windows.Forms.ImageList(this.components);
    3538      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()));
    3939      this.groupsColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     40      this.label5 = new System.Windows.Forms.Label();
     41      this.emailTextBox = new System.Windows.Forms.TextBox();
    4042      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    4143      this.splitContainer.Panel1.SuspendLayout();
     
    4749      //
    4850      this.changePasswordButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    49       this.changePasswordButton.Location = new System.Drawing.Point(316, 209);
     51      this.changePasswordButton.Location = new System.Drawing.Point(316, 231);
    5052      this.changePasswordButton.Name = "changePasswordButton";
    5153      this.changePasswordButton.Size = new System.Drawing.Size(112, 23);
     
    7274      this.fullNameTextBox.Size = new System.Drawing.Size(359, 20);
    7375      this.fullNameTextBox.TabIndex = 16;
     76      this.fullNameTextBox.TextChanged += new System.EventHandler(this.fullNameTextBox_TextChanged);
    7477      //
    7578      // label4
     
    106109      this.userNameTextBox.Location = new System.Drawing.Point(69, 3);
    107110      this.userNameTextBox.Name = "userNameTextBox";
     111      this.userNameTextBox.ReadOnly = true;
    108112      this.userNameTextBox.Size = new System.Drawing.Size(359, 20);
    109113      this.userNameTextBox.TabIndex = 15;
     
    114118                  | System.Windows.Forms.AnchorStyles.Left)
    115119                  | System.Windows.Forms.AnchorStyles.Right)));
    116       this.splitContainer.Location = new System.Drawing.Point(3, 55);
     120      this.splitContainer.Location = new System.Drawing.Point(3, 81);
    117121      this.splitContainer.Name = "splitContainer";
    118122      //
     
    126130      this.splitContainer.Panel2.Controls.Add(this.groupsListView);
    127131      this.splitContainer.Panel2.Controls.Add(this.label4);
    128       this.splitContainer.Size = new System.Drawing.Size(425, 148);
     132      this.splitContainer.Size = new System.Drawing.Size(425, 144);
    129133      this.splitContainer.SplitterDistance = 211;
    130134      this.splitContainer.TabIndex = 20;
     135      //
     136      // rolesListView
     137      //
     138      this.rolesListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     139                  | System.Windows.Forms.AnchorStyles.Left)
     140                  | System.Windows.Forms.AnchorStyles.Right)));
     141      this.rolesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     142            this.columnHeader});
     143      this.rolesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
     144      this.rolesListView.HideSelection = false;
     145      this.rolesListView.Location = new System.Drawing.Point(3, 16);
     146      this.rolesListView.Name = "rolesListView";
     147      this.rolesListView.Size = new System.Drawing.Size(205, 125);
     148      this.rolesListView.SmallImageList = this.imageList;
     149      this.rolesListView.TabIndex = 18;
     150      this.rolesListView.UseCompatibleStateImageBehavior = false;
     151      this.rolesListView.View = System.Windows.Forms.View.Details;
     152      //
     153      // columnHeader
     154      //
     155      this.columnHeader.Width = 100;
     156      //
     157      // imageList
     158      //
     159      this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     160      this.imageList.ImageSize = new System.Drawing.Size(16, 16);
     161      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
    131162      //
    132163      // groupsListView
     
    141172      this.groupsListView.Location = new System.Drawing.Point(3, 16);
    142173      this.groupsListView.Name = "groupsListView";
    143       this.groupsListView.Size = new System.Drawing.Size(204, 129);
     174      this.groupsListView.Size = new System.Drawing.Size(204, 125);
    144175      this.groupsListView.SmallImageList = this.imageList;
    145176      this.groupsListView.TabIndex = 19;
     
    147178      this.groupsListView.View = System.Windows.Forms.View.Details;
    148179      //
    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       //
    176180      // groupsColumnHeader
    177181      //
    178182      this.groupsColumnHeader.Width = 100;
     183      //
     184      // label5
     185      //
     186      this.label5.AutoSize = true;
     187      this.label5.Location = new System.Drawing.Point(0, 58);
     188      this.label5.Name = "label5";
     189      this.label5.Size = new System.Drawing.Size(39, 13);
     190      this.label5.TabIndex = 21;
     191      this.label5.Text = "E-Mail:";
     192      //
     193      // emailTextBox
     194      //
     195      this.emailTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     196                  | System.Windows.Forms.AnchorStyles.Right)));
     197      this.emailTextBox.Location = new System.Drawing.Point(69, 55);
     198      this.emailTextBox.Name = "emailTextBox";
     199      this.emailTextBox.Size = new System.Drawing.Size(359, 20);
     200      this.emailTextBox.TabIndex = 22;
     201      this.emailTextBox.TextChanged += new System.EventHandler(this.emailTextBox_TextChanged);
    179202      //
    180203      // LightweightUserInformationView
     
    182205      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    183206      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     207      this.Controls.Add(this.emailTextBox);
     208      this.Controls.Add(this.label5);
    184209      this.Controls.Add(this.splitContainer);
    185210      this.Controls.Add(this.changePasswordButton);
     
    189214      this.Controls.Add(this.userNameTextBox);
    190215      this.Name = "LightweightUserInformationView";
    191       this.Size = new System.Drawing.Size(431, 235);
     216      this.Size = new System.Drawing.Size(431, 257);
    192217      this.splitContainer.Panel1.ResumeLayout(false);
    193218      this.splitContainer.Panel1.PerformLayout();
     
    216241    private System.Windows.Forms.ColumnHeader columnHeader;
    217242    private System.Windows.Forms.ColumnHeader groupsColumnHeader;
     243    private System.Windows.Forms.Label label5;
     244    private System.Windows.Forms.TextBox emailTextBox;
    218245  }
    219246}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/LightweightUserInformationView.cs

    r7942 r7982  
    2020#endregion
    2121
     22using System;
    2223using System.Windows.Forms;
    2324using HeuristicLab.MainForm;
     
    4748        userNameTextBox.Clear();
    4849        fullNameTextBox.Clear();
     50        emailTextBox.Clear();
    4951      } else {
    5052        userNameTextBox.Text = Content.UserName;
    5153        fullNameTextBox.Text = Content.FullName;
     54        emailTextBox.Text = Content.EMail;
    5255
    5356        foreach (Role r in Content.Roles)
     
    8992      return listViewItem;
    9093    }
     94
     95    private void fullNameTextBox_TextChanged(object sender, System.EventArgs e) {
     96      if (UserInformation.Instance.User.FullName != fullNameTextBox.Text) {
     97        UserInformation.Instance.User.FullName = fullNameTextBox.Text;
     98        OnUserInformationChanged();
     99      }
     100    }
     101
     102    private void emailTextBox_TextChanged(object sender, System.EventArgs e) {
     103      if (UserInformation.Instance.User.EMail != emailTextBox.Text) {
     104        UserInformation.Instance.User.EMail = emailTextBox.Text;
     105        OnUserInformationChanged();
     106      }
     107    }
     108
     109    #region Events
     110    public event EventHandler UserInformationChanged;
     111    private void OnUserInformationChanged() {
     112      EventHandler handler = UserInformationChanged;
     113      if (handler != null) handler(this, EventArgs.Empty);
     114    }
     115    #endregion
    91116  }
    92117}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/RefreshableLightweightUserInformationView.Designer.cs

    r7611 r7982  
    1 namespace HeuristicLab.Clients.Access.Views {
     1using System;
     2namespace HeuristicLab.Clients.Access.Views {
    23  partial class RefreshableLightweightUserInformationView {
    34    /// <summary>
     
    1213    protected override void Dispose(bool disposing) {
    1314      if (disposing && (components != null)) {
     15        lightweightUserInformationView.UserInformationChanged -= new EventHandler(lightweightUserInformationView_Changed);
    1416        components.Dispose();
    1517      }
     
    2426    /// </summary>
    2527    private void InitializeComponent() {
     28      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RefreshableLightweightUserInformationView));
    2629      this.lightweightUserInformationView = new HeuristicLab.Clients.Access.Views.LightweightUserInformationView();
     30      this.storeButton = new System.Windows.Forms.Button();
    2731      this.SuspendLayout();
    2832      //
     
    4448      this.lightweightUserInformationView.TabIndex = 2;
    4549      //
     50      // storeButton
     51      //
     52      this.storeButton.Enabled = false;
     53      this.storeButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb;
     54      this.storeButton.Location = new System.Drawing.Point(34, 3);
     55      this.storeButton.Name = "storeButton";
     56      this.storeButton.Size = new System.Drawing.Size(24, 24);
     57      this.storeButton.TabIndex = 3;
     58      this.storeButton.UseVisualStyleBackColor = true;
     59      this.storeButton.Click += new System.EventHandler(this.storeButton_Click);
     60      //
    4661      // RefreshableLightweightUserInformationView
    4762      //
     
    4964      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    5065      this.Controls.Add(this.lightweightUserInformationView);
     66      this.Controls.Add(this.storeButton);
    5167      this.Name = "RefreshableLightweightUserInformationView";
    5268      this.Size = new System.Drawing.Size(384, 281);
     69      this.Controls.SetChildIndex(this.storeButton, 0);
    5370      this.Controls.SetChildIndex(this.lightweightUserInformationView, 0);
    5471      this.Controls.SetChildIndex(this.refreshButton, 0);
     
    6077
    6178    private LightweightUserInformationView lightweightUserInformationView;
     79    private System.Windows.Forms.Button storeButton;
    6280
    6381  }
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/RefreshableLightweightUserInformationView.cs

    r7635 r7982  
    3232    private void RefreshUserData() {
    3333      UserInformation.Instance.Refresh();
     34      lightweightUserInformationView.UserInformationChanged += new EventHandler(lightweightUserInformationView_Changed);
     35    }
     36
     37    void lightweightUserInformationView_Changed(object sender, EventArgs e) {
     38      if (!storeButton.Enabled) storeButton.Enabled = true;
    3439    }
    3540
     
    4449        base.Content_Refreshing(sender, e);
    4550        lightweightUserInformationView.Enabled = false;
     51        storeButton.Enabled = false;
    4652      }
    4753    }
     
    6167      }
    6268    }
     69
     70    private void storeButton_Click(object sender, EventArgs e) {
     71      AccessClient.Instance.ExecuteActionAsync(new Action(delegate {
     72        AccessClient.CallAccessService(x => x.UpdateLightweightUser(UserInformation.Instance.User));
     73      }), HeuristicLab.PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     74    }
    6375  }
    6476}
Note: See TracChangeset for help on using the changeset viewer.