Beispiel #1
0
        private void ChildRemoved(IDocumentSnapshot document)
        {
            var key  = document.Id;
            var info = _locationInfos[key];

            if (info == null)
            {
                return;
            }
            lock (_lock)
            {
                var location = GeoFire.GetLocationValue(document);
                var hash     = (location != null) ? new GeoHash(location) : null;
                if (hash != null && GeoHashQueriesContainGeoHash(hash))
                {
                    return;
                }

                _locationInfos.Remove(key);

                if (!info.InGeoQuery)
                {
                    return;
                }

                OnDocumentExited?.Invoke(this, new DocumentEventArgs <T>(info.Snapshot.ToObject <T>()));
            }
        }
Beispiel #2
0
        private void ChildChanged(IDocumentSnapshot document)
        {
            var location = GeoFire.GetLocationValue(document);

            if (location != null)
            {
                UpdateLocationInfo(document, location);
            }
            else
            {
                Debug.Assert(false, "Got Datasnapshot without location with key " + document.Id);
            }
        }