none
How to get the full filename from DestinationChange.ItemId

    Question

  • Hi,

    When dealing with file sync conflicts, I use the SyncCallbacks.ItemConflicting event.

    I want to know the full filename of the conflict file. However, I can only get an Item ID from the EventArgs. How can I get the filename by Item ID? Thanks.

    Here is related code:

    FileSyncProvider destinationProvider = null;
    destinationProvider = new FileSyncProvider(
                    destinationReplicaRootPath, filter, options);
    SyncCallbacks destinationCallbacks = destinationProvider.DestinationCallbacks;
    destinationCallbacks.ItemConflicting += new EventHandler<ItemConflictingEventArgs>(destinationCallbacks_ItemConflicting);
    
    
    
    
    
    
    

    static void destinationCallbacks_ItemConflicting(object sender, ItemConflictingEventArgs e)
        {
            e.SetResolutionAction(ConflictResolutionAction.SourceWins);
            Console.WriteLine("-- Constraint conflict detected for item " + e.DestinationChange.ItemId.ToString());
        }

    Friday, March 29, 2013 2:38 AM

All replies

  • You can use property DestinationChangeData. There might be an issue that this property is a ComObject - in this case check your version of MS Sync - I got this problem and spent some time until found this.
    Thursday, August 15, 2013 8:44 PM