Add Method
Collapse the table of content
Expand the table of content

ScheduledActionService.Add Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Registers a scheduled action with the operating system.

Namespace:  Microsoft.Phone.Scheduler
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

'Declaration
Public Shared Sub Add ( _
	action As ScheduledAction _
)

Parameters

action
Type: Microsoft.Phone.Scheduler.ScheduledAction
The ScheduledAction to be registered.

ExceptionCondition
InvalidOperationException

A scheduled action with the same Name property is already registered with the system.

The user has disabled background agents in the Background Tasks settings page.

The maximum number of agents of the agent type being added has been exceeded.

SchedulerServiceException

The Scheduled Action Service has encountered an internal error. The Scheduled Action Service is not ready, such as within one minute after device boot.

Scheduled actions are uniquely identified per application by the Name property. Attempting to add a notification with the same name as one that has already been registered will throw an exception.

The IsEnabled property is updated as soon as the action is registered with the service, letting you know if the user has disabled scheduled actions for your application.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft