Changeset 7324
- Timestamp:
- 01/13/12 13:45:51 (13 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/CloudManagerClient.cs
r7317 r7324 16 16 } 17 17 18 private CloudManagerClient() { } 18 private CloudManagerClient() { 19 subscriptions = new ItemList<Subscription>(); 20 azureProvider = new AzureProvider(); 21 } 19 22 20 23 #region Properties … … 59 62 60 63 try { 61 64 IItemList<Subscription> subs = new ItemList<Subscription>(Subscriptions); 65 // TODO ... 62 66 } 63 67 catch { … … 71 75 #endregion 72 76 77 public void Add(Subscription subscription) { 78 if (subscription == null) { 79 throw new ArgumentNullException("subscription", "Subscription must not be null."); 80 } 81 if (Subscriptions.Contains(subscription)) { 82 Subscriptions.Remove(subscription); 83 } 84 Subscriptions.Add(subscription); 85 } 86 87 public void Remove(Subscription subscription) { 88 if (subscription == null) { 89 throw new ArgumentNullException("subscription", "Subscription must not be null."); 90 } 91 if (Subscriptions.Contains(subscription)) { 92 Subscriptions.Remove(subscription); 93 } 94 } 95 96 97 73 98 74 99 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/HeuristicLab.Clients.Hive.CloudManager-3.3.csproj
r7299 r7324 38 38 </PropertyGroup> 39 39 <ItemGroup> 40 <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 41 <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 42 <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 40 43 <Reference Include="System" /> 41 44 <Reference Include="System.Core" /> 42 45 <Reference Include="System.Drawing" /> 43 46 <Reference Include="System.Windows.Forms" /> 47 <Reference Include="System.Windows.Forms.DataVisualization" /> 44 48 <Reference Include="System.Xml.Linq" /> 45 49 <Reference Include="System.Data.DataSetExtensions" /> … … 124 128 <Name>HeuristicLab.MainForm-3.3</Name> 125 129 </ProjectReference> 130 <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj"> 131 <Project>{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}</Project> 132 <Name>HeuristicLab.Optimization.Views-3.3</Name> 133 </ProjectReference> 126 134 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 127 135 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/AddSubscriptionDialog.Designer.cs
r7281 r7324 117 117 this.btnCancel.Text = "Cancel"; 118 118 this.btnCancel.UseVisualStyleBackColor = true; 119 this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); 119 120 // 120 121 // progressBar … … 134 135 this.btnOk.Text = "OK"; 135 136 this.btnOk.UseVisualStyleBackColor = true; 137 this.btnOk.Click += new System.EventHandler(this.btnOk_Click); 136 138 // 137 139 // AddSubscriptionDialog -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/AddSubscriptionDialog.cs
r7281 r7324 26 26 private void btnOk_Click(object sender, System.EventArgs e) { 27 27 this.progressBar.Visible = true; 28 //this.progressBar.Style = ProgressBarStyle.Continuous; 28 29 worker.RunWorkerAsync(); 29 30 } … … 56 57 try { 57 58 worker.ReportProgress(25, "Add Subscription"); 58 //Subscription = service.GetSubscriptionInfo(txtSubscriptionId.Text, txtCertThumbprint.Text);59 Subscription = CloudManagerClient.Instance.AzureProvider.GetSubscriptionInfo(txtSubscriptionId.Text, txtCertThumbprint.Text); 59 60 Subscription.SaveToConfig = cbSaveSubscription.Checked; 60 61 Subscription.DiscoverServices = cbDiscoverServices.Checked; -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/CloudResourcesView.Designer.cs
r7317 r7324 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container(); 26 27 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CloudResourcesView)); 27 28 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); … … 32 33 this.btnAddSubscription = new System.Windows.Forms.Button(); 33 34 this.treeCloudResources = new System.Windows.Forms.TreeView(); 35 this.imageListCloudResources = new System.Windows.Forms.ImageList(this.components); 34 36 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 35 37 this.splitContainer1.Panel1.SuspendLayout(); … … 99 101 this.btnAddSubscription.TabIndex = 1; 100 102 this.btnAddSubscription.UseVisualStyleBackColor = true; 103 this.btnAddSubscription.Click += new System.EventHandler(this.btnAddSubscription_Click); 101 104 // 102 105 // treeCloudResources … … 105 108 | System.Windows.Forms.AnchorStyles.Left) 106 109 | System.Windows.Forms.AnchorStyles.Right))); 110 this.treeCloudResources.ImageIndex = 0; 111 this.treeCloudResources.ImageList = this.imageListCloudResources; 107 112 this.treeCloudResources.Location = new System.Drawing.Point(3, 34); 108 113 this.treeCloudResources.Name = "treeCloudResources"; 114 this.treeCloudResources.SelectedImageIndex = 0; 109 115 this.treeCloudResources.Size = new System.Drawing.Size(243, 460); 110 116 this.treeCloudResources.TabIndex = 0; 117 // 118 // imageListCloudResources 119 // 120 this.imageListCloudResources.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 121 this.imageListCloudResources.ImageSize = new System.Drawing.Size(16, 16); 122 this.imageListCloudResources.TransparentColor = System.Drawing.Color.Transparent; 111 123 // 112 124 // CloudResourcesView … … 134 146 private System.Windows.Forms.Button btnAddSlaveService; 135 147 private System.Windows.Forms.Label lblRefresh; 148 private System.Windows.Forms.ImageList imageListCloudResources; 136 149 } 137 150 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/CloudResourcesView.cs
r7317 r7324 16 16 private int updateInterval = 15000; 17 17 private DateTime dueTime; 18 private const int subscriptionImageIndex = 0; 19 private const int serviceImageIndex = 1; 18 20 19 21 public new IItemList<Subscription> Content { … … 25 27 InitializeComponent(); 26 28 29 treeCloudResources.ImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.NetworkCenterLarge); 30 treeCloudResources.ImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.MonitorLarge); 31 32 Content = CloudManagerClient.Instance.Subscriptions; 27 33 CloudManagerClient.Instance.Refreshing += new EventHandler(Instance_Refreshing); 28 34 CloudManagerClient.Instance.Refreshed += new EventHandler(Instance_Refreshed); … … 42 48 } 43 49 44 void Instance_Refreshing(object sender, EventArgs e) { 50 #region Register Content Events 51 protected override void DeregisterContentEvents() { 52 Content.ItemsAdded -= new Collections.CollectionItemsChangedEventHandler<Collections.IndexedItem<Subscription>>(Content_ItemsAdded); 53 Content.ItemsRemoved -= new Collections.CollectionItemsChangedEventHandler<Collections.IndexedItem<Subscription>>(Content_ItemsRemoved); 54 base.DeregisterContentEvents(); 55 } 56 protected override void RegisterContentEvents() { 57 base.RegisterContentEvents(); 58 Content.ItemsAdded += new Collections.CollectionItemsChangedEventHandler<Collections.IndexedItem<Subscription>>(Content_ItemsAdded); 59 Content.ItemsRemoved += new Collections.CollectionItemsChangedEventHandler<Collections.IndexedItem<Subscription>>(Content_ItemsRemoved); 60 } 61 #endregion 62 63 protected override void SetEnabledStateOfControls() { 64 base.SetEnabledStateOfControls(); 65 if (Content == null || Content.Count == 0) { 66 btnAddSlaveService.Enabled = false; 67 btnDelete.Enabled = false; 68 btnSave.Enabled = false; 69 } else { 70 btnAddSlaveService.Enabled = true; 71 btnDelete.Enabled = true; 72 btnSave.Enabled = true; 73 } 74 } 75 76 protected override void OnContentChanged() { 77 base.OnContentChanged(); 78 SetEnabledStateOfControls(); 79 if (Content == null) { 80 //slaveView.Content = null; 81 treeCloudResources.Nodes.Clear(); 82 } else { 83 treeCloudResources.Nodes.Clear(); 84 foreach (Subscription sub in Content) { 85 TreeNode tn = new TreeNode(); 86 tn.Tag = sub; 87 tn.Text = sub.SubscriptionName; 88 tn.ImageIndex = subscriptionImageIndex; 89 tn.SelectedImageIndex = tn.ImageIndex; 90 treeCloudResources.Nodes.Add(tn); 91 } 92 } 93 } 94 95 private void Instance_Refreshing(object sender, EventArgs e) { 45 96 Debug.WriteLine("Instance_Refreshing"); 46 97 } 47 98 48 void Instance_Refreshed(object sender, EventArgs e) {99 private void Instance_Refreshed(object sender, EventArgs e) { 49 100 Debug.WriteLine("Instance_Refreshed"); 101 } 102 103 private void Content_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<Subscription>> e) { 104 OnContentChanged(); 105 } 106 107 private void Content_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<Subscription>> e) { 108 OnContentChanged(); 50 109 } 51 110 … … 67 126 } 68 127 } 128 129 private void btnAddSubscription_Click(object sender, EventArgs e) { 130 using (var form = new AddSubscriptionDialog()) { 131 form.ShowDialog(); 132 if (!form.ErrorOccured) { 133 if (form.Subscription != null) { 134 Subscription sub = form.Subscription; 135 CloudManagerClient.Instance.Add(sub); 136 } 137 } 138 } 139 } 69 140 } 70 141 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/HiveCloudManagerView.Designer.cs
r7317 r7324 33 33 // tabResources 34 34 // 35 this.tabResources.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 36 | System.Windows.Forms.AnchorStyles.Left) 35 this.tabResources.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 36 | System.Windows.Forms.AnchorStyles.Left) 37 37 | System.Windows.Forms.AnchorStyles.Right))); 38 38 this.tabResources.Controls.Add(this.tabResource); … … 56 56 // cloudResourcesView 57 57 // 58 this.cloudResourcesView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 59 | System.Windows.Forms.AnchorStyles.Left) 58 this.cloudResourcesView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 59 | System.Windows.Forms.AnchorStyles.Left) 60 60 | System.Windows.Forms.AnchorStyles.Right))); 61 61 this.cloudResourcesView.Caption = "Cloud Resources View"; -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/HiveCloudManagerView.cs
r7299 r7324 38 38 public HiveCloudManagerView() { 39 39 InitializeComponent(); 40 cloudResourcesView.Content = CloudManagerClient.Instance.Subscriptions; 40 41 } 41 42
Note: See TracChangeset
for help on using the changeset viewer.