Browse Source

comment fixes

pull/1608/head
Benedikt Schroeder 9 years ago
parent
commit
724bb45abb
  1. 6
      src/Avalonia.Base/Platform/IAssetLoader.cs
  2. 10
      src/Shared/PlatformSupport/AssetLoader.cs

6
src/Avalonia.Base/Platform/IAssetLoader.cs

@ -41,7 +41,7 @@ namespace Avalonia.Platform
/// </param>
/// <returns>A stream containing the asset contents.</returns>
/// <exception cref="FileNotFoundException">
/// The resource was not found.
/// The asset could not be found.
/// </exception>
Stream Open(Uri uri, Uri baseUri = null);
@ -57,7 +57,7 @@ namespace Avalonia.Platform
/// The stream containing the asset contents together with the assembly.
/// </returns>
/// <exception cref="FileNotFoundException">
/// The resource was not found.
/// The asset could not be found.
/// </exception>
(Stream stream, Assembly assembly) OpenAndGetAssembly(Uri uri, Uri baseUri = null);
@ -65,7 +65,7 @@ namespace Avalonia.Platform
/// Gets all assets at a specific location.
/// </summary>
/// <param name="location">The location of assets.</param>
/// <returns>A tuple containing the absolute path to the resource and the owner assembly</returns>
/// <returns>A tuple containing the absolute path to the asset and the owner assembly</returns>
IEnumerable<(string absolutePath, Assembly assembly)> GetAssets(Uri location);
}
}

10
src/Shared/PlatformSupport/AssetLoader.cs

@ -72,7 +72,7 @@ namespace Avalonia.Shared.PlatformSupport
/// </param>
/// <returns>A stream containing the asset contents.</returns>
/// <exception cref="T:System.IO.FileNotFoundException">
/// The resource was not found.
/// The asset could not be found.
/// </exception>
public Stream Open(Uri uri, Uri baseUri = null) => OpenAndGetAssembly(uri, baseUri).stream;
@ -90,7 +90,7 @@ namespace Avalonia.Shared.PlatformSupport
/// The stream containing the asset contents together with the assembly.
/// </returns>
/// <exception cref="T:System.IO.FileNotFoundException">
/// The resource was not found.
/// The asset could not be found.
/// </exception>
public (Stream stream, Assembly assembly) OpenAndGetAssembly(Uri uri, Uri baseUri = null)
{
@ -98,7 +98,7 @@ namespace Avalonia.Shared.PlatformSupport
if (asset == null)
{
throw new FileNotFoundException($"The resource {uri} could not be found.");
throw new FileNotFoundException($"The asset {uri} could not be found.");
}
return (asset.GetStream(), asset.Assembly);
@ -114,6 +114,8 @@ namespace Avalonia.Shared.PlatformSupport
{
var assembly = GetAssembly(location);
var availableAssets = assembly?.Assets;
return assembly?.Assets.Where(x => x.Key.Contains(location.AbsolutePath))
.Select(x => (x.Key, x.Value.Assembly)) ??
Enumerable.Empty<(string AbsolutePath, Assembly Assembly)>();
@ -129,7 +131,7 @@ namespace Avalonia.Shared.PlatformSupport
{
throw new ArgumentException(
"No default assembly, entry assembly or explicit assembly specified; " +
"don't know where to look up for the resource, try specifiyng assembly explicitly.");
"don't know where to look up for the asset, try specifiyng assembly explicitly.");
}
IAssetDescriptor rv;

Loading…
Cancel
Save