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

In This Topic
    GetCanRemoveReplicas Method
    In This Topic
    Gets whether the map contains local syncable content that can be unregistered with the feature service. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public bool GetCanRemoveReplicas( 
       Map map
    )
    Public Function GetCanRemoveReplicas( _
       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
    Remarks
    The function does not check if a local replica has been previously unregistered.
    Example
    Remove Replicas for Syncable Content
    //namespace ArcGIS.Desktop.Mapping.Offline
    var extent = MapView.Active.Extent;
    var map = MapView.Active.Map;
    
    //await if needed...
    QueuedTask.Run(() =>
    {
      //Check map has local syncable content
      //Either..
      //var canSyncContent = GenerateOfflineMap.Instance.GetCanSynchronizeReplicas(map);
      //Or...both accomplish the same thing...
      var canRemove = GenerateOfflineMap.Instance.GetCanRemoveReplicas(map);
      if (canRemove)
      {
        //Remove Replicas - any unsync'd changes are lost
        //Call sync _first_ to push any outstanding changes if
        //needed. Local syncable content is re-sourced
        //to point to the service
        GenerateOfflineMap.Instance.RemoveReplicas(map);
      }
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also