Skip to content

Commit

Permalink
Merge pull request #12 from afunc233/avalonia11
Browse files Browse the repository at this point in the history
replace all IBitmap to Bitmap
  • Loading branch information
SKProCH authored May 27, 2023
2 parents 77b9133 + 43c8296 commit 3253f74
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion AsyncImageLoader.Avalonia.Demo/Services/LongLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace AsyncImageLoader.Avalonia.Demo.Services {
public class LongLoader : BaseWebImageLoader {
public static LongLoader Instance { get; } = new LongLoader();
protected override async Task<IBitmap?> LoadAsync(string url) {
protected override async Task<Bitmap?> LoadAsync(string url) {
await Task.Delay(1000);
return await base.LoadAsync(url);
}
Expand Down
2 changes: 1 addition & 1 deletion AsyncImageLoader.Avalonia/AdvancedImage.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private async void UpdateImage(string? source, IAsyncImageLoader? loader)
IsLoading = true;
CurrentImage = null;

IBitmap? bitmap = null;
Bitmap? bitmap = null;
if (source != null)
{
// Hack to support relative URI
Expand Down
2 changes: 1 addition & 1 deletion AsyncImageLoader.Avalonia/IAsyncImageLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public interface IAsyncImageLoader : IDisposable
/// </summary>
/// <param name="url">Target url</param>
/// <returns>Bitmap</returns>
public Task<IBitmap?> ProvideImageAsync(string url);
public Task<Bitmap?> ProvideImageAsync(string url);
}
}
4 changes: 2 additions & 2 deletions AsyncImageLoader.Avalonia/Loaders/BaseWebImageLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public BaseWebImageLoader(HttpClient httpClient, bool disposeHttpClient)
protected HttpClient HttpClient { get; }

/// <inheritdoc />
public virtual Task<IBitmap?> ProvideImageAsync(string url)
public virtual Task<Bitmap?> ProvideImageAsync(string url)
{
return LoadAsync(url);
}
Expand All @@ -60,7 +60,7 @@ public void Dispose()
/// </summary>
/// <param name="url">Target url</param>
/// <returns>Bitmap</returns>
protected virtual async Task<IBitmap?> LoadAsync(string url)
protected virtual async Task<Bitmap?> LoadAsync(string url)
{
var internalOrCachedBitmap = await LoadFromInternalAsync(url) ?? await LoadFromGlobalCache(url);
if (internalOrCachedBitmap != null) return internalOrCachedBitmap;
Expand Down
4 changes: 2 additions & 2 deletions AsyncImageLoader.Avalonia/Loaders/RamCachedWebImageLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace AsyncImageLoader.Loaders
/// </summary>
public class RamCachedWebImageLoader : BaseWebImageLoader
{
private readonly ConcurrentDictionary<string, Task<IBitmap?>> _memoryCache = new();
private readonly ConcurrentDictionary<string, Task<Bitmap?>> _memoryCache = new();

/// <inheritdoc />
public RamCachedWebImageLoader()
Expand All @@ -25,7 +25,7 @@ public RamCachedWebImageLoader(HttpClient httpClient, bool disposeHttpClient) :
}

/// <inheritdoc />
public override async Task<IBitmap?> ProvideImageAsync(string url)
public override async Task<Bitmap?> ProvideImageAsync(string url)
{
var bitmap = await _memoryCache.GetOrAdd(url, LoadAsync);
// If load failed - remove from cache and return
Expand Down

0 comments on commit 3253f74

Please sign in to comment.