GeoPositionStatus Enumeration

.NET Framework (current version)
 

Indicates the ability of the location provider to provide location updates.

Namespace:   System.Device.Location
Assembly:  System.Device (in System.Device.dll)

Public Enumeration GeoPositionStatus

Member nameDescription
Disabled

The location provider is disabled. On Windows 7, this is the case when the Sensor and Location platform has been disabled by group policy.

Initializing

The location provider is initializing. For example, a GPS that is still obtaining a fix has this status.

NoData

No location data is available from any location provider.

Ready

A location provider is ready to supply new data.

The following example shows how to handle StatusChanged events and print out the current GeoPositionStatus.

Imports System.Device.Location
Module GetLocationEvent

    Sub ShowStatusUpdates()
        Dim Watcher As GeoCoordinateWatcher
        Watcher = New GeoCoordinateWatcher()
        watcher.Start()
        AddHandler Watcher.StatusChanged, AddressOf watcher_StatusChanged

        Console.WriteLine("Enter any key to quit.")
        Console.ReadLine()
    End Sub

    Sub watcher_StatusChanged(ByVal sender As Object, ByVal e As GeoPositionStatusChangedEventArgs)
        Select Case e.Status
            Case GeoPositionStatus.Initializing
                Console.WriteLine("Working on location fix")
            Case GeoPositionStatus.Ready
                Console.WriteLine("Have location")
            Case GeoPositionStatus.NoData
                Console.WriteLine("No data")
            Case GeoPositionStatus.Disabled
                Console.WriteLine("Disabled")
        End Select
    End Sub

    Public Sub Main()
        ShowStatusUpdates()
    End Sub
End Module

.NET Framework
Available since 4.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: