Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/CloudManagerClient.cs @ 7317

Last change on this file since 7317 was 7317, checked in by spimming, 12 years ago

#1680:

  • Use IItemLists for data
  • Show CloudResourceView in HiveCloudManagerView
File size: 1.7 KB
Line 
1using System;
2using HeuristicLab.Clients.Hive.CloudManager.Azure;
3using HeuristicLab.Clients.Hive.CloudManager.Model;
4using HeuristicLab.Common;
5using HeuristicLab.Core;
6
7namespace HeuristicLab.Clients.Hive.CloudManager {
8  [Item("CloudManagerClient", "Hive Cloud Manager Client.")]
9  public sealed class CloudManagerClient : IContent {
10    private static CloudManagerClient instance;
11    public static CloudManagerClient Instance {
12      get {
13        if (instance == null) instance = new CloudManagerClient();
14        return instance;
15      }
16    }
17
18    private CloudManagerClient() { }
19
20    #region Properties
21    private IItemList<Subscription> subscriptions;
22    public IItemList<Subscription> Subscriptions {
23      get { return subscriptions; }
24      set {
25        if (value != subscriptions) {
26          subscriptions = value;
27          //fire event OnSubscriptionsChagned
28        }
29      }
30    }
31
32    private IAzureProvider azureProvider;
33    public IAzureProvider AzureProvider {
34      get { return azureProvider; }
35      set { azureProvider = value; }
36    }
37
38    #endregion
39
40    #region Events
41
42    public event EventHandler Refreshing;
43    private void OnRefreshing() {
44      EventHandler handler = Refreshing;
45      if (handler != null) handler(this, EventArgs.Empty);
46    }
47    public event EventHandler Refreshed;
48    private void OnRefreshed() {
49      var handler = Refreshed;
50      if (handler != null) handler(this, EventArgs.Empty);
51    }
52
53    #endregion
54
55    #region Refresh
56
57    public void Refresh() {
58      OnRefreshing();
59
60      try {
61
62      }
63      catch {
64        throw;
65      }
66      finally {
67        OnRefreshed();
68      }
69    }
70
71    #endregion
72
73
74  }
75}
Note: See TracBrowser for help on using the repository browser.