Partilhar via


SPEventPropertiesBase Class

Abstract base class that provides the event properties that are common to all event types. This class is never instantiated.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.SPEventPropertiesBase
    Microsoft.SharePoint.SPItemEventProperties
    Microsoft.SharePoint.SPListEventProperties
    Microsoft.SharePoint.SPWebEventProperties
    Microsoft.SharePoint.Workflow.SPWorkflowEventProperties

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<SerializableAttribute> _
<SubsetCallableTypeAttribute> _
Public MustInherit Class SPEventPropertiesBase
'Usage
Dim instance As SPEventPropertiesBase
[SerializableAttribute]
[SubsetCallableTypeAttribute]
public abstract class SPEventPropertiesBase

Remarks

The SPEventPropertiesBase class is not instantiated but provides methods for classes deriving from it that are listed in the Inheritance Hierarchy section below.

Examples

The following example of an event handler method overrides the ItemDeleting() method and uses inherited properties of the SPEventPropertiesBase class to cancel an event and display an error message.

public override void ItemDeleting(SPItemEventProperties properties)
{
    properties.Status = SPEventReceiverStatus.CancelWithError;
    properties.ErrorMessage = "Deleting items is not supported.";
}
Public Overrides Sub ItemDeleting(ByVal properties As SPItemEventProperties)
    properties.Status = SPEventReceiverStatus.CancelWithError
    properties.ErrorMessage = "Deleting items is not supported."
End Sub

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPEventPropertiesBase Members

Microsoft.SharePoint Namespace