SPFileVersion Class

Represents a version of an SPFile object.

When a file becomes a version, its properties are maintained with the version. This includes the check-in comment and other information for the file.

Use the Versions property of the SPFile class to return an SPFileVersionCollection object that represents the collection of versions for a file. Use an indexer to return a single version from the collection. For example, if the collection is assigned to a variable named collVersions, use collVersions[index] in C#, or collVersions(index) in Visual Basic, where index is the index number of the version in the collection. Otherwise, use the GetVersionFromID method to return a single version from the collection.

If file versioning is enabled for a document library, calling the CheckIn method of the SPFile class after using the CheckOut method creates a version of the file. In the same way, calling the SaveBinary method of the SPFile class also creates a version.

SPFile.Version à returns a SPFileVersionCollection, use indexer to return a single version

When is new version is created –

  1. Calling Check-In After calling Check-Out
  2. Calling SPFile.SaveBinary
Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: