共用方式為


Geofence 類別

定義

包含用來定義地理柵欄的功能, (要監視) 的地理區域。

public ref class Geofence sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.Devices.Geolocation.Geofencing.IGeofenceFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class Geofence final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Devices.Geolocation.Geofencing.IGeofenceFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class Geofence final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Devices.Geolocation.Geofencing.IGeofenceFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class Geofence
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Devices.Geolocation.Geofencing.IGeofenceFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class Geofence
function Geofence(id, geoshape, monitoredStates, singleUse, dwellTime, startTime, duration)
Public NotInheritable Class Geofence
繼承
Object Platform::Object IInspectable Geofence
屬性

Windows 需求

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

建構函式

Geofence(String, IGeoshape)

根據地理柵欄的識別碼和圖形,初始化新的Geofence物件。

Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean)

根據識別碼、地理柵欄的形狀、要監視地理柵欄的狀態,以及singleUse旗標,初始化新的Geofence物件。

Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean, TimeSpan)

根據識別碼、地理柵欄的形狀、要監視地理柵欄的狀態、單一使用旗標和地理柵欄的dwellTime,初始化新的Geofence物件。

Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean, TimeSpan, DateTime, TimeSpan)

根據識別碼、地理柵欄的形狀、要監視地理柵欄的狀態、單一使用旗標、地理柵欄的dwellTime、開始監視地理柵欄的時間,以及地理柵欄的持續時間,初始化新的Geofence物件。

屬性

Duration

取得時間範圍,從 StartTime開始,在此時間範圍中 監視 Geofence

DwellTime

位置必須在 Geofence 內部或外部的時間下限,才能觸發通知。

Geoshape

地理柵欄區域的形狀。

Id

Geofence的識別碼。

MonitoredStates

指出 要監視 Geofence 的狀態。

SingleUse

指出是否應該觸發 Geofence 一次或多次。

StartTime

開始監視 地理柵欄的時間。

適用於

另請參閱