I'm pondering doing some processing on the XML files you guys write down but to do it currently I'm going to have to use a file watcher, happy to do that but I wondered if it would be better to have an event in uSync itself that I could hook into that fires when it has done any syncing.
These are fired every time an sync (xml) file is written to disk or deleted. they pass the filename in the event arg
With Attach set (the default in the config attach="true") these events will fire shortly after any changes via the umbraco back end.
and if you have a full sync running at startup write="true" then you would get lots of these events firing at start up as uSync writes all the doctypes out to disk.
have a go and let me know if that does what you want.
They are in main jumps.umbraco.usync class. and they fire with events arguments for import,export and attach so you can work out what uSync is about to do / has just done ?
probably the most sensible way to use them all is attach to Initialized and then when it fires attach to the individual file events in that callback. then you won't get loads of events firing during startup ?
Can you add an event?
I'm pondering doing some processing on the XML files you guys write down but to do it currently I'm going to have to use a file watcher, happy to do that but I wondered if it would be better to have an event in uSync itself that I could hook into that fires when it has done any syncing.
Thoughts?
yeah
We currently have events for PreSave and PreDelete, those in the know tell me this is good for Team Foundation Server.
I can add a Saved and Deleted event, so you can pick up on those if you want to do something afterwards.
Hi i've added some events to the latest build of uSync(1.5.1)
These are fired every time an sync (xml) file is written to disk or deleted. they pass the filename in the event arg
With Attach set (the default in the config
attach="true"
) these events will fire shortly after any changes via the umbraco back end.and if you have a full sync running at startup
write="true"
then you would get lots of these events firing at start up as uSync writes all the doctypes out to disk.have a go and let me know if that does what you want.
Perfect Kevin, I'll have a play and report back :)
A "sync'ed everything for now" event might be nice but guess I could fudge that by throttling/debouncing the Saved events?
Hi i've just put a 'beta' of uSync 1.7.0 out.
It has events for Starting and Initialized
They are in main jumps.umbraco.usync class. and they fire with events arguments for import,export and attach so you can work out what uSync is about to do / has just done ?
probably the most sensible way to use them all is attach to Initialized and then when it fires attach to the individual file events in that callback. then you won't get loads of events firing during startup ?
is working on a reply...