- Timestamp:
- 05/30/12 16:37:17 (12 years ago)
- Location:
- branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/ClientViews/ClientInformationDialog.Designer.cs
r7557 r7933 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ClientInformationDialog)); 26 27 this.clientView = new HeuristicLab.Clients.Access.Views.ClientView(); 28 this.refreshButton = new System.Windows.Forms.Button(); 29 this.okButton = new System.Windows.Forms.Button(); 30 this.registerClientButton = new System.Windows.Forms.Button(); 31 this.infoLabel = new System.Windows.Forms.Label(); 27 32 this.SuspendLayout(); 28 33 // … … 33 38 this.clientView.Caption = "Client View"; 34 39 this.clientView.Content = null; 35 this.clientView.Location = new System.Drawing.Point(12, 12);40 this.clientView.Location = new System.Drawing.Point(12, 42); 36 41 this.clientView.Name = "clientView"; 37 42 this.clientView.ReadOnly = false; 38 this.clientView.Size = new System.Drawing.Size( 528, 452);43 this.clientView.Size = new System.Drawing.Size(653, 315); 39 44 this.clientView.TabIndex = 0; 45 // 46 // refreshButton 47 // 48 this.refreshButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh; 49 this.refreshButton.Location = new System.Drawing.Point(12, 12); 50 this.refreshButton.Name = "refreshButton"; 51 this.refreshButton.Size = new System.Drawing.Size(24, 24); 52 this.refreshButton.TabIndex = 1; 53 this.refreshButton.UseVisualStyleBackColor = true; 54 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); 55 // 56 // okButton 57 // 58 this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 59 this.okButton.Location = new System.Drawing.Point(590, 363); 60 this.okButton.Name = "okButton"; 61 this.okButton.Size = new System.Drawing.Size(75, 23); 62 this.okButton.TabIndex = 2; 63 this.okButton.Text = "OK"; 64 this.okButton.UseVisualStyleBackColor = true; 65 this.okButton.Click += new System.EventHandler(this.okButton_Click); 66 // 67 // registerClientButton 68 // 69 this.registerClientButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 70 this.registerClientButton.Location = new System.Drawing.Point(13, 362); 71 this.registerClientButton.Name = "registerClientButton"; 72 this.registerClientButton.Size = new System.Drawing.Size(84, 23); 73 this.registerClientButton.TabIndex = 3; 74 this.registerClientButton.Text = "Register client"; 75 this.registerClientButton.UseVisualStyleBackColor = true; 76 this.registerClientButton.Visible = false; 77 this.registerClientButton.Click += new System.EventHandler(this.registerClientButton_Click); 78 // 79 // infoLabel 80 // 81 this.infoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 82 this.infoLabel.AutoSize = true; 83 this.infoLabel.Location = new System.Drawing.Point(103, 367); 84 this.infoLabel.Name = "infoLabel"; 85 this.infoLabel.Size = new System.Drawing.Size(434, 13); 86 this.infoLabel.TabIndex = 4; 87 this.infoLabel.Text = "Your client isn\'t registered yet. Click on the Register client button to use addi" + 88 "tional services."; 89 this.infoLabel.Visible = false; 40 90 // 41 91 // ClientInformationDialog … … 43 93 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 44 94 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 45 this.ClientSize = new System.Drawing.Size(552, 345); 95 this.ClientSize = new System.Drawing.Size(677, 398); 96 this.Controls.Add(this.infoLabel); 97 this.Controls.Add(this.registerClientButton); 98 this.Controls.Add(this.okButton); 99 this.Controls.Add(this.refreshButton); 46 100 this.Controls.Add(this.clientView); 47 101 this.MaximizeBox = false; … … 54 108 this.TopMost = true; 55 109 this.ResumeLayout(false); 110 this.PerformLayout(); 56 111 57 112 } … … 60 115 61 116 private ClientView clientView; 117 private System.Windows.Forms.Button refreshButton; 118 private System.Windows.Forms.Button okButton; 119 private System.Windows.Forms.Button registerClientButton; 120 private System.Windows.Forms.Label infoLabel; 62 121 } 63 122 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/ClientViews/ClientInformationDialog.cs
r7557 r7933 20 20 #endregion 21 21 22 using System; 23 using System.Threading.Tasks; 22 24 using System.Windows.Forms; 23 25 … … 28 30 } 29 31 30 protected override void OnLoad(System.EventArgs e) { 31 base.OnLoad(e); 32 private void okButton_Click(object sender, System.EventArgs e) { 33 Close(); 34 } 32 35 33 clientView.Content = ClientInformation.Instance.ClientInfo; 36 private void refreshButton_Click(object sender, System.EventArgs e) { 37 Refresh(); 38 } 39 40 private void registerClientButton_Click(object sender, EventArgs e) { 41 using (ClientRegistrationDialog regDialog = new ClientRegistrationDialog()) { 42 regDialog.ShowDialog(this); 43 Refresh(); 44 } 45 } 46 47 private void Refresh() { 48 clientView.StartProgressView(); 49 Task.Factory.StartNew(new Action(delegate { 50 ClientInformation.Instance.Refresh(); 51 clientView.Content = ClientInformation.Instance.ClientInfo; 52 clientView.FinishProgressView(); 53 EnableRegistration(); 54 })); 55 } 56 57 private void EnableRegistration() { 58 if (InvokeRequired) { 59 Invoke(new Action(EnableRegistration)); 60 } else { 61 registerClientButton.Visible = !ClientInformation.Instance.ClientExists; 62 infoLabel.Visible = !ClientInformation.Instance.ClientExists; 63 } 34 64 } 35 65 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/ClientViews/ClientView.Designer.cs
r7557 r7933 155 155 this.txtName.Location = new System.Drawing.Point(110, 3); 156 156 this.txtName.Name = "txtName"; 157 this.txtName.ReadOnly = true; 157 158 this.txtName.Size = new System.Drawing.Size(265, 20); 158 159 this.txtName.TabIndex = 12; … … 164 165 this.txtDescription.Location = new System.Drawing.Point(111, 29); 165 166 this.txtDescription.Name = "txtDescription"; 167 this.txtDescription.ReadOnly = true; 166 168 this.txtDescription.Size = new System.Drawing.Size(264, 20); 167 169 this.txtDescription.TabIndex = 13; … … 173 175 this.txtVersion.Location = new System.Drawing.Point(111, 55); 174 176 this.txtVersion.Name = "txtVersion"; 177 this.txtVersion.ReadOnly = true; 175 178 this.txtVersion.Size = new System.Drawing.Size(264, 20); 176 179 this.txtVersion.TabIndex = 14; … … 182 185 this.txtTimestamp.Location = new System.Drawing.Point(110, 107); 183 186 this.txtTimestamp.Name = "txtTimestamp"; 187 this.txtTimestamp.ReadOnly = true; 184 188 this.txtTimestamp.Size = new System.Drawing.Size(265, 20); 185 189 this.txtTimestamp.TabIndex = 15; … … 191 195 this.txtMemory.Location = new System.Drawing.Point(110, 81); 192 196 this.txtMemory.Name = "txtMemory"; 197 this.txtMemory.ReadOnly = true; 193 198 this.txtMemory.Size = new System.Drawing.Size(265, 20); 194 199 this.txtMemory.TabIndex = 16; … … 200 205 this.txtNumberOfCores.Location = new System.Drawing.Point(110, 133); 201 206 this.txtNumberOfCores.Name = "txtNumberOfCores"; 207 this.txtNumberOfCores.ReadOnly = true; 202 208 this.txtNumberOfCores.Size = new System.Drawing.Size(265, 20); 203 209 this.txtNumberOfCores.TabIndex = 17; … … 209 215 this.txtClientType.Location = new System.Drawing.Point(111, 185); 210 216 this.txtClientType.Name = "txtClientType"; 217 this.txtClientType.ReadOnly = true; 211 218 this.txtClientType.Size = new System.Drawing.Size(264, 20); 212 219 this.txtClientType.TabIndex = 18; … … 218 225 this.txtClientConfiguration.Location = new System.Drawing.Point(110, 237); 219 226 this.txtClientConfiguration.Name = "txtClientConfiguration"; 227 this.txtClientConfiguration.ReadOnly = true; 220 228 this.txtClientConfiguration.Size = new System.Drawing.Size(265, 20); 221 229 this.txtClientConfiguration.TabIndex = 19; … … 227 235 this.txtProcessor.Location = new System.Drawing.Point(111, 159); 228 236 this.txtProcessor.Name = "txtProcessor"; 237 this.txtProcessor.ReadOnly = true; 229 238 this.txtProcessor.Size = new System.Drawing.Size(264, 20); 230 239 this.txtProcessor.TabIndex = 20; … … 236 245 this.txtOS.Location = new System.Drawing.Point(111, 211); 237 246 this.txtOS.Name = "txtOS"; 247 this.txtOS.ReadOnly = true; 238 248 this.txtOS.Size = new System.Drawing.Size(264, 20); 239 249 this.txtOS.TabIndex = 21; … … 245 255 this.txtPerformanceValue.Location = new System.Drawing.Point(110, 263); 246 256 this.txtPerformanceValue.Name = "txtPerformanceValue"; 257 this.txtPerformanceValue.ReadOnly = true; 247 258 this.txtPerformanceValue.Size = new System.Drawing.Size(265, 20); 248 259 this.txtPerformanceValue.TabIndex = 23; … … 263 274 this.txtId.Location = new System.Drawing.Point(111, 289); 264 275 this.txtId.Name = "txtId"; 276 this.txtId.ReadOnly = true; 265 277 this.txtId.Size = new System.Drawing.Size(264, 20); 266 278 this.txtId.TabIndex = 25; -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/ClientViews/ClientView.cs
r7557 r7933 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Core.Views; 23 24 using HeuristicLab.MainForm; 25 using HeuristicLab.MainForm.WindowsForms; 24 26 25 27 namespace HeuristicLab.Clients.Access.Views { … … 31 33 set { base.Content = value; } 32 34 } 35 36 private ProgressView progressView; 33 37 34 38 public ClientView() { … … 73 77 } 74 78 } 79 80 public void StartProgressView() { 81 if (InvokeRequired) { 82 Invoke(new Action(StartProgressView)); 83 } else { 84 if (progressView == null) { 85 IProgress prog = new Progress(); 86 prog.Status = "Downloading client information. Please be patient."; 87 progressView = new ProgressView(this, prog); 88 } 89 } 90 } 91 92 public void FinishProgressView() { 93 if (InvokeRequired) { 94 Invoke(new Action(FinishProgressView)); 95 } else { 96 if (progressView != null) { 97 progressView.Finish(); 98 progressView = null; 99 SetEnabledStateOfControls(); 100 } 101 } 102 } 75 103 } 76 104 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/MenuItems/ClientInfoMenuItem.cs
r7557 r7933 32 32 } 33 33 public override void Execute() { 34 if (ClientInformation.Instance.ClientExists) { 35 using (ClientInformationDialog dialog = new ClientInformationDialog()) { 36 dialog.ShowDialog(); 37 } 38 } else { 39 using (ClientRegistrationDialog regDialog = new ClientRegistrationDialog()) { 40 regDialog.ShowDialog(); 41 } 34 using (ClientInformationDialog dialog = new ClientInformationDialog()) { 35 dialog.ShowDialog(); 42 36 } 43 37 }
Note: See TracChangeset
for help on using the changeset viewer.