Reputation: 485
I wonder if its possible to use Microsoft sync framework in the following scenario.
I have a local folder (with subfolders) with high resolution images and another with low resolution images. I want to sync both folders. The point is that the structure and files in the low folder must be the same as the ones in high but the images must be in low resolution. Obviously the images are not the same so I guess that sync framework can not handle this.
It would be perfect if the framework allows to sync files modifying them at synchronization time. This will be awesome, but I guess that this is more than the framework can handle so, I was thinking on some kind of semi-automatic sync. I mean, let the framework detect the changes, read these changes and perform the create/delete files operations from myself according to this changes.
Is this possible? Is there any other way to do that?
Thanks
Upvotes: 2
Views: 264
Reputation: 2269
The closest I have gotten working on a similar problem is the following:
Set up a folder to 'fake sync' to; and perform a full sync into that folder (not in preview mode, an actual sync).
Set the SyncOrchestrator LocalProvider to a provider for the fake folder, and set the provider to ExplicitDetectChanges.
Intentionally do not call DetectChanges() for your fake provider (we don't really want to know what has happened in the fake folder).
Perform a synchronize (SyncDirectionOrder.Download), and catch the names of changed files in OnApplyingChange. This will send all of the files into the fake folder and update the metadata
Delete all files in the fake folder except the metadata file.
The next time you synchronize, the metadata file in the fake folder should keep the changes, and so only show changed files. I get that my scenario is a little different from yours, but hopefully it helps anyway.
Upvotes: 1
Reputation: 7860
the file sync provider in Sync Framework has a preview mode that allows you to detect the changes without doing an actual sync... you can then loop thru the changes and do your other processing...
Upvotes: 1