I am attempting to write a simple sync tool service using the microsoft sync framework. I am able to synchronize two locations but I would like to be able to output the files that are being synced using log4net. Does anyone know how I can do this? here is the code I using:
Try
Using _sourceProvider As FileSyncProvider = New FileSyncProvider(_sourceId.GetGuidId, _sourceDir)
Using _destinationProvider As FileSyncProvider = New FileSyncProvider(_destId.GetGuidId, _destDir)
Dim _syncAgent As SyncOrchestrator = New SyncOrchestrator()
_syncAgent.LocalProvider = _sourceProvider
_syncAgent.RemoteProvider = _destinationProvider
_syncAgent.Direction = SyncDirectionOrder.Upload
_syncAgent.Synchronize()
End Using
End Using
Catch ex As Exception
Logger.WriteLog(ElogLevel.INFO, "" & ex.Message & "")
End Try
Thanks in advance.
Thanks for the help, I've implemented the ApplyChange event Handler, but I get the following error when I use the EventHandler code:
_sourceProvider.ApplyingChange += New EventHandler(Of ApplyingChangeEventArgs)(fileSyncProvider_ApplyingChange)
_destinationProvider.ApplyingChange += New EventHandler(Of ApplyingChangeEventArgs)(fileSyncProvider_ApplyingChange)
'Public EventApplyingChange(sender As Object, e As Microsoft.Syncronization.Files.ApplyingChangeEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.