CustomSystemEventTrigger 類別

定義

這個類別可讓您指定自訂系統觸發程式,以便註冊並回應系統觸發時。

public ref class CustomSystemEventTrigger sealed : IBackgroundTrigger
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Background.ICustomSystemEventTriggerFactory, 393216, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 393216)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class CustomSystemEventTrigger final : IBackgroundTrigger
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Background.ICustomSystemEventTriggerFactory), 393216, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 393216)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public sealed class CustomSystemEventTrigger : IBackgroundTrigger
function CustomSystemEventTrigger(triggerId, recurrence)
Public NotInheritable Class CustomSystemEventTrigger
Implements IBackgroundTrigger
繼承
Object Platform::Object IInspectable CustomSystemEventTrigger
屬性
實作

Windows 需求

裝置系列
Windows 10, version 1803 (已於 10.0.17134.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v6.0 引進)

備註

當 OS 未提供您需要的系統觸發程式時,請使用這個類別來定義觸發程式。 例如,當硬體驅動程式和 UWP 應用程式都屬於第三方,而且硬體驅動程式必須引發其應用程式處理的自訂事件時。 例如,需要通知使用者關於何時插入音訊插孔時的音訊卡。

建構函式

CustomSystemEventTrigger(String, CustomSystemEventTriggerRecurrence)

使用指定的識別碼和週期,建立 CustomSystemEventTrigger的實例。

屬性

Recurrence

取得這個自訂系統事件觸發程式可以啟動的時機。

TriggerId

可唯一識別此觸發程式需要啟動之背景工作的觸發程式識別碼。

適用於