public frm_TTBTimeAidingCfg CreateTTBTimeAidCfgWindow(PortManager target) { if (target == null) { return null; } frm_TTBTimeAidingCfg cfg = null; if (target.comm.IsSourceDeviceOpen()) { string str = "Configure Time Aiding: " + target.comm.PortName; cfg = new frm_TTBTimeAidingCfg(); cfg.CommWindow = target.comm; cfg.Text = str; cfg.ShowDialog(); return cfg; } MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); return cfg; }