GeoCoordinateWatcher.StatusChanged Event
.NET Framework 4.5
Indicates that the status of the GeoCoordinateWatcher object has changed.
Namespace: System.Device.Location
Assembly: System.Device (in System.Device.dll)
The StatusChanged event is raised on the same thread that the GeoCoordinateWatcher object was created on.
The following example demonstrates how to handle StatusChanged events.
using System; using System.Device.Location; namespace ShowStatusUpdates { class Program { static void Main(string[] args) { ShowStatusUpdates(); } static void ShowStatusUpdates() { GeoCoordinateWatcher watcher = new GeoCoordinateWatcher(); watcher.Start(); watcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(watcher_StatusChanged); Console.WriteLine("Enter any key to quit."); Console.ReadLine(); } static void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e) { switch (e.Status) { case GeoPositionStatus.Initializing: Console.WriteLine("Working on location fix"); break; case GeoPositionStatus.Ready: Console.WriteLine("Have location"); break; case GeoPositionStatus.NoData: Console.WriteLine("No data"); break; case GeoPositionStatus.Disabled: Console.WriteLine("Disabled"); break; } } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.