Пример #1
0
        public void OnComplete(Android.Gms.Tasks.Task task)
        {
            if (task.IsSuccessful)
            {
                var documents = (QuerySnapshot)task.Result;


                foreach (var doc in documents.Documents)
                {
                    Locations loc = new Locations();
                    loc.Centers = new List <string>();

                    loc.Location = (string)doc.Get("Location");
                    var centersDoc  = doc.Get("Centers");
                    var centersList = new Android.Runtime.JavaList((System.Collections.IEnumerable)centersDoc);

                    var list = centersList.ToArray();

                    for (int i = 0; i < list.Length; i++)
                    {
                        var o = (Java.Lang.Object)list[i].ToString();

                        loc.Centers.Add((string)o);
                    }

                    AllLocations.Add(loc);
                }
                HasLocations = true;
            }
            else
            {
                AllLocations.Clear();
            }
        }
Пример #2
0
 public static IEnumerable <T> Cast <T> (this Android.Runtime.JavaList list)
 {
     return(list.ToArray().Cast <T> ());
 }