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