Wednesday, December 31, 2014

StorageFileQueryResult ContentsChanged event not firing on file moving away?

Hi Lee McPherson,


>> If moving a file into a monitored folder triggers an event because the file was "created" there, why wouldn't moving a file out of a monitored folder trigger an event due to "deleting" the file?


Based on my research, I found there were something misunderstanding about file movement. There were two scenarios about moving a file out of source folder to target folder. If the two folders were in same drive, system would cut and paste file to target folder, then the event would raise and app worked fine. But if the tow folder were in different drive, system would copy a new file to target folder, then the event would not raise and app did not work. Please check it on your side. We cannot change the second scenario, so I suggest try to work around.


In desktop application, I know there are several properties like “last access time”, I think we can try to use these properties to achieve your requirement. Just maintains an array of object in your app, store those time properties at a particular time, refresh them using a timer, then you can know the changes in the folders. See the code sample in http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.fileproperties.basicproperties.aspx.


Regards,




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


No comments:

Post a Comment