/// <summary> /// 单例模式,返回单个窗体对象 /// </summary> /// <returns></returns> public static FrmBarcode GetSingleton() { //if(frm==null || frm.IsDisposed) if (frm == null) { frm = new FrmBarcode(); } return(frm); }
private void FrmBarcode_FormClosing(object sender, FormClosingEventArgs e) { videoSourcePlayer1.SignalToStop(); videoSourcePlayer1.WaitForStop(); videoSourcePlayer2.SignalToStop(); videoSourcePlayer2.WaitForStop(); frm = null; serialPort1.Close(); }