public void AddModule(IJFModule_DIO module, string moduleName) { if (null == module) { return; } if (_lstModules.Contains(module)) { return; } if (null == moduleName) { moduleName = "DIO"; } TabPage tp = new TabPage(); tabCtrl.TabPages.Add(tp); UcDIO uc = new UcDIO(); uc.Dock = DockStyle.Fill; uc.Parent = tp; uc.Visible = true; uc.SetDioModule(module, null, null); tp.Text = moduleName; tp.Name = moduleName; tp.Controls.Add(uc); _lstModules.Add(module); }
public void UpdateModleStatus() { if (InvokeRequired) { Invoke(new Action(UpdateModleStatus)); return; } if (_lstModules.Count == 0) { return; } if (tabCtrl.SelectedIndex < 0) { return; } UcDIO uc = tabCtrl.TabPages[tabCtrl.SelectedIndex].Controls[0] as UcDIO; uc.UpdateSrc2UI(); }