GeofenceMonitor 類別

定義

包含受監視 之 Geofence 物件的相關資訊。

public ref class GeofenceMonitor sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class GeofenceMonitor final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class GeofenceMonitor
Public NotInheritable Class GeofenceMonitor
繼承
Object Platform::Object IInspectable GeofenceMonitor
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)
應用程式功能
location

備註

使用靜態 Current 屬性取得 GeofenceMonitor 物件,其中包含應用程式的所有地理柵欄資訊。

如果 Location Framework Service 事件狀態與 GeofenceMonitor 同步處理,您將會收到 IDS_GEOFENCEMONITOR_OUT_OF_SYNC 例外狀況。 您可以藉由移除 GeofenceMonitor 上的所有事件處理常式或重新開機應用程式,嘗試復原。 移除所有事件處理常式之後,您可以重新新增任何事件處理常式,然後重試作業。

屬性

Current

取得 GeofenceMonitor 物件,其中包含應用程式的所有 Geofence 資訊。

Geofences

傳回目前向全系統 地理柵欄 Monitor 註冊之應用程式的 Geofence物件的向量。

LastKnownGeoposition

裝置位置的最後一次讀取。

Status

指出 GeofenceMonitor的目前狀態。

方法

ReadReports()

取得GeofenceMonitor 之 Geofences集合中Geofence物件的狀態變更集合。

事件

GeofenceStateChanged

GeofenceMonitorGeofences集合中一或多個Geofence物件的狀態已變更時引發

StatusChanged

當 GeofenceMonitor的狀態變更時引發。

適用於

另請參閱