Share via


SPFileVersionCollection Class

Represents a collection of SPFileVersion objects.

Inheritance Hierarchy

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

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

Syntax

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

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

Remarks

Use the Versions property of the SPFile class to return the collection of versions for a file.

Use an indexer to return a single version from the collection. For example, assuming the collection is assigned to a variable named myVersions, use myVersions[index] in C#, or myVersions(index) in Microsoft Visual Basic, where index is the index number of the version in the collection.

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

SPFileVersionCollection Members

Microsoft.SharePoint Namespace