Bug fix #474
This commit is contained in:
parent
85769d797b
commit
39fe7b79d2
@ -2,7 +2,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Version>9.2.1.1</Version>
|
||||
<Version>9.2.2.1</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Octokit" Version="5.0.0" />
|
||||
|
||||
@ -130,8 +130,17 @@ namespace LibationAvalonia.ViewModels
|
||||
}
|
||||
|
||||
private void PictureStorage_PictureCached(object sender, PictureCachedEventArgs e)
|
||||
{
|
||||
if (e.Definition.PictureId == Book.PictureId)
|
||||
{
|
||||
// state validation
|
||||
if (e is null ||
|
||||
e.Definition.PictureId is null ||
|
||||
Book?.PictureId is null ||
|
||||
e.Picture is null ||
|
||||
e.Picture.Length == 0)
|
||||
return;
|
||||
|
||||
// logic validation
|
||||
if (e.Definition.PictureId == Book.PictureId)
|
||||
{
|
||||
using var ms = new System.IO.MemoryStream(e.Picture);
|
||||
Cover = new Avalonia.Media.Imaging.Bitmap(ms);
|
||||
|
||||
@ -140,7 +140,16 @@ namespace LibationWinForms.GridView
|
||||
|
||||
private void PictureStorage_PictureCached(object sender, PictureCachedEventArgs e)
|
||||
{
|
||||
if (e.Definition.PictureId == Book.PictureId)
|
||||
// state validation
|
||||
if (e is null ||
|
||||
e.Definition.PictureId is null ||
|
||||
Book?.PictureId is null ||
|
||||
e.Picture is null ||
|
||||
e.Picture.Length == 0)
|
||||
return;
|
||||
|
||||
// logic validation
|
||||
if (e.Definition.PictureId == Book.PictureId)
|
||||
{
|
||||
Cover = ImageReader.ToImage(e.Picture);
|
||||
PictureStorage.PictureCached -= PictureStorage_PictureCached;
|
||||
|
||||
@ -64,16 +64,6 @@
|
||||
<DependentUpon>SettingsDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Form1.*.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Form1.*.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user