예제 #1
0
        public StorageFolder getStorageFolder()
        {
            if (storageFolder == null)
            {
                try
                {
                    storageFolder = parent.getStorageFolder().GetFolderAsync(name).DoSynchronously();
                }
                catch (System.IO.IOException e)
                {
                    throw DotNetIOUtils.jSimpleExceptionFromDotNetIOException(e);
                }
            }

            return(storageFolder);
        }
예제 #2
0
        public override OutputStream openForCreate()
        {
            try
            {
                storageFile =
                    parent.getStorageFolder().CreateFileAsync(name, CreationCollisionOption.ReplaceExisting)
                    .DoSynchronously();

                IRandomAccessStream randomAccessStream =
                    storageFile.OpenAsync(FileAccessMode.ReadWrite).DoSynchronously();
                IOutputStream outputStream = randomAccessStream.GetOutputStreamAt(0);

                // Use the default buffer for AsStreamForWrite()
                return(new DotNetStreamOutputStream(outputStream.AsStreamForWrite()));
            }
            catch (System.IO.IOException e)
            {
                throw DotNetIOUtils.jSimpleExceptionFromDotNetIOException(e);
            }
        }