다음을 통해 공유


FilterChange 클래스

필터에서 항목이 포함되거나 제외되도록 하는 변경 내용에 대한 정보를 나타냅니다.

네임스페이스: Microsoft.Synchronization
어셈블리: microsoft.synchronization.dll의 Microsoft.Synchronization

구문

‘선언
Public Class FilterChange
‘사용 방법
Dim instance As FilterChange
public class FilterChange
public ref class FilterChange
public class FilterChange
public class FilterChange

주의

변경 내용으로 인해 필터에서 항목이 포함되거나 제외될 수 있습니다. 예를 들어 state 필드를 포함하는 항목이 있고, state 필드가 "Washington"인 항목을 제외하는 필터를 가정해 봅니다. state가 "Oregon"이 되도록 state가 "Washington"인 항목을 변경하면 해당 항목은 필터에 포함됩니다.

이 개체의 속성은 다음 표에 따라 해석할 수 있습니다.

IsMoveIn의 값

MoveVersion의 값

의미

true

항목의 생성 버전입니다.

항목이 만들어진 이후 필터에 있습니다.

true

항목의 생성 버전이 아닌 버전입니다.

버전이 MoveVersion인 변경을 수행한 경우 필터에 포함한 항목입니다.

false

0으로 설정됩니다.

필터 추적이 시작된 이후 항목이 필터에 없습니다.

false

0이 아닌 버전입니다.

버전이 MoveVersion인 변경을 수행한 경우 필터에서 제외한 항목입니다.

예제

다음 예제에서는 필터와 관련된 항목의 이동 버전이 대상 정보에 포함되어 있지 않을 경우 필터 변경 정보를 ItemChange 개체에 추가합니다.

Public Sub AddFilterChanges(ByVal filterKeyMap As FilterKeyMap, ByVal itemMeta As ItemMetadata, ByVal destKnowledge As SyncKnowledge, ByVal itemChange As ItemChange)
    For filterKey As Integer = 0 To filterKeyMap.Count - 1
        ' Find the filter in the list of all filters tracked by this replica.
        Dim iFilter As Integer = 0
        While iFilter < _trackedFilters.Count
            If filterKeyMap(filterKey).IsIdentical(_trackedFilters(iFilter)) Then
                Exit While
            End If
            iFilter += 1
        End While

        ' Get the filter information for the item and add it to the ItemChange object.
        Dim moveVersion As SyncVersion = GetMoveVersion(itemMeta, iFilter)

        ' Only return a filter change if the destination knowledge does not contain the version of the 
        ' last move that occurred in relation to the specified filter.
        Dim filterChange As FilterChange = Nothing
        If Not destKnowledge.Contains(ContactReplicaMetadata.ReplicaId, itemMeta.GlobalId, moveVersion) Then
            filterChange = New FilterChange(GetIsInFilter(itemMeta, iFilter), moveVersion)
            itemChange.AddFilterChange(CUInt(filterKey), filterChange)
        End If
    Next
End Sub
public void AddFilterChanges(FilterKeyMap filterKeyMap, ItemMetadata itemMeta, SyncKnowledge destKnowledge,
    ItemChange itemChange)
{
    for (int filterKey = 0; filterKey < filterKeyMap.Count; filterKey++)
    {
        // Find the filter in the list of all filters tracked by this replica.
        int iFilter = 0;
        for (; iFilter < _trackedFilters.Count; iFilter++)
        {
            if (filterKeyMap[filterKey].IsIdentical(_trackedFilters[iFilter]))
            {
                break;
            }
        }

        // Get the filter information for the item and add it to the ItemChange object.
        SyncVersion moveVersion = GetMoveVersion(itemMeta, iFilter);

        // Only return a filter change if the destination knowledge does not contain the version of the 
        // last move that occurred in relation to the specified filter.
        FilterChange filterChange = null;
        if (!destKnowledge.Contains(ContactReplicaMetadata.ReplicaId, itemMeta.GlobalId, moveVersion))
        {
            filterChange = new FilterChange(GetIsInFilter(itemMeta, iFilter), moveVersion);
            itemChange.AddFilterChange((uint)filterKey, filterChange);
        }
    }
}

상속 계층 구조

System.Object
  Microsoft.Synchronization.FilterChange

스레드로부터의 안전성

이 유형의 모든 public static(Visual Basic의 경우 Shared ) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.

참고 항목

참조

FilterChange 멤버
Microsoft.Synchronization 네임스페이스