public static string GetCurrentPicturePath() { if (State == NowState.Stop) { throw new VideoSourceDeviceNotWorking(); } else if (State == NowState.LocalCamera) { FormMain fm = FormMain.GetInstance(); TempFileManager _tempFileManager = TempFileManager.GetInstance(); Image tempImage = fm.GetVideoSourcePlayer().GetCurrentVideoFrame(); string tempPath = _tempFileManager.AddTempFile(tempImage); return(tempPath); } else if (State == NowState.TcpIp) { TcpIpFileManager _tcpIpFileManager = TcpIpFileManager.GetInstance(); return(_tcpIpFileManager.TcpIpFilePath); } else { //Never Reach throw new LogicErrorException(); } return(null); }
protected FormMain() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; _stateManager = StateManager.GetInstance(); _tempFileManager = TempFileManager.GetInstance(); _tcpIpFileManager = TcpIpFileManager.GetInstance(); }