minor updates to use expression bodies
This commit is contained in:
Родитель
1db7e7b670
Коммит
c7476ae3db
|
@ -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( );
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче