ConSessionHistory.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. namespace ErgometerDoctorApplication
  8. {
  9. public class ConSessionHistory : Panel
  10. {
  11. private FlowLayoutPanel flowlayout;
  12. public ConSessionHistory() : base()
  13. {
  14. labelSessionHistory = new Label();
  15. this.Dock = System.Windows.Forms.DockStyle.Fill;
  16. this.Location = new System.Drawing.Point(0, 0);
  17. this.Name = "ConSessionHistory";
  18. this.Size = new System.Drawing.Size(584, 459);
  19. this.TabIndex = 0;
  20. //
  21. // labelSessionHistory
  22. //
  23. this.labelSessionHistory.Anchor = System.Windows.Forms.AnchorStyles.Top | AnchorStyles.Left;
  24. this.labelSessionHistory.AutoSize = true;
  25. this.labelSessionHistory.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  26. this.labelSessionHistory.Location = new System.Drawing.Point(20, 20);
  27. this.labelSessionHistory.Name = "labelSessionHistory";
  28. this.labelSessionHistory.Size = new System.Drawing.Size(103, 21);
  29. this.labelSessionHistory.TabIndex = 3;
  30. this.labelSessionHistory.Text = "Er zijn geen oude sessies.";
  31. flowlayout = new FlowLayoutPanel();
  32. flowlayout.Dock = DockStyle.Fill;
  33. flowlayout.BackColor = System.Drawing.Color.WhiteSmoke;
  34. flowlayout.Location = new System.Drawing.Point(0, 0);
  35. flowlayout.Name = "flowlayout";
  36. flowlayout.Padding = new Padding(15);
  37. flowlayout.AutoScroll = true;
  38. this.Controls.Add(labelSessionHistory);
  39. this.Controls.Add(flowlayout);
  40. //this.Controls.Add(data);
  41. updateHistory(MainClient.oldSessionsData);
  42. }
  43. public System.Windows.Forms.Label labelSessionHistory;
  44. public void updateHistory(List<Tuple<string, double, int>> historys)
  45. {
  46. flowlayout.Controls.Clear();
  47. foreach (Tuple<string,double,int> sessiondata in historys)
  48. {
  49. flowlayout.Controls.Add(new SessionPanel(sessiondata.Item3, sessiondata.Item1, false,sessiondata.Item2));
  50. }
  51. }
  52. }
  53. }