Inheritance: MonoMac.Foundation.NSObject
Exemplo n.º 1
0
		public override void AwakeFromNib ()
		{
			locationManager = new CLLocationManager();
			locationManager.UpdatedLocation += HandleLocationManagerUpdatedLocation;
			locationManager.Failed += HandleLocationManagerFailed;
			locationManager.StartUpdatingLocation();
		}
Exemplo n.º 2
0
	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);
	}
Exemplo n.º 3
0
		public virtual void MonitoringFailed (CLLocationManager manager, CLRegion region, NSError error)
		{
			throw new You_Should_Not_Call_base_In_This_Method ();
		}
Exemplo n.º 4
0
		public virtual void RegionLeft (CLLocationManager manager, CLRegion region)
		{
			throw new You_Should_Not_Call_base_In_This_Method ();
		}
Exemplo n.º 5
0
		public virtual void Failed (CLLocationManager manager, NSError error)
		{
			throw new You_Should_Not_Call_base_In_This_Method ();
		}
Exemplo n.º 6
0
		public virtual bool ShouldDisplayHeadingCalibration (CLLocationManager manager)
		{
			throw new You_Should_Not_Call_base_In_This_Method ();
		}
Exemplo n.º 7
0
		public virtual void UpdatedHeading (CLLocationManager manager, CLHeading newHeading)
		{
			throw new You_Should_Not_Call_base_In_This_Method ();
		}
Exemplo n.º 8
0
		public virtual void UpdatedLocation (CLLocationManager manager, CLLocation newLocation, CLLocation oldLocation)
		{
			throw new You_Should_Not_Call_base_In_This_Method ();
		}
Exemplo n.º 9
0
			public override Void MonitoringFailed (CLLocationManager manager, CLRegion region, NSError error)
			{
				if (monitoringFailed != null)
					monitoringFailed (manager, new CLRegionErrorEventArgs (region, error));
			}
Exemplo n.º 10
0
			public override Void RegionLeft (CLLocationManager manager, CLRegion region)
			{
				if (regionLeft != null)
					regionLeft (manager, new CLRegionEventArgs (region));
			}
Exemplo n.º 11
0
			public override Void Failed (CLLocationManager manager, NSError error)
			{
				if (failed != null)
					failed (manager, new NSErrorEventArgs (error));
			}
Exemplo n.º 12
0
			public override bool ShouldDisplayHeadingCalibration (CLLocationManager manager)
			{
				if (shouldDisplayHeadingCalibration != null)
					return shouldDisplayHeadingCalibration (manager);
				return true;
			}
Exemplo n.º 13
0
			public override Void UpdatedHeading (CLLocationManager manager, CLHeading newHeading)
			{
				if (updatedHeading != null)
					updatedHeading (manager, new CLHeadingUpdatedEventArgs (newHeading));
			}
Exemplo n.º 14
0
			public override Void UpdatedLocation (CLLocationManager manager, CLLocation newLocation, CLLocation oldLocation)
			{
				if (updatedLocation != null)
					updatedLocation (manager, new CLLocationUpdatedEventArgs (newLocation, oldLocation));
			}