Пример #1
0
        /// <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);
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Create a form for the webcam
 /// </summary>
 /// <returns>A Webcam Form</returns>
 private Form CreateWebCamForm()
 {
     this.cameraForm = new WebCamForm(
         this.mainPort,
         this.state.Options.WebcamWindowStartX,
         this.state.Options.WebcamWindowStartY,
         this.state.Options.WebcamWindowWidth,
         this.state.Options.WebcamWindowHeight);
     return(this.cameraForm);
 }