Beispiel #1
0
 private void HandleChange(FirebaseChildChangeEnum type, DataSnapshot snapshot, string previousChildName)
 {
     FirebaseXamarinHelper.RunOnUIThread(() =>
     {
         var snapData = DataConverter.Convert <T>(snapshot.Value, GetObjectFromHandler(eventDelegate));
         eventDelegate.OnSnapshot(type, previousChildName, new KeyValuePair <string, T>(snapshot.Key, snapData));
         SetObjectFromHandler(eventDelegate, snapData);
     });
 }
Beispiel #2
0
 public void OnDataChange(DataSnapshot snapshot)
 {
     if (snapshot.Exists())
     {
         //FirebaseXamarinHelper.RunOnUIThread(() =>
         //{
         try
         {
             var snapData = DataConverter.Convert <T>(snapshot.Value, GetObjectFromHandler(eventDelegate));
             eventDelegate.OnSnapshot(snapData);
             SetObjectFromHandler(eventDelegate, snapData);
         }
         catch (System.Exception ex)
         {
             var i = ex;
         }
     }
     else
     {
         eventDelegate.OnSnapshot(default(T));
     }
 }
 public override T GetValue()
 {
     return(DataConverter.Convert <T>(mutableData.Value));
 }