예제 #1
0
        public async Task <string> ReadTextAsync(File file)
        {
            var result = await file.ToNative().ConfigureAwait(false);

            if (result.IsFailed)
            {
                // TODO
                throw new Exception("Exception");
            }

            var nativeFile = result.Value;

            return(await FileIO.ReadTextAsync(nativeFile).AsTask().ConfigureAwait(false));
        }
예제 #2
0
        public async Task WriteTextAsync(File file, string content)
        {
            var result = await file.ToNative().ConfigureAwait(false);

            if (result.IsFailed)
            {
                // TODO
                throw new Exception("Exception");
            }

            var nativeFile = result.Value;

            await FileIO.WriteTextAsync(nativeFile, content).AsTask().ConfigureAwait(false);
        }