ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping.Offline Namespace / GenerateOfflineMap Class / SynchronizeReplicas Method
The map whose content will be sync'd
Example

In This Topic
    SynchronizeReplicas Method
    In This Topic
    Performs a bi-directional sync between all replica content in the map. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void SynchronizeReplicas( 
       Map map
    )
    Public Sub SynchronizeReplicas( _
       ByVal map As Map _
    ) 

    Parameters

    map
    The map whose content will be sync'd
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Map cannot be null
    Map has no syncable content
    Remarks
    Calling SynchronizeReplicas on a map with no syncable content will throw a System.InvalidOperationException.
    Unsaved edits will not be sync'd. Unsaved edits should be saved or discarded before calling SynchronizeReplicas. Sync'd edits returned from the service by SynchronizeReplicas are not undo-able.
    Example
    Synchronize Replicas for Syncable Content
    //namespace ArcGIS.Desktop.Mapping.Offline
    var map = MapView.Active.Map;
    
    //await if needed...
    QueuedTask.Run(() =>
    {
      //Check map has local syncable content
      var canSyncContent = GenerateOfflineMap.Instance.GetCanSynchronizeReplicas(map);
      if (canSyncContent)
      {
        //Sync Replicas - changes since last sync are pushed to the
        //parent replica. Parent changes are pulled to the client.
        //Unsaved edits are _not_ sync'd. 
        GenerateOfflineMap.Instance.SynchronizeReplicas(map);
      }
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also