|
@@ -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;
|