The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
CivicAddressResolver.ResolveAddressCompleted Event
Visual Studio 2010
Occurs when the address resolution that was initiated by a call to ResolveAddressAsync completes.
Assembly: System.Device (in System.Device.dll)
The following program shows how to call ResolveAddressAsync to resolve a civic address asynchronously.
using System; using System.Device.Location; namespace ResolveAddressSync { class Program { public static void Main(string[] args) { ResolveAddressAsync(); } static void ResolveAddressAsync() { GeoCoordinateWatcher watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); bool started = false; watcher.MovementThreshold = 1.0; // set to one meter started = watcher.TryStart(false, TimeSpan.FromMilliseconds(1000)); if (started) { CivicAddressResolver resolver = new CivicAddressResolver(); resolver.ResolveAddressCompleted += new EventHandler<ResolveAddressCompletedEventArgs>(resolver_ResolveAddressCompleted); if (watcher.Position.Location.IsUnknown == false) { resolver.ResolveAddressAsync(watcher.Position.Location); } } } static void resolver_ResolveAddressCompleted(object sender, ResolveAddressCompletedEventArgs e) { if (!e.Address.IsUnknown) { Console.WriteLine("Country: {0}, Zip: {1}", e.Address.CountryRegion, e.Address.PostalCode); } else { Console.WriteLine("Unknown address."); } } } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Community Additions
Show: