Beispiel #1
0
        private async void DHM_Main_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (!ready_to_Close)
            {
                e.Cancel = true;
                if (icImagingControl1.LiveVideoRunning)
                {
                    await Task.Run(() => StopLiveVideo());
                }
                icImagingControl1.DeviceFrameFilters.Clear();

                if (camView != null)
                {
                    camView.Close();
                }
                if (phaseView != null)
                {
                    phaseView.Close();
                }
                if (intensityView != null)
                {
                    intensityView.Close();
                }
                if (fTView != null)
                {
                    fTView.Close();
                }

                rawData.Dispose();

                Properties.Settings.Default.Save();
                try {
                    icImagingControl1.Dispose();
                }
                finally {
                    ready_to_Close = true;
                    this.Close();
                }
            }
            else
            {
            }
        }