SyncConfiguration.SyncTables 속성
동기화 방향과 같은 설정이 포함된 SyncTable 개체의 SyncTableCollection을 가져옵니다.
네임스페이스: Microsoft.Synchronization.Data
어셈블리: microsoft.synchronization.data.dll의 Microsoft.Synchronization.Data
구문
‘선언
Public ReadOnly Property SyncTables As SyncTableCollection
‘사용 방법
Dim instance As SyncConfiguration
Dim value As SyncTableCollection
value = instance.SyncTables
public SyncTableCollection SyncTables { get; }
public:
property SyncTableCollection^ SyncTables {
SyncTableCollection^ get ();
}
/** @property */
public SyncTableCollection get_SyncTables ()
public function get SyncTables () : SyncTableCollection
속성 값
SyncTable 개체의 SyncTableCollection입니다.
예제
다음 코드 예제는 SyncAgent에서 파생된 클래스에서 제공된 것입니다. 이 코드에서는 두 가지 동기화 그룹과 세 가지 동기화 테이블을 만듭니다. Customer
테이블은 Customer
그룹에 추가되고 OrderHeader
및 OrderDetail
테이블은 Order
그룹에 추가됩니다. 모든 테이블은 다운로드 전용입니다. 테이블이 클라이언트에 있으면 초기 동기화 중에 테이블이 삭제되고 다시 만들어집니다. 전체 예제의 맥락에서 이 코드를 보려면 방법: 행 및 열 필터링을 참조하십시오.
//Create two SyncGroups so that changes to OrderHeader
//and OrderDetail are made in one transaction. Depending on
//application requirements, you might include Customer
//in the same group.
SyncGroup customerSyncGroup = new SyncGroup("Customer");
SyncGroup orderSyncGroup = new SyncGroup("Order");
//Add each table: specify a synchronization direction of
//DownloadOnly.
SyncTable customerSyncTable = new SyncTable("Customer");
customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
customerSyncTable.SyncDirection = SyncDirection.DownloadOnly;
customerSyncTable.SyncGroup = customerSyncGroup;
this.Configuration.SyncTables.Add(customerSyncTable);
SyncTable orderHeaderSyncTable = new SyncTable("OrderHeader");
orderHeaderSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
orderHeaderSyncTable.SyncDirection = SyncDirection.DownloadOnly;
orderHeaderSyncTable.SyncGroup = orderSyncGroup;
this.Configuration.SyncTables.Add(orderHeaderSyncTable);
SyncTable orderDetailSyncTable = new SyncTable("OrderDetail");
orderDetailSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
orderDetailSyncTable.SyncDirection = SyncDirection.DownloadOnly;
orderDetailSyncTable.SyncGroup = orderSyncGroup;
this.Configuration.SyncTables.Add(orderDetailSyncTable);
'Create two SyncGroups so that changes to OrderHeader
'and OrderDetail are made in one transaction. Depending on
'application requirements, you might include Customer
'in the same group.
Dim customerSyncGroup As New SyncGroup("Customer")
Dim orderSyncGroup As New SyncGroup("Order")
'Add each table: specify a synchronization direction of
'DownloadOnly.
Dim customerSyncTable As New SyncTable("Customer")
customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable
customerSyncTable.SyncDirection = SyncDirection.DownloadOnly
customerSyncTable.SyncGroup = customerSyncGroup
Me.Configuration.SyncTables.Add(customerSyncTable)
Dim orderHeaderSyncTable As New SyncTable("OrderHeader")
orderHeaderSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable
orderHeaderSyncTable.SyncDirection = SyncDirection.DownloadOnly
orderHeaderSyncTable.SyncGroup = orderSyncGroup
Me.Configuration.SyncTables.Add(orderHeaderSyncTable)
Dim orderDetailSyncTable As New SyncTable("OrderDetail")
orderDetailSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable
orderDetailSyncTable.SyncDirection = SyncDirection.DownloadOnly
orderDetailSyncTable.SyncGroup = orderSyncGroup
Me.Configuration.SyncTables.Add(orderDetailSyncTable)
참고 항목
참조
SyncConfiguration 클래스
SyncConfiguration 멤버
Microsoft.Synchronization.Data 네임스페이스