Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Obtiene o establece un objeto derivado de ClientSyncProvider que se utiliza para comunicar con el almacén local de datos.
Espacio de nombres: Microsoft.Synchronization
Ensamblado: Microsoft.Synchronization.Data (en microsoft.synchronization.data.dll)
Sintaxis
'Declaración
Public Property LocalProvider As SyncProvider
'Uso
Dim instance As SyncAgent
Dim value As SyncProvider
value = instance.LocalProvider
instance.LocalProvider = value
public SyncProvider LocalProvider { get; set; }
public:
property SyncProvider^ LocalProvider {
SyncProvider^ get ();
void set (SyncProvider^ value);
}
/** @property */
public SyncProvider get_LocalProvider ()
/** @property */
public void set_LocalProvider (SyncProvider value)
public function get LocalProvider () : SyncProvider
public function set LocalProvider (value : SyncProvider)
Valor de la propiedad
Objeto derivado de ClientSyncProvider.
Ejemplo
El ejemplo de código siguiente crea una clase derivada de SyncAgent. La clase crea una instancia de un proveedor de sincronización de cliente y un proveedor de sincronización de servidor, crea un grupo de sincronización y agrega la tabla Customer. Al agregar la tabla, se especifican también la dirección de sincronización y una opción de creación de tablas. Para consultar este código en el contexto de un ejemplo completo, vea Intercambiar cambios de datos incrementales bidireccionales entre un cliente y un servidor.
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
Vea también
Referencia
SyncAgent Clase
SyncAgent Miembros
Microsoft.Synchronization Espacio de nombres