Esempio n. 1
0
        // Show camera options
        private void cameraMenuItem_Click(object sender, EventArgs e)
        {
            if (connected)
            {
                if (cameraOptionsForm == null)
                {
                    cameraOptionsForm                       = new CameraOptionsForm( );
                    cameraOptionsForm.FormClosing          += cameraOptionsForm_FormClosing;
                    cameraOptionsForm.PropertyValueChanged += cameraOptionsForm_PropertyValueChanged;
                }

                if (!cameraOptionsForm.Visible)
                {
                    cameraOptionsForm.Show(this);

                    if ((cameraOptionsFormX.HasValue) && (cameraOptionsFormY.HasValue))
                    {
                        cameraOptionsForm.Left = cameraOptionsFormX.Value;
                        cameraOptionsForm.Top  = cameraOptionsFormY.Value;
                    }

                    // get current settings of the camera
                    try
                    {
                        string resultMessage = WaitRequestCompletion("/camera/config");

                        cameraOptionsForm.SetCurrentSettings(resultMessage);
                    }
                    catch (ApplicationException ex)
                    {
                        ErrorBox("Failed getting camera's settings:\n\n" + ex.Message);
                    }
                }
            }
        }
Esempio n. 2
0
 // The camera's options form is about to close
 void cameraOptionsForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     cameraOptionsFormX = cameraOptionsForm.Left;
     cameraOptionsFormY = cameraOptionsForm.Top;
     cameraOptionsForm  = null;
 }