123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using IntelligentControlForsx.MyControls;
- using IntelligentControlForsx.Template;
- using IntelligentControlForsx.MyControls.syz;
- using IntelligentControlForsx.Service;
- namespace IntelligentControlForsx.ChildForms
- {
- public partial class ElectricalForm : TemplateForm
- {
- public Dictionary<string, ZTControl> dicControl = new Dictionary<string, ZTControl>();
- private string stationId;
- public string StationId
- {
- set
- {
- ZTControl showControl = dicControl[value];
- showControl.Active();
- //showControl.AiveContro();
- if (String.IsNullOrWhiteSpace(stationId) == false && stationId != value)
- {
- ZTControl hideControl = dicControl[stationId];
- if (hideControl != null)
- hideControl.DeActive();
- }
- stationId = value;
- }
- get { return stationId; }
- }
- public ElectricalForm()
- {
- InitializeComponent();
- dicControl.Add("MHS_FDC", this.syz_mhs1);
- dicControl.Add("SBQ_FDC", this.syz_sbq1);
- dicControl.Add("XS_FDC", this.syz_xs1);
- dicControl.Add("NSS_FDC", this.syz_nss1);
- dicControl.Add("QS_FDC", this.syz_qs1);
- this.StationId = NavService.Instance.StationId;
- }
- public override void Active()
- {
- this.Show();
- ZTControl showControl = dicControl[stationId];
- showControl.Active();
- }
- public override void DeActive()
- {
- this.Hide();
- ZTControl showControl = dicControl[stationId];
- showControl.DeActive();
- }
- public override void SelectedStationChanged(string stationId)
- {
- this.StationId = stationId;
- }
- }
- }
|