Skip to content

Commit f19c117

Browse files
authored
feat(Pinyin): add Pinyin service (#616)
* feat: 增加 IPinyinService 服务 * chore: 更新框架支持 NET 10 * chore: 增加 Pinyin 工程
1 parent 0a27a19 commit f19c117

7 files changed

Lines changed: 521 additions & 2 deletions

File tree

BootstrapBlazor.Extensions.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
<Project Path="src/components/BootstrapBlazor.OpenAI.GPT3/BootstrapBlazor.OpenAI.csproj" />
6060
<Project Path="src/components/BootstrapBlazor.PdfReader/BootstrapBlazor.PdfReader.csproj" />
6161
<Project Path="src/components/BootstrapBlazor.PdfViewer/BootstrapBlazor.PdfViewer.csproj" />
62+
<Project Path="src/components/BootstrapBlazor.Pinyin/BootstrapBlazor.Pinyin.csproj" Id="8aa8ae66-562c-4205-9e64-a6787860fdf3" />
6263
<Project Path="src/components/BootstrapBlazor.Player/BootstrapBlazor.Player.csproj" />
6364
<Project Path="src/components/BootstrapBlazor.RDKit/BootstrapBlazor.RDKit.csproj" />
6465
<Project Path="src/components/BootstrapBlazor.Region/BootstrapBlazor.Region.csproj" Id="f4e0b11d-f630-4e34-9dca-e9c6b6b60cee" />

src/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22

3-
<Target Name="CopyLogo" AfterTargets="Build" Condition="'$(TargetFramework)' == 'net9.0'">
3+
<Target Name="CopyLogo" AfterTargets="Build" Condition="'$(TargetFramework)' == 'net10.0'">
44
<Message Text="Copy logo assets ..." Importance="high"></Message>
55
<Copy SourceFiles="$(MSBuildThisFileDirectory)logo.png" DestinationFiles="$(MSBuildProjectDirectory)\logo.png" SkipUnchangedFiles="true" ></Copy>
66

src/Frameworks.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
55
</PropertyGroup>
66

77
</Project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Razor">
2+
3+
<PropertyGroup>
4+
<Version>9.0.0</Version>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components Pinyin</PackageTags>
9+
<Description>Bootstrap UI components extensions of Pinyin</Description>
10+
</PropertyGroup>
11+
12+
<PropertyGroup>
13+
<NET8Version>8.0.*</NET8Version>
14+
<NET9Version>9.0.*</NET9Version>
15+
<NET10Version>10.0.0-rc*</NET10Version>
16+
</PropertyGroup>
17+
18+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
19+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(NET8Version)" />
20+
</ItemGroup>
21+
22+
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
23+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(NET8Version)" />
24+
</ItemGroup>
25+
26+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
27+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(NET9Version)" />
28+
</ItemGroup>
29+
30+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
31+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(NET9Version)" />
32+
</ItemGroup>
33+
34+
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
35+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(NET10Version)" />
36+
</ItemGroup>
37+
38+
</Project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
// Website: https://www.blazor.zone or https://argozhang.github.io/
4+
5+
using Microsoft.Extensions.DependencyInjection;
6+
using Microsoft.Extensions.DependencyInjection.Extensions;
7+
8+
namespace BootstrapBlazor.Components;
9+
10+
/// <summary>
11+
/// BootstrapBlazor service extensions
12+
/// </summary>
13+
public static class ServiceCollectionExtension
14+
{
15+
/// <summary>
16+
/// Inject <see cref="IPinyinService"/> service extension method.
17+
/// </summary>
18+
/// <param name="services"></param>
19+
/// <returns></returns>
20+
public static IServiceCollection AddPinyinService(this IServiceCollection services)
21+
{
22+
services.TryAddSingleton<IPinyinService, DefaultPinyinService>();
23+
24+
return services;
25+
}
26+
}

0 commit comments

Comments
 (0)