MainWindow.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using IntelligentControlForsx.ChildForms;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. using IntelligentControlForsx.MyControls;
  12. using IntelligentControlForsx.Service;
  13. using IntelligentControlForsx.Start;
  14. using IntelligentControlForsx.Template;
  15. namespace IntelligentControlForsx
  16. {
  17. public partial class MainWindow : Form
  18. {
  19. private int childFormNumber = 0;
  20. private NavService navSvc;
  21. public MainWindow()
  22. {
  23. InitializeComponent();
  24. navSvc = NavService.Instance;
  25. this.title1.MyClick += Title1_MyClick;
  26. this.bottom1.MyClick += Bottom1_MyClick;
  27. ShowNewForm(this, new EventArgs());
  28. NavService.title = this.title1;
  29. NavService.projectBottom2 = this.bottom1;
  30. }
  31. private void Title1_MyClick(object sender, EventArgs e)
  32. {
  33. navSvc.Nav(sender.ToString(), this);
  34. }
  35. public string SelectStationId { get; set; }
  36. private void Bottom1_MyClick(object sender, EventArgs e)
  37. {
  38. string stId = sender.ToString();
  39. if (stId.EndsWith("_FDC") || stId.Equals("0") || stId.Equals("-1"))
  40. {
  41. SelectStationId = stId;
  42. navSvc.StationSelectedChanged(stId);
  43. }
  44. }
  45. private void ShowNewForm(object sender, EventArgs e)
  46. {
  47. navSvc.Nav("pictureBoxHome", this);
  48. }
  49. }
  50. }