Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/30/12 16:37:17 (12 years ago)
Author:
ascheibe
Message:

#1648 improved client information view

File:
1 edited

Legend:

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

    r7557 r7933  
    2020#endregion
    2121
     22using System;
     23using System.Threading.Tasks;
    2224using System.Windows.Forms;
    2325
     
    2830    }
    2931
    30     protected override void OnLoad(System.EventArgs e) {
    31       base.OnLoad(e);
     32    private void okButton_Click(object sender, System.EventArgs e) {
     33      Close();
     34    }
    3235
    33       clientView.Content = ClientInformation.Instance.ClientInfo;
     36    private void refreshButton_Click(object sender, System.EventArgs e) {
     37      Refresh();
     38    }
     39
     40    private void registerClientButton_Click(object sender, EventArgs e) {
     41      using (ClientRegistrationDialog regDialog = new ClientRegistrationDialog()) {
     42        regDialog.ShowDialog(this);
     43        Refresh();
     44      }
     45    }
     46
     47    private void Refresh() {
     48      clientView.StartProgressView();
     49      Task.Factory.StartNew(new Action(delegate {
     50        ClientInformation.Instance.Refresh();
     51        clientView.Content = ClientInformation.Instance.ClientInfo;
     52        clientView.FinishProgressView();
     53        EnableRegistration();
     54      }));
     55    }
     56
     57    private void EnableRegistration() {
     58      if (InvokeRequired) {
     59        Invoke(new Action(EnableRegistration));
     60      } else {
     61        registerClientButton.Visible = !ClientInformation.Instance.ClientExists;
     62        infoLabel.Visible = !ClientInformation.Instance.ClientExists;
     63      }
    3464    }
    3565  }
Note: See TracChangeset for help on using the changeset viewer.