ConActiveSessions.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Security.AccessControl;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Forms;
  8. namespace ErgometerDoctorApplication
  9. {
  10. public class ConActiveSessions : Panel
  11. {
  12. private FlowLayoutPanel flowlayout;
  13. public ConActiveSessions() : base()
  14. {
  15. labelActiveSessions = new Label();
  16. //
  17. // ConActiveSessions
  18. //
  19. this.Dock = System.Windows.Forms.DockStyle.Fill;
  20. this.Location = new System.Drawing.Point(0, 0);
  21. this.Name = "ConActiveSessions";
  22. this.Size = new System.Drawing.Size(584, 459);
  23. this.TabIndex = 0;
  24. //
  25. // labelActiveSessions
  26. //
  27. this.labelActiveSessions.Anchor = System.Windows.Forms.AnchorStyles.Top | AnchorStyles.Left;
  28. this.labelActiveSessions.AutoSize = true;
  29. this.labelActiveSessions.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  30. this.labelActiveSessions.Location = new System.Drawing.Point(20, 20);
  31. this.labelActiveSessions.Name = "labelActiveSessions";
  32. this.labelActiveSessions.Size = new System.Drawing.Size(103, 21);
  33. this.labelActiveSessions.TabIndex = 3;
  34. this.labelActiveSessions.Text = "Er zijn geen actieve sessies.";
  35. flowlayout = new FlowLayoutPanel();
  36. flowlayout.Dock = DockStyle.Fill;
  37. flowlayout.BackColor = System.Drawing.Color.WhiteSmoke;
  38. flowlayout.Location = new System.Drawing.Point(0, 0);
  39. flowlayout.Name = "flowlayout";
  40. flowlayout.Padding = new Padding(15);
  41. flowlayout.AutoScroll = true;
  42. this.Controls.Add(labelActiveSessions);
  43. this.Controls.Add(flowlayout);
  44. //this.Controls.Add(data);
  45. updateActiveSessions(MainClient.activesessions);
  46. }
  47. public System.Windows.Forms.Label labelActiveSessions;
  48. public void updateActiveSessions(Dictionary<int, string> actives)
  49. {
  50. flowlayout.Controls.Clear();
  51. foreach (KeyValuePair<int, string> pair in actives)
  52. {
  53. flowlayout.Controls.Add(new SessionPanel(pair.Key, pair.Value, true,0));
  54. }
  55. }
  56. /*
  57. private void data_CellContentClick(object sender, DataGridViewCellEventArgs e)
  58. {
  59. if (data.Rows[e.RowIndex].Cells[1].Value != null)
  60. {
  61. MainClient.StartNewCLient(data.Rows[e.RowIndex].Cells[0].Value + "", int.Parse(data.Rows[e.RowIndex].Cells[1].Value + ""));
  62. }
  63. }
  64. public System.Windows.Forms.DataGridViewTextBoxColumn name;
  65. public System.Windows.Forms.DataGridViewTextBoxColumn sessionId;
  66. public System.Windows.Forms.DataGridView data;
  67. */
  68. }
  69. }