Partilhar via


Alert Object Model

Applies to: SharePoint Foundation 2010

Use the Alerts property of either the SPUser or SPWeb class to return a SPAlertCollection object that represents the collection of alerts for the user or Web site. Use an indexer to return a single alert from the collection.

Note

Call the Update() method after making any changes to the alert.

Alerts Object Model

The following table briefly describes the alert classes, structures, and enumerations. Code examples are located in the appropriate reference topics.

Class, Structure, or Enumeration

Description

SPAlert

Represents an alert. Provides information about the alert, such as which alert template is used, the alert frequency, and the ID of the user who created the alert.

SPAlertCollection

A collection of SPAlert objects. Iterate through alerts for a Web site or user. Use the Add and Delete methods to programmatically add or delete alerts.

SPAlertTemplate

Information about an alert template.

SPAlertTemplateCollection

A collection of alert templates.

SPAlertFrequency

An enumeration that specifies the time interval for sending an alert.

SPAlertEventData

A structure that provides information about an alert event.

SPAlertHandlerParams

A structure that contains a lightweight SPAlert object.

SPAlertStatus

An enumeration that specifies the status of an alert: Error, On, or Off.

SPAlertType

An enumeration that specifies the type of an alert: custom, item, or list.

SPAlertDeliveryChannels

An enumeration that specifies the means of delivery: e-mail or SMS message.

See Also

Concepts

Alerts in SharePoint Foundation