파생 클래스에서 재정의되면 항목 저장소에서 검색해야 할 변경 내용 데이터에 대한 변경 항목을 가져옵니다.
네임스페이스: Microsoft.Synchronization
어셈블리: microsoft.synchronization.dll의 Microsoft.Synchronization
구문
‘선언
Public MustOverride ReadOnly Property ItemChange As ItemChange
‘사용 방법
Dim instance As LoadChangeContext
Dim value As ItemChange
value = instance.ItemChange
public abstract ItemChange ItemChange { get; }
public:
virtual property ItemChange^ ItemChange {
ItemChange^ get () abstract;
}
/** @property */
public abstract ItemChange get_ItemChange ()
public abstract function get ItemChange () : ItemChange
속성 값
항목 저장소에서 검색해야 할 변경 내용 데이터에 대한 변경 항목입니다.
예제
다음 예제에서는 지정된 변경 단위 집합에 대한 데이터를 검색하기 위해 LoadChangeData 메서드를 구현하는 방법을 보여 줍니다. 이 예에서는 스파스하게 채워지는 문자열 배열로 데이터를 반환합니다.
Public Function LoadChangeData(ByVal loadChangeContext As LoadChangeContext) As Object Implements IChangeDataRetriever.LoadChangeData
' Sanity check to ensure the data array is not overrun.
If Contact.ChangeUnitFieldCount < loadChangeContext.ItemChange.ChangeUnitChanges.Count Then
Throw New ArgumentOutOfRangeException("LoadChangeData received too many change unit changes.")
End If
' Get the ID of the item to return.
Dim itemId As SyncId = loadChangeContext.ItemChange.ItemId
' Create a string array to hold the data for each change unit. Some of the elements of this array
' may be empty.
Dim contactData As String() = New String(Contact.ChangeUnitFieldCount - 1) {}
' Enumerate the change units to retrieve.
For iChange As Integer = 0 To loadChangeContext.ItemChange.ChangeUnitChanges.Count - 1
' Retrieve data for the specified change unit and put the data into the appropriate
' place in the string array.
Dim icu As Integer = loadChangeContext.ItemChange.ChangeUnitChanges(iChange).ChangeUnitId.GetByteId()
contactData(icu) = _ContactStore.GetContactData(itemId, loadChangeContext.ItemChange.ChangeUnitChanges(iChange).ChangeUnitId)
Next
Return contactData
End Function
public object LoadChangeData(LoadChangeContext loadChangeContext)
{
// Sanity check to ensure the data array is not overrun.
if (Contact.ChangeUnitFieldCount < loadChangeContext.ItemChange.ChangeUnitChanges.Count)
{
throw new ArgumentOutOfRangeException("LoadChangeData received too many change unit changes.");
}
// Get the ID of the item to return.
SyncId itemId = loadChangeContext.ItemChange.ItemId;
// Create a string array to hold the data for each change unit. Some of the elements of this array
// may be empty.
string[] contactData = new string[Contact.ChangeUnitFieldCount];
// Enumerate the change units to retrieve.
for (int iChange = 0; iChange < loadChangeContext.ItemChange.ChangeUnitChanges.Count; iChange++)
{
// Retrieve data for the specified change unit and put the data into the appropriate
// place in the string array.
int icu = loadChangeContext.ItemChange.ChangeUnitChanges[iChange].ChangeUnitId.GetByteId();
contactData[icu] = _ContactStore.GetContactData(itemId,
loadChangeContext.ItemChange.ChangeUnitChanges[iChange].ChangeUnitId);
}
return contactData;
}
참고 항목
참조
LoadChangeContext 클래스
LoadChangeContext 멤버
Microsoft.Synchronization 네임스페이스