Пример #1
0
 private void UnRegisterLightListener()
 {
     manager.UnregisterListener(this);
     lastRecordTime = DateTime.MinValue;
 }
Пример #2
0
        public void Stop(InteractClient.Sensors.SensorType sensorType)
        {
            switch (sensorType)
            {
            case InteractClient.Sensors.SensorType.AcceleroMeter:
                if (sensorAccelerometer != null && sensorStatus[InteractClient.Sensors.SensorType.Tilt] == false)
                {
                    sensorManager.UnregisterListener(this, sensorAccelerometer);
                }
                break;

            case InteractClient.Sensors.SensorType.Gyroscope:
                if (sensorGyroscope != null)
                {
                    sensorManager.UnregisterListener(this, sensorGyroscope);
                }
                break;

            case InteractClient.Sensors.SensorType.MagnetoMeter:
                if (sensorMagnetometer != null && sensorStatus[InteractClient.Sensors.SensorType.Tilt] == false)
                {
                    sensorManager.UnregisterListener(this, sensorMagnetometer);
                }
                break;

            case InteractClient.Sensors.SensorType.Compass:
                if (sensorCompass != null)
                {
                    sensorManager.UnregisterListener(this, sensorCompass);
                }
                break;

            case InteractClient.Sensors.SensorType.Light:
                if (sensorLight != null)
                {
                    sensorManager.UnregisterListener(this, sensorLight);
                }
                break;

            case InteractClient.Sensors.SensorType.Pressure:
                if (sensorPressure != null)
                {
                    sensorManager.UnregisterListener(this, sensorPressure);
                }
                break;

            case InteractClient.Sensors.SensorType.Proximity:
                if (sensorProximity != null)
                {
                    sensorManager.UnregisterListener(this, sensorProximity);
                }
                break;

            case InteractClient.Sensors.SensorType.LinearAcceleration:
                if (sensorLinearAcceleration != null)
                {
                    sensorManager.UnregisterListener(this, sensorLinearAcceleration);
                }
                break;

            case InteractClient.Sensors.SensorType.Rotation:
                if (sensorRotation != null)
                {
                    sensorManager.UnregisterListener(this, sensorRotation);
                }
                break;

            case InteractClient.Sensors.SensorType.GameRotation:
                if (sensorGameRotation != null)
                {
                    sensorManager.UnregisterListener(this, sensorGameRotation);
                }
                break;

            case InteractClient.Sensors.SensorType.Humidity:
                if (sensorHumidity != null)
                {
                    sensorManager.UnregisterListener(this, sensorHumidity);
                }
                break;

            case InteractClient.Sensors.SensorType.AmbientTemperature:
                if (sensorAmbientTemperature != null)
                {
                    sensorManager.UnregisterListener(this, sensorAmbientTemperature);
                }
                break;

            case InteractClient.Sensors.SensorType.SignificantMotion:
                if (sensorSignificantMotion != null)
                {
                    sensorManager.CancelTriggerSensor(TriggerEventListener, sensorSignificantMotion);
                }
                break;

            case InteractClient.Sensors.SensorType.StepDetector:
                if (sensorStepDetector != null)
                {
                    sensorManager.CancelTriggerSensor(TriggerEventListener, sensorStepDetector);
                }
                break;

            case InteractClient.Sensors.SensorType.StepCounter:
                if (sensorStepCounter != null)
                {
                    sensorManager.UnregisterListener(this, sensorStepCounter);
                }
                break;

            case InteractClient.Sensors.SensorType.HeartRate:
                if (sensorHeartRate != null)
                {
                    sensorManager.UnregisterListener(this, sensorHeartRate);
                }
                break;

            case InteractClient.Sensors.SensorType.Pose:
                if (sensorPose != null)
                {
                    sensorManager.UnregisterListener(this, sensorPose);
                }
                break;

            case InteractClient.Sensors.SensorType.Stationary:
                if (sensorStationary != null)
                {
                    sensorManager.UnregisterListener(this, sensorStationary);
                }
                break;

            case InteractClient.Sensors.SensorType.Motion:
                if (sensorMotion != null)
                {
                    sensorManager.UnregisterListener(this, sensorMotion);
                }
                break;

            case InteractClient.Sensors.SensorType.HeartBeat:
                if (sensorHeartBeat != null)
                {
                    sensorManager.UnregisterListener(this, sensorHeartBeat);
                }
                break;

            case InteractClient.Sensors.SensorType.Tilt:
                if (sensorAccelerometer != null && sensorStatus[InteractClient.Sensors.SensorType.AcceleroMeter] == false)
                {
                    sensorManager.UnregisterListener(this, sensorAccelerometer);
                }
                if (sensorMagnetometer != null && sensorStatus[InteractClient.Sensors.SensorType.MagnetoMeter] == false)
                {
                    sensorManager.UnregisterListener(this, sensorMagnetometer);
                }
                break;
            }
            sensorStatus[sensorType] = false;
        }
Пример #3
0
 public void Stop()
 {
     sensorManager.UnregisterListener(this);
 }