Last change
on this file since 7317 was
7317,
checked in by spimming, 13 years ago
|
#1680:
- Use IItemLists for data
- Show CloudResourceView in HiveCloudManagerView
|
File size:
1.7 KB
|
Rev | Line | |
---|
[7299] | 1 | using System;
|
---|
| 2 | using HeuristicLab.Clients.Hive.CloudManager.Azure;
|
---|
| 3 | using HeuristicLab.Clients.Hive.CloudManager.Model;
|
---|
| 4 | using HeuristicLab.Common;
|
---|
[7278] | 5 | using HeuristicLab.Core;
|
---|
| 6 |
|
---|
| 7 | namespace 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
|
---|
[7317] | 21 | private IItemList<Subscription> subscriptions;
|
---|
| 22 | public IItemList<Subscription> Subscriptions {
|
---|
[7299] | 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 |
|
---|
[7278] | 38 | #endregion
|
---|
| 39 |
|
---|
[7299] | 40 | #region Events
|
---|
[7278] | 41 |
|
---|
[7299] | 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 |
|
---|
[7278] | 74 | }
|
---|
| 75 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.