public override void AwakeFromNib () { locationManager = new CLLocationManager(); locationManager.UpdatedLocation += HandleLocationManagerUpdatedLocation; locationManager.Failed += HandleLocationManagerFailed; locationManager.StartUpdatingLocation(); }
static void Main () { NSApplication.Init (); var locationManager = new CLLocationManager (); locationManager.UpdatedLocation += (sender, args) => { var coord = args.NewLocation.Coordinate; Console.WriteLine ("At {0}", args.NewLocation.Description ()); locationManager.StopUpdatingLocation (); Console.WriteLine (googleUrl, coord.Latitude, coord.Longitude); NSWorkspace.SharedWorkspace.OpenUrl (new Uri (String.Format (googleUrl, coord.Latitude, coord.Longitude))); }; locationManager.StartUpdatingLocation (); NSRunLoop.Current.RunUntil (NSDate.DistantFuture); }
public virtual void MonitoringFailed (CLLocationManager manager, CLRegion region, NSError error) { throw new You_Should_Not_Call_base_In_This_Method (); }
public virtual void RegionLeft (CLLocationManager manager, CLRegion region) { throw new You_Should_Not_Call_base_In_This_Method (); }
public virtual void Failed (CLLocationManager manager, NSError error) { throw new You_Should_Not_Call_base_In_This_Method (); }
public virtual bool ShouldDisplayHeadingCalibration (CLLocationManager manager) { throw new You_Should_Not_Call_base_In_This_Method (); }
public virtual void UpdatedHeading (CLLocationManager manager, CLHeading newHeading) { throw new You_Should_Not_Call_base_In_This_Method (); }
public virtual void UpdatedLocation (CLLocationManager manager, CLLocation newLocation, CLLocation oldLocation) { throw new You_Should_Not_Call_base_In_This_Method (); }
public override Void MonitoringFailed (CLLocationManager manager, CLRegion region, NSError error) { if (monitoringFailed != null) monitoringFailed (manager, new CLRegionErrorEventArgs (region, error)); }
public override Void RegionLeft (CLLocationManager manager, CLRegion region) { if (regionLeft != null) regionLeft (manager, new CLRegionEventArgs (region)); }
public override Void Failed (CLLocationManager manager, NSError error) { if (failed != null) failed (manager, new NSErrorEventArgs (error)); }
public override bool ShouldDisplayHeadingCalibration (CLLocationManager manager) { if (shouldDisplayHeadingCalibration != null) return shouldDisplayHeadingCalibration (manager); return true; }
public override Void UpdatedHeading (CLLocationManager manager, CLHeading newHeading) { if (updatedHeading != null) updatedHeading (manager, new CLHeadingUpdatedEventArgs (newHeading)); }
public override Void UpdatedLocation (CLLocationManager manager, CLLocation newLocation, CLLocation oldLocation) { if (updatedLocation != null) updatedLocation (manager, new CLLocationUpdatedEventArgs (newLocation, oldLocation)); }