예제 #1
0
 public bool Triggers(PointOfInterestProximityTrigger trigger, double distanceMeters)
 {
     return
         ((string.IsNullOrWhiteSpace(trigger.PointOfInterestName) || _name == trigger.PointOfInterestName) &&
          (string.IsNullOrWhiteSpace(trigger.PointOfInterestType) || _type == trigger.PointOfInterestType) &&
          (trigger.DistanceThresholdDirection == ProximityThresholdDirection.Within && distanceMeters <= trigger.DistanceThresholdMeters ||
           trigger.DistanceThresholdDirection == ProximityThresholdDirection.Outside && distanceMeters > trigger.DistanceThresholdMeters));
 }
 public PointOfInterestProximityDatum(DateTimeOffset timestamp, PointOfInterest pointOfInterest, double distanceMeters, PointOfInterestProximityTrigger trigger)
     : base(timestamp)
 {
     _poiName                  = pointOfInterest.Name;
     _poiType                  = pointOfInterest.Type;
     _poiLatitude              = pointOfInterest.Position.Latitude;
     _poiLongitude             = pointOfInterest.Position.Longitude;
     _distanceToPoiMeters      = distanceMeters;
     _triggerDistanceMeters    = trigger.DistanceThresholdMeters;
     _triggerDistanceDirection = trigger.DistanceThresholdDirection;
 }