Partager via


SPAuditEntryCollection Class

Provides a container for SPAuditEntry objects.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.SPBaseCollection
      Microsoft.SharePoint.SPAuditEntryCollection

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPAuditEntryCollection _
    Inherits SPBaseCollection

Dim instance As SPAuditEntryCollection
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPAuditEntryCollection : SPBaseCollection

Remarks

This class is primarily used as the return value for GetEntries.

Examples

The following example (from Item-Level Auditing with SharePoint Server 2007) shows this class in use.

SPAuditQuery wssQuery = new SPAuditQuery(siteCollection);
wssQuery.RestrictToListItem(item);
SPAuditEntryCollection auditCol = site.Audit.GetEntries(wssQuery);

foreach (SPAuditEntry entry in auditCol) {
  // get info from audit log
}

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

SPAuditEntryCollection Members

Microsoft.SharePoint Namespace