Exemple #1
0
 private void Close()
 {
     try
     {
         imageProvider.Close();
     }
     catch (Exception e)
     {
         LogError(e, imageProvider.GetLastErrorMessage());
     }
 }
Exemple #2
0
 /* Closes the image provider and handles exceptions. */
 private void CloseTheImageProvider()
 {
     /* Close the image provider. */
     try
     {
         m_imageProvider.Close();
     }
     catch (Exception e)
     {
         ShowException(e, m_imageProvider.GetLastErrorMessage());
     }
 }
Exemple #3
0
        public void Close()
        {
            Stop();

            try
            {
                imageProvider.Close();
            }
            catch (Exception e)
            {
                LogError(e, imageProvider.GetLastErrorMessage());
            }
        }
Exemple #4
0
        /// <summary>
        /// Closes the image provider safely.
        /// </summary>
        public void Close()
        {
            try {
                ImageProvider.Close();

                HasStarted = false;
            } catch (Exception ex) {
                log.Fatal("ERROR while closing device with Index " + Index);
                log.Fatal("Device Info: " + FullName);

                log.Fatal("Exception: " + ex.ToString());

                OnErrorReceived?.Invoke(this, ex);
            }
        }
        public override void Connect()
        {
            //Stop,and Close
            m_imageProvider.Stop();
            m_imageProvider.Close();
            setStatus(GrabInstruction.Connect, GrabStage.Closed, GrabState.Idle);
            Status.IsConnection = false;


            List <DeviceEnumerator.Device> list = DeviceEnumerator.EnumerateDevices();
            var device = list.FirstOrDefault();

            if (device != null)
            {
                m_imageProvider.Open(device.Index);
                setStatus(GrabInstruction.Connect, GrabStage.Connected, GrabState.Idle);
                Status.IsConnection = true;
            }
        }
Exemple #6
0
 public void CloseCamera()
 {
     m_imageProvider.Stop();
     m_imageProvider.Close();
 }
 //释放句柄元素
 private void CloseTheImageProvider()
 {
     /* Close the image provider. */
     m_imageProvider.Close();
 }