コード例 #1
0
 public static T GetSampleContext <T>(this INode node, IGeofencingSample sample)
     where T : IGeofencingContext
 {
     if (sample.Cache != null)
     {
         var key = GeofencingKey.SharedPool.Get();
         key.Id  = node.Id;
         key.Who = sample.Who;
         try
         {
             if (sample.Cache.TryGetValue(key, out var context))
             {
                 return((T)context);
             }
         }
         finally
         {
             GeofencingKey.SharedPool.Return(key);
         }
     }
     return(default);
コード例 #2
0
 public static IEnumerable <IGeofencingEvent> Apply(this INode node, IGeofencingSample location)
 {
     return(Enumerable.Empty <IGeofencingEvent>());
 }
コード例 #3
0
 public static IEnumerable <IGeofencingEvent> Apply(this IEnumerable <INode> nodes, IGeofencingSample location) => nodes.SelectMany(n => n.Apply(location));