SPChangeCollection.Item property
取得變更物件在集合中指定之索引處。
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
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
Type: System.Int3232 位元的整數,指定變更物件的索引。
Property value
Type: Microsoft.SharePoint.SPChange
SPChange 物件,表示該變更。
Examples
下列範例是一個簡單的主控台應用程式會示範如何使用索引至集合。
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();
}
}
}
請參閱
參照
Microsoft.SharePoint namespace