Changeset 7317
- Timestamp:
- 01/11/12 17:14:36 (13 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/CloudManagerClient.cs
r7299 r7317 19 19 20 20 #region Properties 21 private I temCollection<Subscription> subscriptions;22 public I temCollection<Subscription> Subscriptions {21 private IItemList<Subscription> subscriptions; 22 public IItemList<Subscription> Subscriptions { 23 23 get { return subscriptions; } 24 24 set { -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/CloudResourcesView.Designer.cs
r7299 r7317 26 26 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CloudResourcesView)); 27 27 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 28 this.l abel1= new System.Windows.Forms.Label();28 this.lblRefresh = new System.Windows.Forms.Label(); 29 29 this.btnSave = new System.Windows.Forms.Button(); 30 30 this.btnDelete = new System.Windows.Forms.Button(); … … 45 45 // splitContainer1.Panel1 46 46 // 47 this.splitContainer1.Panel1.Controls.Add(this.l abel1);47 this.splitContainer1.Panel1.Controls.Add(this.lblRefresh); 48 48 this.splitContainer1.Panel1.Controls.Add(this.btnSave); 49 49 this.splitContainer1.Panel1.Controls.Add(this.btnDelete); … … 55 55 this.splitContainer1.TabIndex = 0; 56 56 // 57 // l abel157 // lblRefresh 58 58 // 59 this.l abel1.AutoSize = true;60 this.l abel1.Location = new System.Drawing.Point(127, 10);61 this.l abel1.Name = "label1";62 this.l abel1.Size = new System.Drawing.Size(126, 13);63 this.l abel1.TabIndex = 5;64 this.l abel1.Text = "Done. 5s to next refresh.";59 this.lblRefresh.AutoSize = true; 60 this.lblRefresh.Location = new System.Drawing.Point(127, 10); 61 this.lblRefresh.Name = "lblRefresh"; 62 this.lblRefresh.Size = new System.Drawing.Size(126, 13); 63 this.lblRefresh.TabIndex = 5; 64 this.lblRefresh.Text = "Done. 5s to next refresh."; 65 65 // 66 66 // btnSave 67 67 // 68 this.btnSave.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb;68 this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image"))); 69 69 this.btnSave.Location = new System.Drawing.Point(97, 4); 70 70 this.btnSave.Name = "btnSave"; … … 75 75 // btnDelete 76 76 // 77 this.btnDelete.Image = HeuristicLab.Common.Resources.VSImageLibrary.Delete;77 this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image"))); 78 78 this.btnDelete.Location = new System.Drawing.Point(66, 4); 79 79 this.btnDelete.Name = "btnDelete"; … … 84 84 // btnAddSlaveService 85 85 // 86 this.btnAddSlaveService.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;86 this.btnAddSlaveService.Image = ((System.Drawing.Image)(resources.GetObject("btnAddSlaveService.Image"))); 87 87 this.btnAddSlaveService.Location = new System.Drawing.Point(35, 4); 88 88 this.btnAddSlaveService.Name = "btnAddSlaveService"; … … 93 93 // btnAddSubscription 94 94 // 95 this.btnAddSubscription.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewFolder;95 this.btnAddSubscription.Image = ((System.Drawing.Image)(resources.GetObject("btnAddSubscription.Image"))); 96 96 this.btnAddSubscription.Location = new System.Drawing.Point(4, 4); 97 97 this.btnAddSubscription.Name = "btnAddSubscription"; … … 102 102 // treeCloudResources 103 103 // 104 this.treeCloudResources.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 105 | System.Windows.Forms.AnchorStyles.Left) 106 | System.Windows.Forms.AnchorStyles.Right))); 104 107 this.treeCloudResources.Location = new System.Drawing.Point(3, 34); 105 108 this.treeCloudResources.Name = "treeCloudResources"; … … 130 133 private System.Windows.Forms.Button btnDelete; 131 134 private System.Windows.Forms.Button btnAddSlaveService; 132 private System.Windows.Forms.Label l abel1;135 private System.Windows.Forms.Label lblRefresh; 133 136 } 134 137 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/CloudResourcesView.cs
r7281 r7317 1 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Drawing; 5 using System.Data; 6 using System.Linq; 7 using System.Text; 2 using System.Diagnostics; 3 using System.Threading; 4 using System.Timers; 8 5 using System.Windows.Forms; 6 using HeuristicLab.Clients.Hive.CloudManager.Model; 7 using HeuristicLab.Core; 8 using HeuristicLab.Core.Views; 9 using HeuristicLab.MainForm; 9 10 10 11 namespace HeuristicLab.Clients.Hive.CloudManager.Views { 11 public partial class CloudResourcesView : UserControl { 12 [View("Cloud Resources View")] 13 [Content(typeof(IItemList<Subscription>), IsDefaultView = true)] 14 public partial class CloudResourcesView : ItemView, IDisposable { 15 private System.Timers.Timer timer = new System.Timers.Timer(); 16 private int updateInterval = 15000; 17 private DateTime dueTime; 18 19 public new IItemList<Subscription> Content { 20 get { return (IItemList<Subscription>)base.Content; } 21 set { base.Content = value; } 22 } 23 12 24 public CloudResourcesView() { 13 25 InitializeComponent(); 26 27 CloudManagerClient.Instance.Refreshing += new EventHandler(Instance_Refreshing); 28 CloudManagerClient.Instance.Refreshed += new EventHandler(Instance_Refreshed); 29 30 timer.AutoReset = true; 31 timer.Interval = 1000; 32 timer.Elapsed += PerformUpdate; 33 timer.Start(); 34 dueTime = DateTime.Now.AddMilliseconds(updateInterval); 35 } 36 37 public new void Dispose() { 38 CloudManagerClient.Instance.Refreshing -= new EventHandler(Instance_Refreshing); 39 CloudManagerClient.Instance.Refreshed -= new EventHandler(Instance_Refreshed); 40 timer.Dispose(); 41 Debug.WriteLine("Dispose"); 42 } 43 44 void Instance_Refreshing(object sender, EventArgs e) { 45 Debug.WriteLine("Instance_Refreshing"); 46 } 47 48 void Instance_Refreshed(object sender, EventArgs e) { 49 Debug.WriteLine("Instance_Refreshed"); 50 } 51 52 private void PerformUpdate(object sender, ElapsedEventArgs e) { 53 TimeSpan timeToRefresh = dueTime - DateTime.Now; 54 55 if (timeToRefresh.Seconds >= 0) { 56 this.Invoke((MethodInvoker)delegate { lblRefresh.Text = "Done. " + timeToRefresh.Seconds + "s to next refresh."; }); 57 } else { 58 timer.Stop(); 59 this.Invoke((MethodInvoker)delegate { lblRefresh.Text = "Refreshing data ..."; }); 60 61 // statistics 62 Debug.WriteLine("perform update"); 63 Thread.Sleep(1000); 64 65 dueTime = DateTime.Now.AddMilliseconds(updateInterval); 66 timer.Start(); 67 } 14 68 } 15 69 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/HiveCloudManagerView.Designer.cs
r7281 r7317 26 26 this.tabResources = new System.Windows.Forms.TabControl(); 27 27 this.tabResource = new System.Windows.Forms.TabPage(); 28 this.cloudResourcesView = new HeuristicLab.Clients.Hive.CloudManager.Views.CloudResourcesView(); 28 29 this.tabResources.SuspendLayout(); 30 this.tabResource.SuspendLayout(); 29 31 this.SuspendLayout(); 30 32 // … … 43 45 // tabResource 44 46 // 47 this.tabResource.Controls.Add(this.cloudResourcesView); 45 48 this.tabResource.Location = new System.Drawing.Point(4, 22); 46 49 this.tabResource.Name = "tabResource"; … … 50 53 this.tabResource.Text = "Resources"; 51 54 this.tabResource.UseVisualStyleBackColor = true; 55 // 56 // cloudResourcesView 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) 60 | System.Windows.Forms.AnchorStyles.Right))); 61 this.cloudResourcesView.Caption = "Cloud Resources View"; 62 this.cloudResourcesView.Content = null; 63 this.cloudResourcesView.Location = new System.Drawing.Point(6, 3); 64 this.cloudResourcesView.Name = "cloudResourcesView"; 65 this.cloudResourcesView.ReadOnly = false; 66 this.cloudResourcesView.Size = new System.Drawing.Size(719, 505); 67 this.cloudResourcesView.TabIndex = 0; 52 68 // 53 69 // HiveCloudManagerView … … 59 75 this.Size = new System.Drawing.Size(745, 546); 60 76 this.tabResources.ResumeLayout(false); 77 this.tabResource.ResumeLayout(false); 61 78 this.ResumeLayout(false); 62 79 … … 67 84 private System.Windows.Forms.TabControl tabResources; 68 85 private System.Windows.Forms.TabPage tabResource; 86 private CloudResourcesView cloudResourcesView; 69 87 } 70 88 }
Note: See TracChangeset
for help on using the changeset viewer.