public void OnGpsStatusChanged(GpsEvent e)
        {
            GpsStatus gpsStatus = locationManager.GetGpsStatus(null);

            if (gpsStatus != null)
            {
                IIterable satellites  = gpsStatus.Satellites;
                IIterator sat         = satellites.Iterator();
                string    lSatellites = null;
                int       i           = 0;
                while (sat.HasNext)
                {
                    GpsSatellite satellite = sat.Next().JavaCast <GpsSatellite>();
                    Debug.WriteLine(satellite.Prn);
                }
            }
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.MyButton);

            locationManager = (LocationManager)GetSystemService(Context.LocationService);
            locationManager.AddGpsStatusListener(this);
            locationManager.RequestLocationUpdates(LocationManager.GpsProvider, 0, 0, this);

            GpsStatus gpsStatus = locationManager.GetGpsStatus(null);

            if (gpsStatus != null)
            {
                IIterable satellites  = gpsStatus.Satellites;
                IIterator sat         = satellites.Iterator();
                string    lSatellites = null;
                int       i           = 0;
                while (sat.HasNext)
                {
                    GpsSatellite satellite = sat.Next().JavaCast <GpsSatellite>();
                    Debug.WriteLine(satellite.Prn);
                }
            }


            button.Click += delegate
            {
                button.Text = string.Format("{0} clicks!", count++);
            };
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Move to initial position (before first element).
 /// </summary>
 public void Reset()
 {
     iterator = iterable.Iterator();
 }
Ejemplo n.º 4
0
 public IEnumerator <T> GetEnumerator()
 {
     return(new IteratorAdapter <T>(iterable.Iterator()));
 }
Ejemplo n.º 5
0
 public static IEnumerable <T> AsEnumerable <T>(this IIterable <T> iterable) where T : Java.Lang.Object
 => iterable.Iterator().ToBeEnumerable();
Ejemplo n.º 6
0
 public static IEnumerable AsEnumerable(this IIterable iterable)
 => iterable.Iterator().ToBeEnumerable();