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

10
src/Shared/PlatformSupport/AssetLoader.cs

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

Loading…
Cancel
Save