ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping.Offline Namespace / GenerateOfflineMap Class / GetCanSynchronizeReplicas Method
The map to check for syncable content
Example

In This Topic
    GetCanSynchronizeReplicas Method
    In This Topic
    Gets whether the map contains local syncable content that can be sync'd with its feature service. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public bool GetCanSynchronizeReplicas( 
       Map map
    )
    Public Function GetCanSynchronizeReplicas( _
       ByVal map As Map _
    ) As Boolean

    Parameters

    map
    The map to check for syncable content

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Map cannot be null
    Example
    Check Map Has Local 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)
      {
        //TODO - use status
      }
    });
    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