Partager via


SyncDirection propriété

Obtient ou définit la valeur d'énumération SyncDirection qui représente la direction de la synchronisation du point de vue du client.

Espace de noms :  Microsoft.Synchronization.Data
Assembly :  Microsoft.Synchronization.Data (dans Microsoft.Synchronization.Data.dll)

Syntaxe

'Déclaration
Public Property SyncDirection As SyncDirection
    Get
    Set
'Utilisation
Dim instance As SyncTable
Dim value As SyncDirection

value = instance.SyncDirection

instance.SyncDirection = value
public SyncDirection SyncDirection { get; set; }
public:
property SyncDirection SyncDirection {
    SyncDirection get ();
    void set (SyncDirection value);
}
member SyncDirection : SyncDirection with get, set
function get SyncDirection () : SyncDirection
function set SyncDirection (value : SyncDirection)

Valeur de la propriété

Type : Microsoft.Synchronization.Data. . :: . .SyncDirection
Valeur d'énumération SyncDirection qui représente la direction de la synchronisation du point de vue du client.

Notes

La direction de la synchronisation détermine le mode d'échange des modifications entre les bases de données client et serveur lors de la synchronisation. Pour plus d'informations, consultez Procédure : spécifier la synchronisation par instantané, par téléchargement, par téléchargement ascendant et bidirectionnelle.

Exemples

L'exemple de code suivant provient d'une classe qui dérive de SyncAgent. Le code crée deux groupes de synchronisation et trois tables de synchronisation. La table Customer est ajoutée au groupe Customer, et les tables OrderHeader et OrderDetail sont ajoutées au groupe Order. Toutes les tables sont téléchargeables uniquement. Si une table existe au niveau du client, elle est supprimée, puis créée à nouveau lors de la synchronisation initiale. Pour afficher ce code dans le contexte d'un exemple complet, consultez Procédure : filtrer des lignes et des colonnes.

//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)

Voir aussi

Référence

SyncTable Classe

Membres SyncTable

Espace de noms Microsoft.Synchronization.Data