/// <summary> /// Handle the Form Closed event for the Dashboard Form /// </summary> /// <param name="onClosed">The closed message</param> private void OnClosedHandler(OnClosed onClosed) { if (onClosed.DashboardForm == this.dashboardForm) { LogInfo("Form Closed"); this.mainPort.Post(new DsspDefaultDrop(DropRequestType.Instance)); ControlPanelPort.Post(new DsspDefaultDrop(DropRequestType.Instance)); if (this.cameraForm != null) { var closeWebcam = new FormInvoke( delegate { this.cameraForm.Close(); this.cameraForm = null; }); WinFormsServicePort.Post(closeWebcam); } if (this.depthCameraForm != null) { var closeDepthcam = new FormInvoke( delegate { this.depthCameraForm.Close(); this.depthCameraForm = null; }); WinFormsServicePort.Post(closeDepthcam); } } }
/// <summary> /// Create a form for the Depthcam /// </summary> /// <returns>An iterator</returns> private Form CreateDepthCamForm() { this.depthCameraForm = new DepthCamForm( this.mainPort, this.state.Options.DepthcamWindowStartX, this.state.Options.DepthcamWindowStartY, this.state.Options.DepthcamWindowWidth, this.state.Options.DepthcamWindowHeight); return(this.depthCameraForm); }