Skip to content

Commit

Permalink
迁移至 .NET8 (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richasy authored Dec 29, 2023
1 parent 64b1d79 commit 9c78c48
Show file tree
Hide file tree
Showing 105 changed files with 3,302 additions and 3,396 deletions.
19 changes: 0 additions & 19 deletions Bili.Copilot.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libs.Provider", "src\Libs\L
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libs.Flyleaf", "src\Libs\Libs.Flyleaf\Libs.Flyleaf.csproj", "{2B1FB1C6-BD03-4DF6-90DB-B77CEEA51CE1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libs.Markdown", "src\Libs\Libs.Markdown\Libs.Markdown.csproj", "{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -245,22 +243,6 @@ Global
{2B1FB1C6-BD03-4DF6-90DB-B77CEEA51CE1}.Release|x64.Build.0 = Release|Any CPU
{2B1FB1C6-BD03-4DF6-90DB-B77CEEA51CE1}.Release|x86.ActiveCfg = Release|Any CPU
{2B1FB1C6-BD03-4DF6-90DB-B77CEEA51CE1}.Release|x86.Build.0 = Release|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Debug|ARM64.Build.0 = Debug|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Debug|x64.ActiveCfg = Debug|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Debug|x64.Build.0 = Debug|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Debug|x86.ActiveCfg = Debug|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Debug|x86.Build.0 = Debug|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Release|Any CPU.Build.0 = Release|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Release|ARM64.ActiveCfg = Release|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Release|ARM64.Build.0 = Release|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Release|x64.ActiveCfg = Release|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Release|x64.Build.0 = Release|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Release|x86.ActiveCfg = Release|Any CPU
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -276,7 +258,6 @@ Global
{C56C60F0-C717-4AA1-8B4E-C516A83031A9} = {4AAF05CF-97F6-469D-BCB4-23802A4A0C6F}
{1024C320-57B8-445D-875E-5D969E7CA520} = {4AAF05CF-97F6-469D-BCB4-23802A4A0C6F}
{2B1FB1C6-BD03-4DF6-90DB-B77CEEA51CE1} = {4AAF05CF-97F6-469D-BCB4-23802A4A0C6F}
{174EC53A-5C44-4F74-9DA3-499F05CEF7CA} = {4AAF05CF-97F6-469D-BCB4-23802A4A0C6F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5A195D36-BD13-472D-B17E-5070E06D82C8}
Expand Down
14 changes: 10 additions & 4 deletions src/App/App.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows10.0.22000.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22000.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<RootNamespace>Bili.Copilot.App</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<AssemblyName>Bili.Copilot.App</AssemblyName>
Expand Down Expand Up @@ -160,19 +160,22 @@
<None Remove="Controls\Comment\CommentMainView\CommentMainView.xaml" />
<None Remove="Controls\Base\UserItem\UserItem.xaml" />
<None Remove="Controls\Base\MessageItem\MessageItem.xaml" />
<None Remove="Controls\Markdown\MarkdownTextBlock.xaml" />
</ItemGroup>
<ItemGroup>
<Content Include="NLog.config" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="ColorCode.WinUI" Version="2.0.15" />
<PackageReference Include="CommunityToolkit.Labs.WinUI.SegmentedControl" Version="0.1.230830" />
<PackageReference Include="CommunityToolkit.Labs.WinUI.SettingsControls" Version="0.0.18" />
<PackageReference Include="CommunityToolkit.Labs.WinUI.Shimmer" Version="0.1.230830" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.0.231214-build.795" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Animations" Version="7.1.2" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls.Primitives" Version="7.1.2" />
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.0.123" />
<PackageReference Include="Markdig" Version="0.34.0" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="5.0.3" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="5.0.3" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta">
Expand All @@ -182,6 +185,7 @@
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231115000" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
<PackageReference Include="NLog" Version="5.2.7" />
<PackageReference Include="Roman-Numerals" Version="2.0.0" />
<PackageReference Include="Vortice.WinUI" Version="3.4.1-beta" />
<PackageReference Include="WinUIEx" Version="2.3.3" />
<Manifest Include="$(ApplicationManifest)" />
Expand All @@ -197,7 +201,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Libs\Libs.Flyleaf\Libs.Flyleaf.csproj" />
<ProjectReference Include="..\Libs\Libs.Markdown\Libs.Markdown.csproj" />
<ProjectReference Include="..\Libs\Libs.Provider\Libs.Provider.csproj" />
<ProjectReference Include="..\Libs\Libs.Toolkit\Libs.Toolkit.csproj" />
<ProjectReference Include="..\Models\Models.App\Models.App.csproj" />
Expand Down Expand Up @@ -232,6 +235,9 @@
<None Update="Assets\ffmpeg\swscale-7.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Page Update="Controls\Markdown\MarkdownTextBlock.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Controls\Settings\ThemeSettingSection.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down
1 change: 1 addition & 0 deletions src/App/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<ResourceDictionary Source="ms-appx:///Controls/Comment/CommentItem/CommentItem.xaml" />
<ResourceDictionary Source="ms-appx:///Controls/Comment/CommentMainView/CommentMainView.xaml" />
<ResourceDictionary Source="ms-appx:///Controls/Comment/CommentDetailView/CommentDetailView.xaml" />
<ResourceDictionary Source="ms-appx:///Controls/Markdown/MarkdownTextBlock.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/Overwrites.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/TrayResources.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
44 changes: 44 additions & 0 deletions src/App/Controls/Markdown/DefaultSVGRenderer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (c) Reader Copilot. All rights reserved.
// <auto-generated />

using Microsoft.UI.Xaml.Media.Imaging;

namespace Bili.Copilot.App.Controls.Markdown;

internal class DefaultSVGRenderer : ISVGRenderer
{
public async Task<Image> SvgToImage(string svgString)
{
var svgImageSource = new SvgImageSource();
var image = new Image();

// Create a MemoryStream object and write the SVG string to it
using (var memoryStream = new MemoryStream())
using (var streamWriter = new StreamWriter(memoryStream))
{
await streamWriter.WriteAsync(svgString);
await streamWriter.FlushAsync();

// Rewind the MemoryStream
memoryStream.Position = 0;

// Load the SVG from the MemoryStream
await svgImageSource.SetSourceAsync(memoryStream.AsRandomAccessStream());
}

// Set the Source property of the Image control to the SvgImageSource object
image.Source = svgImageSource;
var size = Extensions.GetSvgSize(svgString);
if (size.Width != 0)
{
image.Width = size.Width;
}

if (size.Height != 0)
{
image.Height = size.Height;
}

return image;
}
}
Loading

0 comments on commit 9c78c48

Please sign in to comment.