CivicAddress.Unknown Field

.NET Framework (current version)

Represents a CivicAddress that contains no data.

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

public static readonly CivicAddress Unknown

Use IsUnknown to verify whether a CivicAddress contains data.

The following example uses IsUnknown to check the CivicAddress that is returned from ResolveAddress before the civic address is printed out.

static void ResolveAddressSync()
    GeoCoordinateWatcher watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
    watcher.MovementThreshold = 1.0; // set to one meter
    watcher.TryStart(false, TimeSpan.FromMilliseconds(1000));

    CivicAddressResolver resolver = new CivicAddressResolver();

    if (watcher.Position.Location.IsUnknown == false)
        CivicAddress address = resolver.ResolveAddress(watcher.Position.Location);

        if (!address.IsUnknown)
            Console.WriteLine("Country: {0}, Zip: {1}",
            Console.WriteLine("Address unknown.");

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