BackgroundTaskBuilder Classe

Definizione

Rappresenta un'attività in background da registrare nel sistema.

public ref class BackgroundTaskBuilder sealed
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.ApplicationModel.Background.BackgroundTaskContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.ApplicationModel.Background.BackgroundTaskContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BackgroundTaskBuilder final
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.ApplicationModel.Background.BackgroundTaskContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.ApplicationModel.Background.BackgroundTaskContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class BackgroundTaskBuilder
function BackgroundTaskBuilder()
Public NotInheritable Class BackgroundTaskBuilder
Ereditarietà
Object Platform::Object IInspectable BackgroundTaskBuilder
Attributi

Commenti

Per informazioni sulla migrazione di app UWP con attività in background a WinUI 3, vedi la guida alla strategia di migrazione delle attività in background SDK per app di Windows.

Questa classe non è agile, il che significa che è necessario considerare il modello di threading e il comportamento di marshaling. Per altre info, vedi Oggetti Agile in C++/WinRT, Threading e Marshalling (C++/CX) e Uso di oggetti Windows Runtime in un ambiente multithreading (.NET).

Note

Internamente, BackgroundTaskBuilder usa ApplicationData.LocalSettings per archiviare le informazioni di registrazione delle attività in background, quindi la pulizia del contenitore LocalSettings può influire sulla funzione delle attività in background registrate in precedenza. Per altre informazioni sulle impostazioni locali, vedere Archiviare e recuperare le impostazioni e altri dati dell'app.

Costruttori

Nome Descrizione
BackgroundTaskBuilder()

Creare un nuovo oggetto BackgroundTaskBuilder .

Proprietà

Nome Descrizione
Name

Ottiene o imposta il nome di un'attività in background.

TaskGroup

Ottiene e imposta l'identificatore del gruppo in modo che una registrazione dell'attività in background possa essere gestita separatamente.

Metodi

Nome Descrizione
AddCondition(IBackgroundCondition)

Aggiunge una condizione a un'attività in background.

Register()

Registra un'attività in background con il sistema.

Register(String)

Registra un'attività in background con il sistema.

SetTaskEntryPointClsid(Guid)

Assegna un punto di ingresso CLSID COM per l'attività in background usando un oggetto BackgroundTaskBuilder esistente.

SetTrigger(IBackgroundTrigger)

Imposta il trigger di evento per un'attività in background.

Si applica a

Vedi anche