public frmMain() { InitializeComponent(); this.Text = Title + " - V" + Version.ToString(3); currentTestModeItem = dUT1ToDUT2ToolStripMenuItem; deviceList = new List <AdbDeviceInfomation>(); Logger.LiveLogEventHandler += new EventHandler <LoggerLiveMessageEventArgs>(liveLogMessageEventHandler); Logger.LogLevel = Logger.LogLevels.Verbose; startDevicesMonitor(); //if (ucDUT == null) //{ // ucDUT = new ucDutTelephonyAutomation(this); //} if (uc8960 == null) { uc8960 = new uc8960TelephonyAutomation(this); } menuTestMode_Clicked(_8960toDUTToolStripMenuItem, new EventArgs()); }
private void menuTestMode_Clicked(object sender, EventArgs e) { ToolStripMenuItem item = sender as ToolStripMenuItem; UserControl usrctl = null; currentTestModeItem = item; foreach (ToolStripMenuItem tsmi in testModeToolStripMenuItem.DropDownItems) { tsmi.Checked = false; } item.Checked = true; switch (item.Name) { case "dUT1ToDUT2ToolStripMenuItem": //if (ucDUT == null) //{ // ucDUT = new ucDutTelephonyAutomation(this); //} //usrctl = ucDUT; break; case "_8960toDUTToolStripMenuItem": if (uc8960 == null) { uc8960 = new uc8960TelephonyAutomation(this); } usrctl = uc8960; break; default: break; } if (usrctl != null) { pnlMain.Controls.Clear(); pnlMain.Controls.Add(usrctl); usrctl.Dock = DockStyle.Fill; usrctl.Show(); } }