void HandleDidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
 {
     if (e.Region.Identifier.Equals(roximityBeaconId))
     {
         if (e.State == CLRegionState.Inside)
         {
             Console.WriteLine("Inside roximity beacon region [{0}]", e.Region.Identifier);
             locationManager.StartRangingBeacons(rBeaconRegion);
         }
         else if (e.State == CLRegionState.Outside)
         {
             Console.WriteLine("Outside roximity beacon region");
             locationManager.StopRangingBeacons(rBeaconRegion);
         }
     }
     else if (e.Region.Identifier.Equals(estimoteBeaconId))
     {
         if (e.State == CLRegionState.Inside)
         {
             Console.WriteLine("Inside estimote beacon region [{0}]", e.Region.Identifier);
             locationManager.StartRangingBeacons(eBeaconRegion);
         }
         else if (e.State == CLRegionState.Outside)
         {
             Console.WriteLine("Outside estimote beacon region");
             locationManager.StopRangingBeacons(eBeaconRegion);
         }
     }
 }
Пример #2
0
 void LocationMgr_DidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
 {
     if (e.State == CLRegionState.Inside)
     {
         var notification = new UILocalNotification {
             AlertBody = String.Format("Welcome back {0}", customer.FirstName)
         };
         UIApplication.SharedApplication.PresentLocalNotificationNow(notification);
         isAdventureInProgress = !isAdventureInProgress;
         Console.WriteLine("CLRegionState.Inside");
     }
     Console.WriteLine("CLRegionState.NotInside");
 }
        void HandleDidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
        {
            OnDebugInfo(String.Format("State for region {0} is {1}", e.Region.Identifier, e.State));

            if (e.State == CLRegionState.Inside)
            {
                OnEnterRegion(e.Region);
            }

            if (e.State == CLRegionState.Outside)
            {
                OnExitRegion(e.Region);
            }
        }
Пример #4
0
        /// <summary>
        /// Gets called after State is determined.
        /// </summary>
        /// <param name="sender">Sender who fired the event.</param>
        /// <param name="e">Event arguemnts</param>>
        private void DidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
        {
            switch (e.State)
            {
            case CLRegionState.Inside:
                System.Diagnostics.Debug.WriteLine(string.Format("{0} - {1}", CrossGeofence.Id, "StartedRegion: " + e.Region));
                this.OnRegionEntered(e.Region);
                break;

            case CLRegionState.Outside:
                break;

            default:
                string message = string.Format("{0} - {1}", CrossGeofence.Id, "Unknown region state");
                System.Diagnostics.Debug.WriteLine(message);
                break;
            }
        }
        void HandleDidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
        {
            if (e.Region.Identifier.Equals (roximityBeaconId)) {
                if (e.State == CLRegionState.Inside) {
                    Console.WriteLine ("Inside roximity beacon region [{0}]", e.Region.Identifier);
                    locationManager.StartRangingBeacons (rBeaconRegion);

                } else if (e.State == CLRegionState.Outside) {
                    Console.WriteLine ("Outside roximity beacon region");
                    locationManager.StopRangingBeacons (rBeaconRegion);
                }
            } else if (e.Region.Identifier.Equals (estimoteBeaconId)) {
                if (e.State == CLRegionState.Inside) {
                    Console.WriteLine ("Inside estimote beacon region [{0}]", e.Region.Identifier);
                    locationManager.StartRangingBeacons (eBeaconRegion);

                } else if (e.State == CLRegionState.Outside) {
                    Console.WriteLine ("Outside estimote beacon region");
                    locationManager.StopRangingBeacons (eBeaconRegion);
                }
            }
        }
Пример #6
0
        private void HandleDidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
        {
            MvxTrace.TaggedTrace(MvxTraceLevel.Diagnostic, "Beacons", "HandleDidDetermineState");
            if (e.State == CLRegionState.Inside)
            {
                if (!_regionsCache.ContainsKey(e.Region.Identifier))
                {
                    _regionsCache.Add(e.Region.Identifier, false);
                }

                MvxTrace.TaggedTrace(MvxTraceLevel.Diagnostic, "Beacons", $"Inside region {e.Region.Identifier}");
            }
            else if (e.State == CLRegionState.Outside)
            {
                if (_regionsCache.ContainsKey(e.Region.Identifier))
                {
                    _regionsCache.Remove(e.Region.Identifier);
                }

                MvxTrace.TaggedTrace(MvxTraceLevel.Diagnostic, "Beacons", $"Outside region {e.Region.Identifier}");
            }
        }
 /// <summary>
 /// Gets called after State is determined.
 /// </summary>
 /// <param name="sender">Sender who fired the event.</param>
 /// <param name="e">Event arguemnts</param>>
 private void DidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
 {
     switch (e.State)
     {
         case CLRegionState.Inside:
             System.Diagnostics.Debug.WriteLine(string.Format("{0} - {1}", CrossGeofence.Id, "StartedRegion: " + e.Region));
             this.OnRegionEntered(e.Region);
             break;
         case CLRegionState.Outside:
             break;
         default:
             string message = string.Format("{0} - {1}", CrossGeofence.Id, "Unknown region state");
             System.Diagnostics.Debug.WriteLine(message);
             break;
     }
 }
Пример #8
0
 private void DetermineStateForRegionComplete(object sender, CLRegionStateDeterminedEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("DetermineStateForRegionComplete");
     System.Diagnostics.Debug.WriteLine(e.ToString());
     _beaconManager.StartRangingBeacons(_fieldRegion);
 }
Пример #9
0
 private void DidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("DidDetermineState");
     System.Diagnostics.Debug.WriteLine(e.ToString());
 }
Пример #10
0
 public iOSRegionStateDeterminedEventArgs(CLRegionStateDeterminedEventArgs eventArgs)
 {
     CLRegionStateDeterminedEventArgs = eventArgs;
 }
Пример #11
0
 private void HandleDidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("HandleDidDetermineState");
 }
 private void LocationManager_DidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
 {
 }
Пример #13
0
 private void HandleDidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
 {
     Mvx.Resolve <IMvxTrace>().Trace(MvxTraceLevel.Diagnostic, "Beacon", "HandleDidDetermineState");
 }
 /// <summary>
 /// Converts the <see cref="CLRegionStateDeterminedEventArgs"/> to <see cref="RegionChangedEvent"/>.
 /// </summary>
 /// <param name="args">The arguments.</param>
 /// <returns>The notification.</returns>
 public static RegionChangedEvent ToNotification(this CLRegionStateDeterminedEventArgs args) =>
 new RegionChangedEvent(args.Region.ToGeoRegion(), RegionStates[args.State]);
Пример #15
0
 void LocationManager_DidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
 {
     _logger?.Information($"iOS: State for {e.Region.Identifier} is {e.State.ToString()}");
 }
Пример #16
0
 static void HandleDidDetermineState(object sender, CLRegionStateDeterminedEventArgs e)
 {
     switch (e.State) {
         case CLRegionState.Inside:
             Console.WriteLine ("region state inside");
             break;
         case CLRegionState.Outside:
             Console.WriteLine ("region state outside");
             break;
         case CLRegionState.Unknown:
             Console.WriteLine ("region unknown");
             break;
         default:
             Console.WriteLine ("region state unknown");
             break;
     }
 }