From 724bb45abb8ce55d8dfea9d91a746f386990a2cd Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Wed, 23 May 2018 00:26:42 +0200 Subject: [PATCH] comment fixes --- src/Avalonia.Base/Platform/IAssetLoader.cs | 6 +++--- src/Shared/PlatformSupport/AssetLoader.cs | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Avalonia.Base/Platform/IAssetLoader.cs b/src/Avalonia.Base/Platform/IAssetLoader.cs index 3b459818dd..d3b6cafeae 100644 --- a/src/Avalonia.Base/Platform/IAssetLoader.cs +++ b/src/Avalonia.Base/Platform/IAssetLoader.cs @@ -41,7 +41,7 @@ namespace Avalonia.Platform /// /// A stream containing the asset contents. /// - /// The resource was not found. + /// The asset could not be found. /// 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 resource was not found. + /// The asset could not be found. /// (Stream stream, Assembly assembly) OpenAndGetAssembly(Uri uri, Uri baseUri = null); @@ -65,7 +65,7 @@ namespace Avalonia.Platform /// Gets all assets at a specific location. /// /// The location of assets. - /// A tuple containing the absolute path to the resource and the owner assembly + /// A tuple containing the absolute path to the asset and the owner assembly IEnumerable<(string absolutePath, Assembly assembly)> GetAssets(Uri location); } } diff --git a/src/Shared/PlatformSupport/AssetLoader.cs b/src/Shared/PlatformSupport/AssetLoader.cs index b835170036..0cf60a5e19 100644 --- a/src/Shared/PlatformSupport/AssetLoader.cs +++ b/src/Shared/PlatformSupport/AssetLoader.cs @@ -72,7 +72,7 @@ namespace Avalonia.Shared.PlatformSupport /// /// A stream containing the asset contents. /// - /// The resource was not found. + /// The asset could not be found. /// 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 resource was not found. + /// The asset could not be found. /// 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;