SPAuditQuery Constructor
Initializes a new instance of the SPAuditQuery class.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Sub New ( _
site As SPSite _
)
'Usage
Dim site As SPSite
Dim instance As New SPAuditQuery(site)
public SPAuditQuery(
SPSite site
)
Parameters
site
Type: Microsoft.SharePoint.SPSiteAn SPSite object that identifies the outermost scope of the query.
Examples
The following example (from Item-Level Auditing with SharePoint Server 2007) shows this constructor 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
}
Dim wssQuery As New SPAuditQuery(siteCollection)
wssQuery.RestrictToListItem(item)
Dim auditCol As SPAuditEntryCollection = site.Audit.GetEntries(wssQuery)
For Each entry As SPAuditEntry In auditCol
' get info from audit log
Next entry