|
Dieser Artikel wurde maschinell übersetzt. Bewegen Sie den Mauszeiger über die Sätze im Artikel, um den Originaltext anzuzeigen. Weitere Informationen
|
Übersetzung
Original
|
GeoCoordinateWatcher-Klasse
Namespace: System.Device.Location
Assembly: System.Device (in System.Device.dll)
Der GeoCoordinateWatcher-Typ macht die folgenden Member verfügbar.
| Name | Beschreibung | |
|---|---|---|
![]() | GeoCoordinateWatcher() | |
![]() | GeoCoordinateWatcher(GeoPositionAccuracy) |
| Name | Beschreibung | |
|---|---|---|
![]() | DesiredAccuracy | |
![]() | MovementThreshold | |
![]() | Permission | |
![]() | Position | |
![]() | Status |
| Name | Beschreibung | |
|---|---|---|
![]() | Dispose() | |
![]() | Dispose(Boolean) | |
![]() | Equals(Object) | |
![]() | Finalize | |
![]() | GetHashCode | |
![]() | GetType | |
![]() | MemberwiseClone | |
![]() | OnPositionChanged | |
![]() | OnPositionStatusChanged | |
![]() | OnPropertyChanged | |
![]() | Start() | |
![]() | Start(Boolean) | |
![]() | Stop | |
![]() | ToString | |
![]() | TryStart |
| Name | Beschreibung | |
|---|---|---|
![]() | PositionChanged | |
![]() | StatusChanged |
| Name | Beschreibung | |
|---|---|---|
![]() ![]() | IGeoPositionWatcher<GeoCoordinate>.PositionChanged | |
![]() ![]() | IGeoPositionWatcher<GeoCoordinate>.StatusChanged | |
![]() ![]() | INotifyPropertyChanged.PropertyChanged |
Hinweis |
|---|
using System; using System.Device.Location; namespace GetLocationProperty { class Program { static void Main(string[] args) { GetLocationProperty(); } static void GetLocationProperty() { GeoCoordinateWatcher watcher = new GeoCoordinateWatcher(); // Do not suppress prompt, and wait 1000 milliseconds to start. watcher.TryStart(false, TimeSpan.FromMilliseconds(1000)); GeoCoordinate coord = watcher.Position.Location; if (coord.IsUnknown != true) { Console.WriteLine("Lat: {0}, Long: {1}", coord.Latitude, coord.Longitude); } else { Console.WriteLine("Unknown latitude and longitude."); } } } }
using System; using System.Device.Location; namespace GetLocationEvent { class Program { static void Main(string[] args) { CLocation myLocation = new CLocation(); myLocation.GetLocationEvent(); Console.WriteLine("Enter any key to quit."); Console.ReadLine(); } class CLocation { GeoCoordinateWatcher watcher; public void GetLocationEvent() { this.watcher = new GeoCoordinateWatcher(); this.watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(watcher_PositionChanged); bool started = this.watcher.TryStart(false, TimeSpan.FromMilliseconds(2000)); if (!started) { Console.WriteLine("GeoCoordinateWatcher timed out on start."); } } void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e) { PrintPosition(e.Position.Location.Latitude, e.Position.Location.Longitude); } void PrintPosition(double Latitude, double Longitude) { Console.WriteLine("Latitude: {0}, Longitude {1}", Latitude, Longitude); } } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core-Rolle wird nicht unterstützt), Windows Server 2008 R2 (Server Core-Rolle wird mit SP1 oder höher unterstützt; Itanium wird nicht unterstützt)
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.

