Esempio n. 1
0
        void griauleLibrary_onStatus(object source, StatusEventArgs se)
        {
            switch (se.StatusEventType)
            {
            case StatusEventType.SENSOR_PLUG:
                FingerprintSensors.Add(se.Source);
                OnSensorChanged(new SensorChangedEventArgs(se.Source, false));
                break;

            case StatusEventType.SENSOR_UNPLUG:
                FingerprintSensors.Remove(se.Source);
                OnSensorChanged(new SensorChangedEventArgs(se.Source, true));
                break;
            }
        }
Esempio n. 2
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         FingerprintSensors.Clear();
         if (!closed)
         {
             try
             {
                 try
                 {
                     griauleLibrary.CaptureFinalize();
                 }
                 catch (FingerprintException ex)
                 {
                     MessageBox.Show(String.Format("CaptureFinalize Error : {0} {1}", ex.ErrorCode, ex.Message), "FPLibrary Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
             catch (Exception e)
             {
                 MessageBox.Show(String.Format("Dispose Error : {0}", e.Message), "FPLibrary Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     if (griauleLibrary != null)
     {
         try
         {
             griauleLibrary.Finalizer();
             griauleLibrary = null;
         }
         catch (FingerprintException ex)
         {
             MessageBox.Show(String.Format("Finalizer Error : {0} {1}", ex.ErrorCode, ex.Message), "FPLibrary Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }