public VsScanner() { InitializeComponent(); // form load handler this.Load += new EventHandler(VsMonitor_Load); this.Resize += new EventHandler(VsMonitor_Resize); this.FormClosing += new FormClosingEventHandler(VsMonitor_FormClosing); try { // new object vsCoreMonitor = new VsCoreServer(Path.GetDirectoryName(Application.ExecutablePath)); // allow to save all configs to files vsCoreMonitor.SaveConfigToFile = true; // Initial application core vsCoreMonitor.VsMonitorInitial(); VsSplasher.Status = "Load application setting..."; System.Threading.Thread.Sleep(1500); VsSplasher.Close(); } catch (Exception err) { logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace); } }
// Construction public VsChannelDialog(VsCoreServer vsCore) { this.AddPage(vsChannelDescription); this.AddPage(vsChannelStructure); this.Text = "Add Layout"; vsCoreMonitor = vsCore; vsChannelDescription.CoreMonitor = vsCore; vsChannelStructure.CoreMonitor = vsCore; vsAnalyzerSetting.CoreMonitor = vsCore; vsEncoderSetting.CoreMonitor = vsCore; this.imagePanel.Visible = false; }
// Construction public VsCameraPropertiesDialog(VsCoreServer vsCore) { this.AddPage(vsCameraDescription); this.AddPage(vsCameraSetting); this.AddPage(vsAnalyzerSetting); this.AddPage(vsEncoderSetting); this.Text = "Add New Camera"; // set current core vsCoreMonitor = vsCore; vsCameraDescription.CoreMonitor = vsCore; vsCameraSetting.CoreMonitor = vsCore; vsAnalyzerSetting.CoreMonitor = vsCore; vsEncoderSetting.CoreMonitor = vsCore; }
// Construction public VsAnalyzerDialog(VsCoreServer vsCore, VsCamera vsCam) { this.AddPage(vsAnalyzerSetting); vsAnalyzerSetting.CoreMonitor = vsCoreMonitor; vsAnalyzerSetting.Camera = vsCam; // set current core vsCamera = vsCam; vsCoreMonitor = vsCore; this.Text = "Analyzer"; this.buttonApply.Visible = true; this.backButton.Visible = false; this.nextButton.Visible = false; this.imagePanel.Visible = false; }
// Construction public VsCameraDialog(VsCoreServer vsCore) { this.AddPage(vsCameraDescription); this.AddPage(vsCameraSetting); this.Text = "Add Analyzer"; // set current core vsCoreMonitor = vsCore; vsCameraDescription.CoreMonitor = vsCore; vsCameraSetting.CoreMonitor = vsCore; vsAnalyzerSetting.CoreMonitor = vsCore; vsEncoderSetting.CoreMonitor = vsCore; this.imagePanel.Visible = false; }
// form close void VsMonitor_Close() { //formState.Restore(this); if (vsCoreMonitor != null) { // disconnect all camera vsCoreMonitor.DisconnectCameraAll(); // Dispose vsCoreMonitor.Dispose(); vsCoreMonitor = null; } }
// ShutdownServer public void ShutdownServer() { try { if (this.vsClients != null) { SaveSettings(); strMsg = String.Format("Shutdown VsServer."); Console.WriteLine(strMsg); SendStatus(strMsg); foreach (ClientManager mngr in this.vsClients) mngr.Disconnect(); GC.Collect(); this.vsBackgroundListener.CancelAsync(); this.vsBackgroundListener.Dispose(); this.vsListenerSocket.Close(); // mixer stop vsServer.StopAll(); vsServer.Dispose(); vsServer = null; Console.WriteLine("****VsServer Shutdown.**********************"); } } catch (Exception err) { SendStatus(err.Message); } }
public VsLive() { try { InitializeComponent(); Vs.Monitor.VsSplasher.Status = "Load application setting..."; System.Threading.Thread.Sleep(1000); Vs.Monitor.VsSplasher.LoginSerivce(); while (Vs.Monitor.VsSplasher.Blocked) System.Threading.Thread.Sleep(100); if (!Vs.Monitor.VsSplasher.Connected) { this.Hide(); bCancel = true; // this.Close(); //VsMonitor_Close(); return; } else { //VsSplasher.Close(); // form load handler this.Load += new EventHandler(VsMonitor_Load); this.Resize += new EventHandler(VsMonitor_Resize); this.FormClosing += new FormClosingEventHandler(VsMonitor_FormClosing); //Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); // new object string configPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "OpenVss\\VsClient\\"); ; vsCoreMonitor = new VsCoreServer(Path.GetDirectoryName(Application.ExecutablePath)); // allow to save all configs to files vsCoreMonitor.SaveConfigToFile = true; // Initial application core vsCoreMonitor.VsMonitorInitial(configPath); } VsSplasher.Close(); } catch (Exception err) { logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace); } }