parent
2106ca6a1d
commit
4e99b648ff
|
@ -10,6 +10,16 @@
|
|||
<Content Remove="wwwroot\js\Upload.ts" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))">
|
||||
<DefineConstants>WINDOWS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))">
|
||||
<DefineConstants>LINUX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))">
|
||||
<DefineConstants>MACOS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AntDesign" Version="0.15.4" />
|
||||
<PackageReference Include="AntDesign.Charts" Version="0.3.1" />
|
||||
|
@ -64,6 +74,12 @@
|
|||
<TypeScriptCompile Include="wwwroot\js\Upload.ts" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="favicon.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<TypeScriptCompile Update="wwwroot\js\Upload.ts">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
|
||||
private async Task RefreshData()
|
||||
{
|
||||
#if WINDOWS
|
||||
var category = new PerformanceCounterCategory("Network Interface");
|
||||
|
||||
foreach (var instance in category.GetInstanceNames())
|
||||
|
@ -83,5 +84,6 @@
|
|||
await Chart.ChangeData(Data.SelectMany(x => x.Value.Select((y, i) => new { value = y, index = i, series = x.Key })), true);
|
||||
}
|
||||
catch { }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
|
||||
private async Task RefreshData()
|
||||
{
|
||||
#if WINDOWS
|
||||
var category = new PerformanceCounterCategory("Network Interface");
|
||||
|
||||
foreach (var instance in category.GetInstanceNames())
|
||||
|
@ -83,5 +84,6 @@
|
|||
await Chart.ChangeData(Data.SelectMany(x => x.Value.Select((y, i) => new { value = y, index = i, series = x.Key })), true);
|
||||
}
|
||||
catch { }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
|
||||
private async Task RefreshData()
|
||||
{
|
||||
#if WINDOWS
|
||||
Data = Data.ShiftArrayAndInsert((double)Math.Ceiling(PerformanceCounter.NextValue()), TimerHistory);
|
||||
|
||||
try
|
||||
|
@ -75,5 +76,6 @@
|
|||
await Chart.ChangeData(Data.Select((x, i) => new { value = x, index = i }), true);
|
||||
}
|
||||
catch { }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,6 +120,7 @@ namespace LANCommander.Services
|
|||
return File.ReadAllBytes(cachedPath);
|
||||
else
|
||||
{
|
||||
#if WINDOWS
|
||||
if (game.Archives == null || game.Archives.Count == 0)
|
||||
throw new FileNotFoundException();
|
||||
|
||||
|
@ -127,31 +128,38 @@ namespace LANCommander.Services
|
|||
|
||||
Bitmap bitmap = null;
|
||||
|
||||
var iconReference = ArchiveService.ReadFile(archive.ObjectKey, game.Icon);
|
||||
|
||||
if (IsWinPEFile(iconReference))
|
||||
try
|
||||
{
|
||||
var tmp = System.IO.Path.GetTempFileName();
|
||||
var iconReference = ArchiveService.ReadFile(archive.ObjectKey, game.Icon);
|
||||
|
||||
System.IO.File.WriteAllBytes(tmp, iconReference);
|
||||
|
||||
var icon = System.Drawing.Icon.ExtractAssociatedIcon(tmp);
|
||||
|
||||
bitmap = icon.ToBitmap();
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var ms = new MemoryStream(iconReference))
|
||||
if (IsWinPEFile(iconReference))
|
||||
{
|
||||
bitmap = (Bitmap)Bitmap.FromStream(ms);
|
||||
var tmp = System.IO.Path.GetTempFileName();
|
||||
|
||||
System.IO.File.WriteAllBytes(tmp, iconReference);
|
||||
|
||||
var icon = System.Drawing.Icon.ExtractAssociatedIcon(tmp);
|
||||
|
||||
bitmap = icon.ToBitmap();
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var ms = new MemoryStream(iconReference))
|
||||
{
|
||||
bitmap = (Bitmap)Bitmap.FromStream(ms);
|
||||
}
|
||||
}
|
||||
|
||||
var iconPng = ConvertToPng(bitmap);
|
||||
|
||||
File.WriteAllBytes(cachedPath, iconPng);
|
||||
|
||||
return iconPng;
|
||||
}
|
||||
catch (Exception ex) { }
|
||||
#endif
|
||||
|
||||
var iconPng = ConvertToPng(bitmap);
|
||||
|
||||
File.WriteAllBytes(cachedPath, iconPng);
|
||||
|
||||
return iconPng;
|
||||
return File.ReadAllBytes("favicon.png");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
Loading…
Reference in New Issue