using System; using HeuristicLab.Clients.Hive.CloudManager.Azure; using HeuristicLab.Clients.Hive.CloudManager.Model; using HeuristicLab.Common; using HeuristicLab.Core; namespace HeuristicLab.Clients.Hive.CloudManager { [Item("CloudManagerClient", "Hive Cloud Manager Client.")] public sealed class CloudManagerClient : IContent { private static CloudManagerClient instance; public static CloudManagerClient Instance { get { if (instance == null) instance = new CloudManagerClient(); return instance; } } private CloudManagerClient() { } #region Properties private IItemList subscriptions; public IItemList Subscriptions { get { return subscriptions; } set { if (value != subscriptions) { subscriptions = value; //fire event OnSubscriptionsChagned } } } private IAzureProvider azureProvider; public IAzureProvider AzureProvider { get { return azureProvider; } set { azureProvider = value; } } #endregion #region Events public event EventHandler Refreshing; private void OnRefreshing() { EventHandler handler = Refreshing; if (handler != null) handler(this, EventArgs.Empty); } public event EventHandler Refreshed; private void OnRefreshed() { var handler = Refreshed; if (handler != null) handler(this, EventArgs.Empty); } #endregion #region Refresh public void Refresh() { OnRefreshing(); try { } catch { throw; } finally { OnRefreshed(); } } #endregion } }