In metro, what's the difference between FolderInformation and StorageFolder

假装没事ソ 提交于 2019-12-11 02:39:27

问题


FolderInformation's methods/properties are nearly the same with StorageFolder's. I can't figure out why WinRT api provides FolderInformation and StorageFolder as well. If I assign the list created from FileInformationFactory.GetFoldersAsync() to an ItemsControl, does it differ from the listed created from StorageFolder.CreateFolderAsync() ? The document says the FolderInformation provides synchronous access, but I don't know when the issue would happen.

The one drawback I found in FolderInformation is it could only be created from FileInformationFactory. So I think it's impossible to create a FolderInformation for the KnownFolders.PicturesLibrary.


回答1:


FolderInformation lets you act on the Folder itself (as in move it, delete it, rename it etc.) http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.bulkaccess.folderinformation.aspx

Whereas StorageFolder lets you act on the contents of the folder (as in create a new file in the folder, create a new sub-folder in the folder, get all the files from the folder etc.) http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefolder.aspx



来源:https://stackoverflow.com/questions/13944488/in-metro-whats-the-difference-between-folderinformation-and-storagefolder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!