private ServeOriginal ( string path, IStorageFile storageFile, IFormatInfo outputFormat ) : IResult | ||
path | string | |
storageFile | IStorageFile | |
outputFormat | IFormatInfo | |
return | IResult |
private IResult ServeOriginal( string path, IStorageFile storageFile, IFormatInfo outputFormat )
{
var stream = storageFile.GetStream();
IAddToCacheResult cacheResult;
if ( MediaCache.TryAddToCache( path, stream, outputFormat, out cacheResult ) )
{
return new CopyToOutputStreamResult( cacheResult.LastModified, cacheResult.ETag, storageFile.ContentLength, stream );
}
return storageFile;
}