public static bool AllowedOpenGate(this LocationInfo curretLocation, LocationInfo lastLocation, Location baseLocation, double radius, EDistanceType distanceType) { return( lastLocation.Ignition == EIgnition.ON && curretLocation.Ignition == EIgnition.OFF && lastLocation.LocationWithinRadius(baseLocation, radius, distanceType) && curretLocation.LocationWithinRadius(baseLocation, radius, distanceType) ); }