다음을 통해 공유


SyncAgent.Configuration 속성

테이블 및 동기화 매개 변수에 대한 정보가 포함된 SyncConfiguration 개체를 가져옵니다.

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

구문

‘선언
Public ReadOnly Property Configuration As SyncConfiguration
‘사용 방법
Dim instance As SyncAgent
Dim value As SyncConfiguration

value = instance.Configuration
public SyncConfiguration Configuration { get; }
public:
property SyncConfiguration^ Configuration {
    SyncConfiguration^ get ();
}
/** @property */
public SyncConfiguration get_Configuration ()
public function get Configuration () : SyncConfiguration

속성 값

테이블 및 동기화 매개 변수에 대한 정보가 포함된 SyncConfiguration 개체입니다.

예제

다음 코드 예제에서는 SyncAgent에서 파생되는 클래스를 만듭니다. 이 클래스는 클라이언트 동기화 공급자와 서버 동기화 공급자를 인스턴스화하고 동기화 그룹을 만들며 Customer 테이블을 추가합니다. 테이블을 추가할 때 동기화 방향과 테이블 생성 옵션도 지정됩니다. 전체 예제의 맥락에서 이 코드를 보려면 방법: 클라이언트와 서버 간에 양방향 증분 데이터 변경 내용 교환을 참조하십시오.

public class SampleSyncAgent : SyncAgent
{
    public SampleSyncAgent()
    {            
        //Instantiate a client synchronization provider and specify it
        //as the local provider for this synchronization agent.
        this.LocalProvider = new SampleClientSyncProvider();

        //Instantiate a server synchronization provider and specify it
        //as the remote provider for this synchronization agent.
        this.RemoteProvider = new SampleServerSyncProvider();

        //Create a Customer SyncGroup. This is not required
        //for the single table we are synchronizing; it is typically
        //used so that changes to multiple related tables are 
        //synchronized at the same time.
        SyncGroup customerSyncGroup = new SyncGroup("Customer");

        //Add the Customer table: specify a synchronization direction of
        //Bidirectional, and that an existing table should be dropped.
        SyncTable customerSyncTable = new SyncTable("Customer");
        customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
        customerSyncTable.SyncDirection = SyncDirection.Bidirectional;
        customerSyncTable.SyncGroup = customerSyncGroup;
        this.Configuration.SyncTables.Add(customerSyncTable);
    }
}
Public Class SampleSyncAgent
    Inherits SyncAgent

    Public Sub New()
        'Instantiate a client synchronization provider and specify it
        'as the local provider for this synchronization agent.
        Me.LocalProvider = New SampleClientSyncProvider()

        'Instantiate a server synchronization provider and specify it
        'as the remote provider for this synchronization agent.
        Me.RemoteProvider = New SampleServerSyncProvider()

        'Create a Customer SyncGroup. This is not required
        'for the single table we are synchronizing; it is typically
        'used so that changes to multiple related tables are 
        'synchronized at the same time.
        Dim customerSyncGroup As New SyncGroup("Customer")

        'Add the Customer table: specify a synchronization direction of
        'Bidirectional, and that an existing table should be dropped.
        Dim customerSyncTable As New SyncTable("Customer")
        customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable
        customerSyncTable.SyncDirection = SyncDirection.Bidirectional
        customerSyncTable.SyncGroup = customerSyncGroup
        Me.Configuration.SyncTables.Add(customerSyncTable)

    End Sub 'New
End Class 'SampleSyncAgent

참고 항목

참조

SyncAgent 클래스
SyncAgent 멤버
Microsoft.Synchronization 네임스페이스