Changeset 7324 for branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views
- Timestamp:
- 01/13/12 13:45:51 (13 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
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.