Share via


SPChangeCollection.Item Property

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

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

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

value = instance.Item(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