Exemple #1
0
        private GeofencingRequest CreateGeofencingRequest(IGeofence geofence)
        {
            var builder = new GeofencingRequest.Builder();

            builder.SetInitialTrigger(GeofencingRequest.InitialTriggerEnter);
            builder.AddGeofence(geofence);
            return(builder.Build());
        }
        public GeofencingRequest GetAddGeofencingRequest(IGeofence geofence)
        {
            List <IGeofence> geofencesToAdd = new List <IGeofence>();

            geofencesToAdd.Add(geofence);
            GeofencingRequest.Builder builder = new GeofencingRequest.Builder();
            builder.SetInitialTrigger(GeofencingRequest.InitialTriggerEnter);
            builder.AddGeofences(geofencesToAdd);
            return(builder.Build());
        }
Exemple #3
0
 internal static IGeofence BindGeofence(this IEnumerable <IPrimitive> items, IGeofence g)
 {
     if (items != null)
     {
         foreach (var i in items)
         {
             i.BindGeofence(g);
         }
     }
     return(g);
 }
 internal static IGeofence BindGeofence <T>(this IEnumerable <T> items, IGeofence g)
     where T : IGeofencingItem
 {
     if (items != null)
     {
         foreach (var i in items)
         {
             i.Geofence = g;
         }
     }
     return(g);
 }
Exemple #5
0
 public static IList <ITreeNode> ValidateRoots(this IGeofence geofence, IList <ITreeNode> actual)
 {
     if (actual == null && geofence.Nodes.Count != 0)
     {
         if (geofence.RootIndices == null)
         {
             geofence.RootIndices = new int[] { 0 };
         }
         IList <ITreeNode> roots = new List <ITreeNode>(geofence.RootIndices.Length);
         var nodes = geofence.Nodes;
         for (int i = 0; i != geofence.RootIndices.Length; i++)
         {
             if (i > 0 || i <= nodes.Count)
             {
                 roots.Add(nodes[i]);
             }
         }
         actual = roots;
     }
     return(actual);
 }
Exemple #6
0
 internal static void BindGeofence(this IPrimitive i, IGeofence g)
 {
     i.Geofence    = g;
     i.TriggerMask = i.BuildTriggerMask();
 }
Exemple #7
0
        /// <summary>
        /// Creates the geofence.
        /// </summary>
        /// <returns>The geofence.</returns>
        private static IGeofence CreateGeofence()
        {
            IGeofence geo = DependencyService.Get <IGeofence>();

            return(geo);
        }