SPChangeCollection.Item property

Gets the change object at the specified index in the collection.

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

Syntax

'Declaration
Public ReadOnly Default Property Item ( _
    iIndex As Integer _
) As SPChange
    Get
'Usage
Dim instance As SPChangeCollection
Dim iIndex As Integer
Dim value As SPChange

value = instance(iIndex)
public SPChange this[
    int iIndex
] { get; }

Parameters

  • iIndex
    Type: System.Int32

    A 32-bit integer that specifies the index of the change object.

Property value

Type: Microsoft.SharePoint.SPChange
An SPChange object that represents the change.

Examples

The following example is a simple console application the demonstrates how to use an index into the collection.

Imports System
Imports Microsoft.SharePoint

Module ConsoleApp
   Sub Main()
      Using siteCollection As SPSite = New SPSite("https://localhost")

         Dim changes As SPChangeCollection = siteCollection.GetChanges()
         Console.WriteLine("{0}", _
            changes(changes.Count - 1).ChangeToken = changes.LastChangeToken)

      End Using
      Console.Write(vbCrLf + "Press ENTER to continue...")
      Console.ReadLine()
   End Sub

End Module
using System;
using Microsoft.SharePoint;

namespace Test
{
   class ConsoleApp
   {
      static void Main(string[] args)
      {
         using (SPSite siteCollection = new SPSite("https://localhost"))
         {
            SPChangeCollection changes = siteCollection.GetChanges();
            Console.WriteLine("{0}", 
               changes[changes.Count - 1].ChangeToken == changes.LastChangeToken);
         }
         Console.Write("\nPress ENTER to continue...");
         Console.ReadLine();
      }
   }
}

See also

Reference

SPChangeCollection class

SPChangeCollection members

Microsoft.SharePoint namespace

Other resources

Using the Change Log