minor updates to use expression bodies

This commit is contained in:
Steve Maillet 2016-04-02 22:27:27 -07:00
Родитель 1db7e7b670
Коммит c7476ae3db
3 изменённых файлов: 6 добавлений и 18 удалений

Просмотреть файл

@ -30,20 +30,14 @@ namespace CMSIS.Pack
}
/// <summary>Enumeration of the Packs listed in the Index</summary>
public IEnumerable<IPackIndexEntry> Packs { get { return Packs_.AsReadOnly( ); } }
public IEnumerable<IPackIndexEntry> Packs => Packs_.AsReadOnly( );
private readonly List<IPackIndexEntry> Packs_ = new List<IPackIndexEntry>();
/// <summary>Download and parse the index file from the Default location <see cref="DefaultIndexUriPath"/></summary>
/// <returns>Task for the Asynchronous operation</returns>
public Task LoadAsync( )
{
return LoadAsync( new Uri( DefaultIndexUriPath ) );
}
public Task LoadAsync( ) => LoadAsync( new Uri( DefaultIndexUriPath ) );
public Task LoadAsync( IProgress<FileDownloadProgress> progressSink )
{
return LoadAsync( new Uri( DefaultIndexUriPath ), progressSink );
}
public Task LoadAsync( IProgress<FileDownloadProgress> progressSink ) => LoadAsync( new Uri( DefaultIndexUriPath ), progressSink );
/// <summary>Download and parse the index asynchronously from a URL</summary>
/// <param name="indexUrl">URL of the index file to download</param>

Просмотреть файл

@ -24,10 +24,7 @@ namespace CMSIS.Pack
{
}
public DateTime LastUpdatedTimeUTC
{
get { return File.GetLastWriteTimeUtc( Path.Combine( LocalPath, "pack.idx" ) ); }
}
public DateTime LastUpdatedTimeUTC => File.GetLastWriteTimeUtc( Path.Combine( LocalPath, "pack.idx" ) );
public string WebRoot { get; }
@ -65,10 +62,7 @@ namespace CMSIS.Pack
}
}
public Task UpdateLocalFromSource( )
{
return Task.FromResult<object>( null );
}
public Task UpdateLocalFromSource( ) => Task.FromResult<object>( null );
private Task<PackInstallState> GetInstallState( IPackIndexEntry pack )
{

Просмотреть файл

@ -39,7 +39,7 @@ namespace CMSIS.Pack
public async Task<string> GetPackageDescriptionDocumentAsync( )
{
using( var strm = System.IO.File.OpenText( Path.Combine( Repository.WebRoot, PdscName ) ) )
using( var strm = File.OpenText( Path.Combine( Repository.WebRoot, PdscName ) ) )
{
return await strm.ReadToEndAsync( );
}