Propriedade SyncGroup.GroupName
Obtém ou define o nome do SyncGroup.
Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (em microsoft.synchronization.data.dll)
Sintaxe
'Declaração
Public Property GroupName As String
'Uso
Dim instance As SyncGroup
Dim value As String
value = instance.GroupName
instance.GroupName = value
public string GroupName { get; set; }
public:
property String^ GroupName {
String^ get ();
void set (String^ value);
}
/** @property */
public String get_GroupName ()
/** @property */
public void set_GroupName (String value)
public function get GroupName () : String
public function set GroupName (value : String)
Valor da propriedade
O nome de SyncGroup.
Exemplo
O exemplo de código a seguir é de uma classe derivada de SyncAgent. O código cria dois grupos de sincronização e três tabelas de sincronização. A tabela Customer
é adicionada ao grupo Customer
, e as tabelas OrderHeader
e OrderDetail
são adicionadas ao grupo Order
. Todas as tabelas são somente para download. Se já existir uma tabela no cliente, ela será descartada e recriada durante a sincronização inicial. Para exibir esse código no contexto de um exemplo completo, consulte Como filtrar linhas e colunas.
//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)
Consulte também
Referência
Classe SyncGroup
Membros SyncGroup
Namespace Microsoft.Synchronization.Data