private async void GetFileAsync(string name, Action <WSAStorageFile> result) { StorageFile file = await OriginalFolder.GetFileAsync(name); WSAStorageFile mappedFile = MapStorageFileToWSAStorageFile(file); result(mappedFile); }
/// <summary> /// Creates a file, if the file already exists it will be overwritten /// </summary> /// <param name="name">Name of the file</param> /// <returns>A handle to the created file</returns> public WSAStorageFile CreateFile(string name) { #if NETFX_CORE || (ENABLE_IL2CPP && UNITY_WSA_10_0) StorageFile file = OriginalFolder.CreateFileAsync(name, CreationCollisionOption.ReplaceExisting).AsTask().Result; WSAStorageFile mappedFile = MapStorageFileToWSAStorageFile(file); return(mappedFile); #else return(new WSAStorageFile()); #endif }