Skip to content

Commit 72b1fb3

Browse files
committed
使用 Unsafe 转换类型
更新爱发电链接
1 parent a89a140 commit 72b1fb3

10 files changed

Lines changed: 12 additions & 11 deletions

File tree

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username
1010
issuehunt: # Replace with a single IssueHunt username
1111
otechie: # Replace with a single Otechie username
1212
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13-
custom: [afdian.com/@wherewhere]
13+
custom: [ifdian.net/@wherewhere]

Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</ItemGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.103" PrivateAssets="all">
12+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="*" PrivateAssets="all">
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1414
</PackageReference>
1515
</ItemGroup>

WinGetStore/Controls/Flyouts/SettingsFlyoutControl.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
<StackPanel Orientation="Horizontal" Spacing="4">
402402
<HyperlinkButton
403403
Content="爱发电"
404-
NavigateUri="http://afdian.com/@wherewhere"
404+
NavigateUri="https://ifdian.net/@wherewhere"
405405
ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
406406
<HyperlinkButton
407407
Content="Patreon"

WinGetStore/Controls/Flyouts/SettingsFlyoutControl.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private void Button_Click(object sender, RoutedEventArgs e)
4141
switch (element.Tag?.ToString())
4242
{
4343
case "Rate":
44-
_ = Launcher.LaunchUriAsync(new Uri("http://afdian.com/@wherewhere"));
44+
_ = Launcher.LaunchUriAsync(new Uri("https://ifdian.net/@wherewhere"));
4545
break;
4646
case "Group":
4747
_ = Launcher.LaunchUriAsync(new Uri("https://t.me/PavingBase"));

WinGetStore/Controls/SettingsCard/SettingsCard.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ private void OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArg
190190
_ = VisualStateManager.GoToState(this, IsEnabled ? NormalState : DisabledState, true);
191191
}
192192

193-
194193
public void OnButtonIconChanged()
195194
{
196195
_ = VisualStateManager.GoToState(this, IsClickEnabled && ActionIcon != null ? "ActionIconVisible" : "ActionIconCollapsed", false);

WinGetStore/Helpers/SettingsHelper.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,11 @@ public T Deserialize<T>([StringSyntax(StringSyntaxAttribute.Json)] string value)
9090
: type == typeof(DateTimeOffset) ? Deserialize(value, SourceGenerationContext.Default.DateTimeOffset)
9191
: JsonSerializer.Deserialize(value, type, SourceGenerationContext.Default) is T result ? result : default;
9292
[MethodImpl(MethodImplOptions.AggressiveInlining)]
93-
static T Deserialize<TValue>([StringSyntax(StringSyntaxAttribute.Json)] string json, JsonTypeInfo<TValue> jsonTypeInfo) =>
94-
JsonSerializer.Deserialize(json, jsonTypeInfo) is T value ? value : default;
93+
static T Deserialize<TValue>([StringSyntax(StringSyntaxAttribute.Json)] string json, JsonTypeInfo<TValue> jsonTypeInfo)
94+
{
95+
TValue value = JsonSerializer.Deserialize(json, jsonTypeInfo);
96+
return Unsafe.As<TValue, T>(ref value);
97+
}
9598
}
9699
}
97100

WinGetStore/Pages/SettingsPages/SettingsPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@
423423
<StackPanel Orientation="Horizontal" Spacing="4">
424424
<HyperlinkButton
425425
Content="爱发电"
426-
NavigateUri="https://afdian.com/@wherewhere"
426+
NavigateUri="https://ifdian.net/@wherewhere"
427427
ToolTipService.ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Mode=Self}}" />
428428
<HyperlinkButton
429429
Content="Patreon"

WinGetStore/Pages/SettingsPages/SettingsPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private void Button_Click(object sender, RoutedEventArgs e)
3939
switch (element.Tag?.ToString())
4040
{
4141
case "Rate":
42-
_ = Launcher.LaunchUriAsync(new Uri("http://afdian.com/@wherewhere"));
42+
_ = Launcher.LaunchUriAsync(new Uri("https://ifdian.net/@wherewhere"));
4343
break;
4444
case "Group":
4545
_ = Launcher.LaunchUriAsync(new Uri("https://t.me/PavingBase"));

WinGetStore/ViewModels/ManagerPages/SearchingViewModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public IList<PackageMatchFilter> Filters
8888
set => SetProperty(ref filters, value);
8989
}
9090

91-
9291
public event PropertyChangedEventHandler PropertyChanged;
9392

9493
protected async void RaisePropertyChangedEvent([CallerMemberName] string name = null)

WinGetStore/WinGetStore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<PackageReference Include="Karambolo.Extensions.Logging.File" Version="4.1.0" />
3131
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.3" />
3232
<PackageReference Include="Microsoft.UI.Xaml" Version="2.8.7" />
33-
<PackageReference Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.12.440" />
33+
<PackageReference Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.28.190" />
3434
</ItemGroup>
3535

3636
<ItemGroup>

0 commit comments

Comments
 (0)