Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/SubscriptionView.cs @ 8614

Last change on this file since 8614 was 7389, checked in by spimming, 13 years ago

#1680:

  • Show subscription view when node is selected
  • Subscription view adapted for data
File size: 2.2 KB
Line 
1using System.Windows.Forms;
2using HeuristicLab.Clients.Hive.CloudManager.Model;
3using HeuristicLab.Core.Views;
4using HeuristicLab.MainForm;
5
6namespace HeuristicLab.Clients.Hive.CloudManager.Views {
7  [View("SubscriptionView")]
8  [Content(typeof(Subscription), IsDefaultView = true)]
9  public partial class SubscriptionView : ItemView {
10    public new Subscription Content {
11      get { return (Subscription)base.Content; }
12      set { base.Content = value; }
13    }
14
15    public SubscriptionView() {
16      InitializeComponent();
17    }
18
19    protected override void DeregisterContentEvents() {
20      base.DeregisterContentEvents();
21    }
22    protected override void RegisterContentEvents() {
23      base.RegisterContentEvents();
24    }
25
26    protected override void OnContentChanged() {
27      base.OnContentChanged();
28      if (Content == null) {
29        txtSubscriptionId.Clear();
30        txtSubscriptionName.Clear();
31        txtCertThumbprint.Clear();
32        lblQuotaCores.Text = "-";
33        lblQuotaHostedServices.Text = "-";
34        cbDiscoverServices.Checked = false;
35        cbSaveSubscription.Checked = false;
36      } else {
37        Subscription sub = (Subscription)Content;
38        txtSubscriptionId.Text = sub.SubscriptionID;
39        txtSubscriptionName.Text = sub.SubscriptionName;
40        txtCertThumbprint.Text = sub.CertificateThumbprint;
41        lblQuotaCores.Text = string.Format("{0} / {1}", sub.CurrentCoreCount, sub.MaxCoreCount);
42        lblQuotaHostedServices.Text = string.Format("{0} / {1}", sub.CurrentHostedServices, sub.MaxHostedServices);
43        cbDiscoverServices.Checked = sub.DiscoverServices;
44        cbSaveSubscription.Checked = sub.SaveToConfig;
45      }
46    }
47
48    protected override void SetEnabledStateOfControls() {
49      base.SetEnabledStateOfControls();
50    }
51
52    private void cbSaveSubscription_CheckedChanged(object sender, System.EventArgs e) {
53      if (Content != null) {
54        Content.SaveToConfig = cbSaveSubscription.Checked;
55      }
56    }
57
58    private void cbDiscoverServices_CheckedChanged(object sender, System.EventArgs e) {
59      if (Content != null) {
60        Content.DiscoverServices = cbDiscoverServices.Checked;
61      }
62    }
63
64
65  }
66}
Note: See TracBrowser for help on using the repository browser.