SPChangeCollection.Item 属性

获取集合中指定索引处的变更对象。

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public ReadOnly Default Property Item ( _
    iIndex As Integer _
) As SPChange
    Get
用法
Dim instance As SPChangeCollection
Dim iIndex As Integer
Dim value As SPChange

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

参数

  • iIndex
    类型:System.Int32

    32 位整数,指定更改对象的索引。

属性值

类型:Microsoft.SharePoint.SPChange
一个表示所做的更改的SPChange对象。

示例

下面的示例是一个简单的控制台应用程序演示如何使用集合中的索引。

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();
      }
   }
}

另请参阅

引用

SPChangeCollection 类

SPChangeCollection 成员

Microsoft.SharePoint 命名空间

其他资源

Using the Change Log