mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-26 03:59:34 +08:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c16daafba | ||
|
|
2acc0a95e0 | ||
|
|
8072b16d42 | ||
|
|
9766e9e71b | ||
|
|
d39f63db65 | ||
|
|
fd6235f110 | ||
|
|
4a9a53dda8 | ||
|
|
4668e26b65 | ||
|
|
c5f24ae32c | ||
|
|
1acf872e80 | ||
|
|
82ea1a62e9 | ||
|
|
04b0c0e433 | ||
|
|
8dfb37bf8b | ||
|
|
a19b3128db | ||
|
|
f70b349229 | ||
|
|
ed104071c2 |
+1
-1
Submodule ref/Avalonia.Image2 updated: c4b9002eb4...fe1d03f448
+1
-1
Submodule ref/Common updated: a7b6b65810...e258b48fbf
+1
-1
Submodule ref/DirectoryPackages updated: 2389197178...1620792f9f
+1
-1
Submodule ref/SteamClient updated: 59fa4c07f6...8215a2f260
@@ -14,7 +14,7 @@ public static partial class AssemblyInfo
|
||||
/// <summary>
|
||||
/// 预览版本号,范围 1~9
|
||||
/// </summary>
|
||||
const string ver_for_preview = "4";
|
||||
const string ver_for_preview = "5";
|
||||
|
||||
/// <summary>
|
||||
/// RC 版本号,范围 0~9
|
||||
|
||||
@@ -58,6 +58,7 @@ sealed partial class Program : Startup
|
||||
// Essentials
|
||||
#if LINUX
|
||||
services.TryAddSingleton<IApplicationVersionService, Essentials_AppVerS>();
|
||||
services.AddSingleton<IDeviceInfoPlatformService, LinuxDeviceInfoPlatformServiceImpl>();
|
||||
#else
|
||||
#if WINDOWS
|
||||
#if AVALONIA
|
||||
@@ -252,6 +253,30 @@ sealed partial class Program : Startup
|
||||
string IApplicationVersionService.AssemblyTrademark => AssemblyInfo.Trademark;
|
||||
}
|
||||
|
||||
#if LINUX
|
||||
sealed class LinuxDeviceInfoPlatformServiceImpl : IDeviceInfoPlatformService
|
||||
{
|
||||
public string Model => "";
|
||||
|
||||
public string Manufacturer => "";
|
||||
|
||||
public string Name => "";
|
||||
|
||||
public string VersionString => Environment.OSVersion.VersionString;
|
||||
|
||||
public DeviceType DeviceType => DeviceType.Physical;
|
||||
|
||||
public bool IsChromeOS => false;
|
||||
|
||||
public bool IsWinUI => false;
|
||||
|
||||
public bool IsUWP => false;
|
||||
|
||||
public DeviceIdiom Idiom => DeviceIdiom.Desktop;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if AVALONIA && WINDOWS
|
||||
sealed class AvaWinDeviceInfoPlatformServiceImpl :
|
||||
Common.Services.Implementation.Essentials.DeviceInfoPlatformServiceImpl
|
||||
|
||||
+5
-1
@@ -1,4 +1,6 @@
|
||||
#if LINUX
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace BD.WTTS.Services.Implementation;
|
||||
|
||||
public sealed class AvaloniaClipboardPlatformService : IClipboardPlatformService
|
||||
@@ -28,7 +30,9 @@ public sealed class AvaloniaClipboardPlatformService : IClipboardPlatformService
|
||||
var clipboard = topLevel.Clipboard;
|
||||
if (clipboard != null)
|
||||
{
|
||||
await clipboard.SetTextAsync(text);
|
||||
//不能用 await 等待 Linux 上不知啥原因导致卡死
|
||||
clipboard.SetTextAsync(text).GetAwaiter();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,9 +81,9 @@ public sealed class CustomFilePicker : ContentControl
|
||||
{
|
||||
FileName = result.FullPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
Toast.Show(ToastIcon.Warning, Strings.PleaseSelect);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// Toast.Show(ToastIcon.Warning, Strings.PleaseSelect);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:generic="using:System.Collections.Generic"
|
||||
xmlns:i="using:Avalonia.Xaml.Interactivity"
|
||||
xmlns:ia="using:Avalonia.Xaml.Interactions.Core"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -34,7 +35,7 @@
|
||||
ClipToBounds="True"
|
||||
CornerRadius="8">
|
||||
<Panel>
|
||||
<Carousel Name="Carousel" Grid.Column="1">
|
||||
<Carousel Name="CarouselControl" Grid.Column="1">
|
||||
<Carousel.PageTransition>
|
||||
<PageSlide Orientation="Horizontal" Duration="0.25" />
|
||||
</Carousel.PageTransition>
|
||||
@@ -69,21 +70,25 @@
|
||||
Spacing="8" />
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate x:DataType="x:Int32">
|
||||
<DataTemplate>
|
||||
<DataTemplate.DataType>
|
||||
<x:Type x:TypeArguments="x:Int32, x:String" TypeName="generic:KeyValuePair" />
|
||||
</DataTemplate.DataType>
|
||||
<Button
|
||||
Padding="0"
|
||||
Classes="Plain"
|
||||
Click="CarouselBannerIndexButton_Click"
|
||||
Tag="{Binding}">
|
||||
Tag="{Binding Key}">
|
||||
<Ellipse
|
||||
Name="IndexEllipse"
|
||||
Width="10"
|
||||
Height="10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Fill="{Binding Value}"
|
||||
Opacity="0.6"
|
||||
StrokeThickness="0" />
|
||||
<i:Interaction.Behaviors>
|
||||
<!--<i:Interaction.Behaviors>
|
||||
<ia:DataTriggerBehavior
|
||||
Binding="{Binding}"
|
||||
ComparisonCondition="Equal"
|
||||
@@ -91,7 +96,7 @@
|
||||
<ia:ChangePropertyAction
|
||||
PropertyName="Fill"
|
||||
TargetObject="IndexEllipse"
|
||||
Value="#FFFFFF" />
|
||||
Value="White" />
|
||||
</ia:DataTriggerBehavior>
|
||||
<ia:DataTriggerBehavior
|
||||
Binding="{Binding}"
|
||||
@@ -100,9 +105,9 @@
|
||||
<ia:ChangePropertyAction
|
||||
PropertyName="Fill"
|
||||
TargetObject="IndexEllipse"
|
||||
Value="#ADADAD" />
|
||||
Value="Gray" />
|
||||
</ia:DataTriggerBehavior>
|
||||
</i:Interaction.Behaviors>
|
||||
</i:Interaction.Behaviors>-->
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
|
||||
@@ -73,14 +73,14 @@ namespace BD.WTTS.UI.Views.Controls
|
||||
Left.Click += (s, e) => SwiperPrevious();
|
||||
Right.Click += (s, e) => SwiperNext();
|
||||
|
||||
//Carousel[!Carousel.Items] = this[!Items];
|
||||
Carousel[!Carousel.ItemsSourceProperty] = this[!ItemsSourceProperty];
|
||||
Carousel[!Carousel.ItemTemplateProperty] = this[!ItemTemplateProperty];
|
||||
//CarouselControl[!Carousel.Items] = this[!Items];
|
||||
CarouselControl[!Carousel.ItemsSourceProperty] = this[!ItemsSourceProperty];
|
||||
CarouselControl[!Carousel.ItemTemplateProperty] = this[!ItemTemplateProperty];
|
||||
|
||||
this.GetObservable(ItemsSourceProperty)
|
||||
.Subscribe(_ => SwipersLoad());
|
||||
|
||||
Carousel.GetObservable(Carousel.SelectedIndexProperty)
|
||||
CarouselControl.GetObservable(Carousel.SelectedIndexProperty)
|
||||
.Subscribe(x => SwipersLoad());
|
||||
|
||||
this.GetObservable(AutoScrollProperty)
|
||||
@@ -111,18 +111,18 @@ namespace BD.WTTS.UI.Views.Controls
|
||||
{
|
||||
if (sender is Button button && button.Tag is int index)
|
||||
{
|
||||
Carousel.SelectedIndex = index;
|
||||
CarouselControl.SelectedIndex = index;
|
||||
}
|
||||
}
|
||||
|
||||
private void SwipersLoad()
|
||||
{
|
||||
if (Carousel.ItemCount <= 0)
|
||||
if (CarouselControl.ItemCount <= 0)
|
||||
{
|
||||
Swiper.ItemsSource = null;
|
||||
return;
|
||||
}
|
||||
if (Carousel.ItemCount == 1)
|
||||
if (CarouselControl.ItemCount == 1)
|
||||
{
|
||||
Left.IsVisible = Right.IsVisible = Swiper.IsVisible = false;
|
||||
return;
|
||||
@@ -130,13 +130,13 @@ namespace BD.WTTS.UI.Views.Controls
|
||||
else
|
||||
{
|
||||
Left.IsVisible = Right.IsVisible = Swiper.IsVisible = true;
|
||||
var arr = new int[Carousel.ItemCount];
|
||||
for (var i = 0; i < arr.Length; i++)
|
||||
var arr = new Dictionary<int, string>();
|
||||
for (var i = 0; i < CarouselControl.ItemCount; i++)
|
||||
{
|
||||
arr[i] = i;
|
||||
arr.Add(i, "#ADADAD");
|
||||
}
|
||||
//var index = Carousel.SelectedIndex < 0 ? 0 : Carousel.SelectedIndex;
|
||||
//arr[index] = "#FFFFFF";
|
||||
var index = CarouselControl.SelectedIndex < 0 ? 0 : CarouselControl.SelectedIndex;
|
||||
arr[index] = "#FFFFFF";
|
||||
|
||||
Swiper.ItemsSource = arr;
|
||||
}
|
||||
@@ -144,29 +144,29 @@ namespace BD.WTTS.UI.Views.Controls
|
||||
|
||||
private void SwiperNext()
|
||||
{
|
||||
if (Carousel.ItemCount < 1)
|
||||
if (CarouselControl.ItemCount < 1)
|
||||
return;
|
||||
if (Carousel.SelectedIndex < Carousel.ItemCount - 1)
|
||||
if (CarouselControl.SelectedIndex < CarouselControl.ItemCount - 1)
|
||||
{
|
||||
Carousel.Next();
|
||||
CarouselControl.Next();
|
||||
}
|
||||
else
|
||||
{
|
||||
Carousel.SelectedIndex = 0;
|
||||
CarouselControl.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void SwiperPrevious()
|
||||
{
|
||||
if (Carousel.ItemCount < 1)
|
||||
if (CarouselControl.ItemCount < 1)
|
||||
return;
|
||||
if (Carousel.SelectedIndex > 0)
|
||||
if (CarouselControl.SelectedIndex > 0)
|
||||
{
|
||||
Carousel.Previous();
|
||||
CarouselControl.Previous();
|
||||
}
|
||||
else
|
||||
{
|
||||
Carousel.SelectedIndex = Carousel.ItemCount - 1;
|
||||
CarouselControl.SelectedIndex = CarouselControl.ItemCount - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,166 +67,166 @@
|
||||
</StackPanel>
|
||||
</spp:PageBase.ActionContent>-->
|
||||
<ScrollViewer Padding="20">
|
||||
<spp:ContentLoader IsLoading="False">
|
||||
<StackPanel
|
||||
x:Name="HomeRoot"
|
||||
MaxWidth="1080"
|
||||
Spacing="20">
|
||||
<spp:Snackbar
|
||||
Title="{Binding Path=Res.Notice_Tray_Title, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
VerticalAlignment="Top"
|
||||
IsClosable="False"
|
||||
IsOpen="True"
|
||||
IsVisible="{spp:OnPlatform !GA}"
|
||||
Message="当前使用的程序版本为测试版本,可能会有各种各样不可言明的 Bug,遇到问题请理性反馈,谢谢。"
|
||||
Severity="Warning" />
|
||||
<spp:Snackbar
|
||||
Title="{Binding Path=Res.Notice_Tray_Title, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
VerticalAlignment="Top"
|
||||
IsClosable="False"
|
||||
IsOpen="True"
|
||||
IsVisible="{Binding !!!MainWindow2.PluginCount, Mode=OneWay, Source={x:Static s:IViewModelManager.Instance}}"
|
||||
Message="检测到你没有安装插件,请去下载插件即可使用更多功能。"
|
||||
Severity="Warning" />
|
||||
<!--<spp:ContentLoader IsLoading="False">-->
|
||||
<StackPanel
|
||||
x:Name="HomeRoot"
|
||||
MaxWidth="1080"
|
||||
Spacing="20">
|
||||
<spp:Snackbar
|
||||
Title="{Binding Path=Res.Notice_Tray_Title, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
VerticalAlignment="Top"
|
||||
IsClosable="False"
|
||||
IsOpen="True"
|
||||
IsVisible="{spp:OnPlatform !GA}"
|
||||
Message="当前使用的程序版本为测试版本,可能会有各种各样不可言明的 Bug,遇到问题请理性反馈,谢谢。"
|
||||
Severity="Warning" />
|
||||
<spp:Snackbar
|
||||
Title="{Binding Path=Res.Notice_Tray_Title, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
VerticalAlignment="Top"
|
||||
IsClosable="False"
|
||||
IsOpen="True"
|
||||
IsVisible="{Binding !!!MainWindow2.PluginCount, Mode=OneWay, Source={x:Static s:IViewModelManager.Instance}}"
|
||||
Message="检测到你没有安装插件,请去下载插件即可使用更多功能。"
|
||||
Severity="Warning" />
|
||||
|
||||
<WrapPanel Margin="5,0">
|
||||
<WrapPanel IsVisible="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser, Mode=OneWay, Converter={StaticResource IsNullConverter}, ConverterParameter=invert}">
|
||||
<spp:Image2
|
||||
Width="36"
|
||||
Height="36"
|
||||
Margin="0,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
DecodeWidth="36"
|
||||
Source="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser.AvatarMedium, Mode=OneWay}"
|
||||
Stretch="Uniform">
|
||||
<spp:Image2.Clip>
|
||||
<EllipseGeometry Rect="0,0,36,36" />
|
||||
</spp:Image2.Clip>
|
||||
</spp:Image2>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser.SteamNickName, Mode=OneWay}"
|
||||
Theme="{StaticResource SubtitleTextBlockStyle}" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser.IPCountry, Mode=OneWay, Converter={StaticResource IsNullConverter}, ConverterParameter=invert}"
|
||||
Text="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser.IPCountry, Mode=OneWay, StringFormat={}({0})}"
|
||||
Theme="{StaticResource SubtitleTextBlockStyle}" />
|
||||
<TextBlock
|
||||
Margin="0,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
Text=","
|
||||
Theme="{StaticResource SubtitleTextBlockStyle}" />
|
||||
</WrapPanel>
|
||||
<TextBlock VerticalAlignment="Center" Theme="{StaticResource SubtitleTextBlockStyle}">
|
||||
<Run Text="{Binding Path=Res.Welcome_User_, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
</TextBlock>
|
||||
<WrapPanel Margin="5,0">
|
||||
<WrapPanel IsVisible="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser, Mode=OneWay, Converter={StaticResource IsNullConverter}, ConverterParameter=invert}">
|
||||
<spp:Image2
|
||||
Width="36"
|
||||
Height="36"
|
||||
Margin="0,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
DecodeWidth="36"
|
||||
Source="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser.AvatarMedium, Mode=OneWay}"
|
||||
Stretch="Uniform">
|
||||
<spp:Image2.Clip>
|
||||
<EllipseGeometry Rect="0,0,36,36" />
|
||||
</spp:Image2.Clip>
|
||||
</spp:Image2>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser.SteamNickName, Mode=OneWay}"
|
||||
Theme="{StaticResource SubtitleTextBlockStyle}" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser.IPCountry, Mode=OneWay, Converter={StaticResource IsNullConverter}, ConverterParameter=invert}"
|
||||
Text="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser.IPCountry, Mode=OneWay, StringFormat={}({0})}"
|
||||
Theme="{StaticResource SubtitleTextBlockStyle}" />
|
||||
<TextBlock
|
||||
Margin="0,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
Text=","
|
||||
Theme="{StaticResource SubtitleTextBlockStyle}" />
|
||||
</WrapPanel>
|
||||
<TextBlock VerticalAlignment="Center" Theme="{StaticResource SubtitleTextBlockStyle}">
|
||||
<Run Text="{Binding Path=Res.Welcome_User_, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
|
||||
<Grid Margin="0,-10,0,0" RowDefinitions="Auto,*">
|
||||
<spp:CarouselBanner
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding NavigationBanners}">
|
||||
<spp:CarouselBanner.ItemTemplate>
|
||||
<DataTemplate DataType="spp:AdvertisementDTO">
|
||||
<spp:AppItem
|
||||
Title="{Binding Describe}"
|
||||
Height="350"
|
||||
Classes="Banner Scale"
|
||||
ClickCommand="{Binding OpenBrowserCommand, Source={x:Static spp:App.Instance}}"
|
||||
ClickCommandParameter="{Binding Url}"
|
||||
Description="{Binding Name}">
|
||||
<spp:AppItem.Status>
|
||||
<Border
|
||||
Padding="20,10"
|
||||
Background="{DynamicResource AccentFillColorSelectedTextBackgroundBrush}"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="{StaticResource ControlCornerRadius}">
|
||||
<TextBlock FontSize="16" Text="阅读更多" />
|
||||
</Border>
|
||||
</spp:AppItem.Status>
|
||||
<spp:AppItem.Image>
|
||||
<spp:Image2 Source="{Binding ImageUrl}" />
|
||||
</spp:AppItem.Image>
|
||||
</spp:AppItem>
|
||||
</DataTemplate>
|
||||
</spp:CarouselBanner.ItemTemplate>
|
||||
</spp:CarouselBanner>
|
||||
</Grid>
|
||||
<Grid Margin="0,-10,0,0" RowDefinitions="Auto,*">
|
||||
<spp:CarouselBanner
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding NavigationBanners}">
|
||||
<spp:CarouselBanner.ItemTemplate>
|
||||
<DataTemplate DataType="spp:AdvertisementDTO">
|
||||
<spp:AppItem
|
||||
Title="{Binding Describe}"
|
||||
Height="350"
|
||||
Classes="Banner Scale"
|
||||
ClickCommand="{Binding OpenBrowserCommand, Source={x:Static spp:App.Instance}}"
|
||||
ClickCommandParameter="{Binding Url}"
|
||||
Description="{Binding Name}">
|
||||
<spp:AppItem.Status>
|
||||
<Border
|
||||
Padding="20,10"
|
||||
Background="{DynamicResource AccentFillColorSelectedTextBackgroundBrush}"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="{StaticResource ControlCornerRadius}">
|
||||
<TextBlock FontSize="16" Text="阅读更多" />
|
||||
</Border>
|
||||
</spp:AppItem.Status>
|
||||
<spp:AppItem.Image>
|
||||
<spp:Image2 Source="{Binding ImageUrl}" />
|
||||
</spp:AppItem.Image>
|
||||
</spp:AppItem>
|
||||
</DataTemplate>
|
||||
</spp:CarouselBanner.ItemTemplate>
|
||||
</spp:CarouselBanner>
|
||||
</Grid>
|
||||
|
||||
<!--<Viewbox Stretch="UniformToFill">
|
||||
<!--<Viewbox Stretch="UniformToFill">
|
||||
<spp:AdControl
|
||||
MaxWidth="{Binding #HomeRoot.MaxWidth}"
|
||||
MaxHeight="200"
|
||||
Standard="Horizontal" />
|
||||
</Viewbox>-->
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Margin="0,10"
|
||||
Spacing="10">
|
||||
<DockPanel>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="最新消息"
|
||||
Theme="{StaticResource TitleTextBlockStyle}" />
|
||||
<Button
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding OpenBrowserCommand, Source={x:Static spp:App.Instance}}"
|
||||
CommandParameter="{x:Static spp:HomePageViewModel.OfficialWebsite_Article}"
|
||||
Content="查看更多"
|
||||
DockPanel.Dock="Right"
|
||||
Theme="{StaticResource HyperlinkButton}" />
|
||||
</DockPanel>
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Margin="0,10"
|
||||
Spacing="10">
|
||||
<DockPanel>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="最新消息"
|
||||
Theme="{StaticResource TitleTextBlockStyle}" />
|
||||
<Button
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding OpenBrowserCommand, Source={x:Static spp:App.Instance}}"
|
||||
CommandParameter="{x:Static spp:HomePageViewModel.OfficialWebsite_Article}"
|
||||
Content="查看更多"
|
||||
DockPanel.Dock="Right"
|
||||
Theme="{StaticResource HyperlinkButton}" />
|
||||
</DockPanel>
|
||||
|
||||
<Grid Margin="0,0,0,20" ColumnDefinitions="*,10,*,10,*">
|
||||
<Grid.Styles>
|
||||
<Style x:DataType="spp:ArticleItemDTO" Selector="spp|AppItem">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Title" Value="{Binding Title}" />
|
||||
<Setter Property="Description" Value="{Binding Introduction}" />
|
||||
<Setter Property="Tags" Value="{Binding AuthorName}" />
|
||||
<Setter Property="ClickCommand" Value="{Binding OpenBrowserCommand, Source={x:Static spp:App.Instance}}" />
|
||||
<Setter Property="ClickCommandParameter">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
||||
<CompiledBinding Path="." Source="{x:Static spp:HomePageViewModel.OfficialWebsite_Article_Detail_}" />
|
||||
<CompiledBinding Path="Id" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Image">
|
||||
<Setter.Value>
|
||||
<Template>
|
||||
<spp:Image2 RenderOptions.BitmapInterpolationMode="HighQuality" Source="{Binding CoverUrl}" />
|
||||
</Template>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Status">
|
||||
<Setter.Value>
|
||||
<Template>
|
||||
<Border Classes="Status">
|
||||
<TextBlock Text="{Binding CreationTime, StringFormat={}{0:yyyy-MM-dd}}" />
|
||||
</Border>
|
||||
</Template>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<spp:AppItem Classes="Vertical Scale" DataContext="{Binding Articles[0]}" />
|
||||
<spp:AppItem
|
||||
Grid.Column="2"
|
||||
Classes="Vertical Scale"
|
||||
DataContext="{Binding Articles[1]}" />
|
||||
<spp:AppItem
|
||||
Grid.Column="4"
|
||||
Classes="Vertical Scale"
|
||||
DataContext="{Binding Articles[2]}" />
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,20" ColumnDefinitions="*,10,*,10,*">
|
||||
<Grid.Styles>
|
||||
<Style x:DataType="spp:ArticleItemDTO" Selector="spp|AppItem">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Title" Value="{Binding Title}" />
|
||||
<Setter Property="Description" Value="{Binding Introduction}" />
|
||||
<Setter Property="Tags" Value="{Binding AuthorName}" />
|
||||
<Setter Property="ClickCommand" Value="{Binding OpenBrowserCommand, Source={x:Static spp:App.Instance}}" />
|
||||
<Setter Property="ClickCommandParameter">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
||||
<CompiledBinding Path="." Source="{x:Static spp:HomePageViewModel.OfficialWebsite_Article_Detail_}" />
|
||||
<CompiledBinding Path="Id" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Image">
|
||||
<Setter.Value>
|
||||
<Template>
|
||||
<spp:Image2 RenderOptions.BitmapInterpolationMode="HighQuality" Source="{Binding CoverUrl}" />
|
||||
</Template>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Status">
|
||||
<Setter.Value>
|
||||
<Template>
|
||||
<Border Classes="Status">
|
||||
<TextBlock Text="{Binding CreationTime, StringFormat={}{0:yyyy-MM-dd}}" />
|
||||
</Border>
|
||||
</Template>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<spp:AppItem Classes="Vertical Scale" DataContext="{Binding Articles[0]}" />
|
||||
<spp:AppItem
|
||||
Grid.Column="2"
|
||||
Classes="Vertical Scale"
|
||||
DataContext="{Binding Articles[1]}" />
|
||||
<spp:AppItem
|
||||
Grid.Column="4"
|
||||
Classes="Vertical Scale"
|
||||
DataContext="{Binding Articles[2]}" />
|
||||
</Grid>
|
||||
|
||||
<!--<ItemsControl ItemsSource="{Binding Articles}">
|
||||
<!--<ItemsControl ItemsSource="{Binding Articles}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Grid ColumnDefinitions="*,*,*" />
|
||||
@@ -252,149 +252,149 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>-->
|
||||
|
||||
<DockPanel>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="精选"
|
||||
Theme="{StaticResource TitleTextBlockStyle}" />
|
||||
<Button
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding OpenBrowserCommand, Source={x:Static spp:App.Instance}}"
|
||||
CommandParameter="{x:Static spp:HomePageViewModel.WattGameUrl}"
|
||||
Content="访问 WattGame 商城"
|
||||
DockPanel.Dock="Right"
|
||||
Theme="{StaticResource HyperlinkButton}" />
|
||||
</DockPanel>
|
||||
|
||||
<ScrollViewer
|
||||
Name="ShopsScrollViewer"
|
||||
Margin="0,3,0,20"
|
||||
Padding="0,0,0,15"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Disabled">
|
||||
<ItemsControl ItemsSource="{Binding Shops}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" Spacing="10" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="spp:ShopRecommendGoodItem">
|
||||
<spp:AppItem
|
||||
Title="{Binding Name}"
|
||||
MaxWidth="260"
|
||||
Classes="Vertical Scale"
|
||||
ClickCommand="{Binding OpenBrowserCommand, Source={x:Static spp:App.Instance}}"
|
||||
Cursor="Hand"
|
||||
Tags="{Binding GoodsAllCategorysText}"
|
||||
ToolTip.Tip="{Binding Brief}">
|
||||
<spp:AppItem.ClickCommandParameter>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
||||
<CompiledBinding Path="." Source="{x:Static spp:HomePageViewModel.WattGame_Goods_Detail_}" />
|
||||
<CompiledBinding Path="Id" />
|
||||
</MultiBinding>
|
||||
</spp:AppItem.ClickCommandParameter>
|
||||
<spp:AppItem.Image>
|
||||
<spp:Image2 RenderOptions.BitmapInterpolationMode="HighQuality" Source="{Binding Image}" />
|
||||
</spp:AppItem.Image>
|
||||
<spp:AppItem.Status>
|
||||
<Border Classes="Status">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
IsVisible="{Binding !!DiscountValue}"
|
||||
Text="{Binding Mktprice, Converter={StaticResource StringFormatConverter}, ConverterParameter={x:Static spp:CurrencyCode.CNY}}"
|
||||
TextDecorations="Strikethrough" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{Binding Price, Converter={StaticResource StringFormatConverter}, ConverterParameter={x:Static spp:CurrencyCode.CNY}}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</spp:AppItem.Status>
|
||||
<spp:AppItem.ActionButton>
|
||||
<Border
|
||||
Height="24"
|
||||
Padding="8,0"
|
||||
Background="#4c6b22"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="4"
|
||||
IsVisible="{Binding !!DiscountValue}">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Foreground="#beee11"
|
||||
Text="{Binding DiscountValue, StringFormat={}-{0}%}" />
|
||||
</Border>
|
||||
</spp:AppItem.ActionButton>
|
||||
</spp:AppItem>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
<DockPanel>
|
||||
<TextBlock
|
||||
Margin="-3,0,0,0"
|
||||
Text="已安装功能"
|
||||
VerticalAlignment="Center"
|
||||
Text="精选"
|
||||
Theme="{StaticResource TitleTextBlockStyle}" />
|
||||
<Button
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding OpenBrowserCommand, Source={x:Static spp:App.Instance}}"
|
||||
CommandParameter="{x:Static spp:HomePageViewModel.WattGameUrl}"
|
||||
Content="访问 WattGame 商城"
|
||||
DockPanel.Dock="Right"
|
||||
Theme="{StaticResource HyperlinkButton}" />
|
||||
</DockPanel>
|
||||
|
||||
<ItemsControl ItemsSource="{Binding MainWindow2.TabItems, Mode=OneWay, Source={x:Static s:IViewModelManager.Instance}}">
|
||||
<ItemsControl.Resources>
|
||||
<ControlTheme
|
||||
x:Key="NavButtonStyle"
|
||||
BasedOn="{StaticResource {x:Type Button}}"
|
||||
TargetType="Button">
|
||||
<Setter Property="Width" Value="120" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Margin" Value="6" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="ClipToBounds" Value="True" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ItemsControl.Resources>
|
||||
<ScrollViewer
|
||||
Name="ShopsScrollViewer"
|
||||
Margin="0,3,0,20"
|
||||
Padding="0,0,0,15"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Disabled">
|
||||
<ItemsControl ItemsSource="{Binding Shops}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="10" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="spp:TabItemViewModel">
|
||||
<Border spp:Animations.EnableAnimations="True">
|
||||
<Button
|
||||
Command="{Binding $parent[spp:HomePage].((spp:HomePageViewModel)DataContext).NavgationToMenuPageCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
Theme="{StaticResource NavButtonStyle}">
|
||||
<Grid RowDefinitions="3*,*">
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
CornerRadius="4 4 0 0"
|
||||
RenderOptions.BitmapInterpolationMode="HighQuality">
|
||||
<spp:Image2
|
||||
Width="96"
|
||||
Height="96"
|
||||
Margin="0,10,0,0"
|
||||
Source="{Binding IconKey}"
|
||||
Stretch="Uniform" />
|
||||
</Border>
|
||||
<DataTemplate DataType="spp:ShopRecommendGoodItem">
|
||||
<spp:AppItem
|
||||
Title="{Binding Name}"
|
||||
MaxWidth="260"
|
||||
Classes="Vertical Scale"
|
||||
ClickCommand="{Binding OpenBrowserCommand, Source={x:Static spp:App.Instance}}"
|
||||
Cursor="Hand"
|
||||
Tags="{Binding GoodsAllCategorysText}"
|
||||
ToolTip.Tip="{Binding Brief}">
|
||||
<spp:AppItem.ClickCommandParameter>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
||||
<CompiledBinding Path="." Source="{x:Static spp:HomePageViewModel.WattGame_Goods_Detail_}" />
|
||||
<CompiledBinding Path="Id" />
|
||||
</MultiBinding>
|
||||
</spp:AppItem.ClickCommandParameter>
|
||||
<spp:AppItem.Image>
|
||||
<spp:Image2 RenderOptions.BitmapInterpolationMode="HighQuality" Source="{Binding Image}" />
|
||||
</spp:AppItem.Image>
|
||||
<spp:AppItem.Status>
|
||||
<Border Classes="Status">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
IsVisible="{Binding !!DiscountValue}"
|
||||
Text="{Binding Mktprice, Converter={StaticResource StringFormatConverter}, ConverterParameter={x:Static spp:CurrencyCode.CNY}}"
|
||||
TextDecorations="Strikethrough" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{Binding Price, Converter={StaticResource StringFormatConverter}, ConverterParameter={x:Static spp:CurrencyCode.CNY}}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</spp:AppItem.Status>
|
||||
<spp:AppItem.ActionButton>
|
||||
<Border
|
||||
Height="24"
|
||||
Padding="8,0"
|
||||
Background="#4c6b22"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="4"
|
||||
IsVisible="{Binding !!DiscountValue}">
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="12"
|
||||
FontWeight="SemiBold"
|
||||
Text="{Binding Name}" />
|
||||
</Grid>
|
||||
</Button>
|
||||
</Border>
|
||||
VerticalAlignment="Center"
|
||||
Foreground="#beee11"
|
||||
Text="{Binding DiscountValue, StringFormat={}-{0}%}" />
|
||||
</Border>
|
||||
</spp:AppItem.ActionButton>
|
||||
</spp:AppItem>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
<!--<TextBlock Text="联系我们" Theme="{StaticResource TitleTextBlockStyle}" />
|
||||
<TextBlock
|
||||
Margin="-3,0,0,0"
|
||||
Text="已安装功能"
|
||||
Theme="{StaticResource TitleTextBlockStyle}" />
|
||||
|
||||
<ItemsControl ItemsSource="{Binding MainWindow2.TabItems, Mode=OneWay, Source={x:Static s:IViewModelManager.Instance}}">
|
||||
<ItemsControl.Resources>
|
||||
<ControlTheme
|
||||
x:Key="NavButtonStyle"
|
||||
BasedOn="{StaticResource {x:Type Button}}"
|
||||
TargetType="Button">
|
||||
<Setter Property="Width" Value="120" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Margin" Value="6" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="ClipToBounds" Value="True" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ItemsControl.Resources>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="spp:TabItemViewModel">
|
||||
<Border spp:Animations.EnableAnimations="True">
|
||||
<Button
|
||||
Command="{Binding $parent[spp:HomePage].((spp:HomePageViewModel)DataContext).NavgationToMenuPageCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
Theme="{StaticResource NavButtonStyle}">
|
||||
<Grid RowDefinitions="3*,*">
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
CornerRadius="4 4 0 0"
|
||||
RenderOptions.BitmapInterpolationMode="HighQuality">
|
||||
<spp:Image2
|
||||
Width="96"
|
||||
Height="96"
|
||||
Margin="0,10,0,0"
|
||||
Source="{Binding IconKey}"
|
||||
Stretch="Uniform" />
|
||||
</Border>
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="12"
|
||||
FontWeight="SemiBold"
|
||||
Text="{Binding Name}" />
|
||||
</Grid>
|
||||
</Button>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<!--<TextBlock Text="联系我们" Theme="{StaticResource TitleTextBlockStyle}" />
|
||||
|
||||
<Grid Margin="0,0,0,20" ColumnDefinitions="*,10,*,10,*,10,*,10,*">
|
||||
<spp:AppItem
|
||||
@@ -449,9 +449,9 @@
|
||||
</spp:AppItem>
|
||||
</Grid>-->
|
||||
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!--<TabControl Grid.Row="3" Padding="0">
|
||||
<!--<TabControl Grid.Row="3" Padding="0">
|
||||
<TabItem Header="1111">
|
||||
<StackPanel Spacing="5">
|
||||
<spp:AppItem
|
||||
@@ -523,13 +523,13 @@
|
||||
</TabItem>
|
||||
</TabControl>-->
|
||||
|
||||
<TextBlock
|
||||
Margin="0,30"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="不忘初心,方得始终。"
|
||||
Theme="{StaticResource SubtitleTextBlockStyle}" />
|
||||
</StackPanel>
|
||||
</spp:ContentLoader>
|
||||
<TextBlock
|
||||
Margin="0,30"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="不忘初心,方得始终。"
|
||||
Theme="{StaticResource SubtitleTextBlockStyle}" />
|
||||
</StackPanel>
|
||||
<!--</spp:ContentLoader>-->
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
|
||||
@@ -97,8 +97,7 @@
|
||||
Header="{Binding Path=Res.Settings_General_StorageSpace, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
IconSource="Globe"
|
||||
IsClickEnabled="False"
|
||||
IsExpanded="True"
|
||||
IsVisible="{spp:OnPlatform Windows}">
|
||||
IsExpanded="True">
|
||||
<ui:SettingsExpander.IconSource>
|
||||
<ui:FontIconSource FontFamily="Segoe Fluent Icons" Glyph="" />
|
||||
</ui:SettingsExpander.IconSource>
|
||||
|
||||
@@ -297,7 +297,11 @@ partial class ProxyService
|
||||
break;
|
||||
}
|
||||
StopTimer(); // 停止 UI 计时器
|
||||
#if MACOS
|
||||
reverseProxyService.StopProxyAsync().GetAwaiter(); // 停止代理服务
|
||||
#else
|
||||
await reverseProxyService.StopProxyAsync(); // 停止代理服务
|
||||
#endif
|
||||
return default;
|
||||
}
|
||||
|
||||
|
||||
@@ -472,7 +472,7 @@ public static class AuthenticatorHelper
|
||||
}
|
||||
var filePath = (await FilePicker2.PickAsync(options))?.FullPath;
|
||||
|
||||
if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath))
|
||||
if (!File.Exists(filePath))
|
||||
Toast.Show(ToastIcon.Warning, Strings.FilePathNotExist);
|
||||
return filePath;
|
||||
}
|
||||
|
||||
@@ -17,9 +17,11 @@ public partial class AuthenticatorItemModel : ReactiveObject, IDisposable
|
||||
|
||||
public async Task CopyCode()
|
||||
{
|
||||
//if (!IsShowCode) return;
|
||||
await Clipboard2.SetTextAsync(AuthData.Value?.CurrentCode);
|
||||
Toast.Show(ToastIcon.Success, Strings.LocalAuth_CopyAuthTip + AuthName);
|
||||
if (AuthData.Value?.CurrentCode != null)
|
||||
{
|
||||
await Clipboard2.SetTextAsync(AuthData.Value?.CurrentCode);
|
||||
Toast.Show(ToastIcon.Success, Strings.LocalAuth_CopyAuthTip + AuthName);
|
||||
}
|
||||
}
|
||||
|
||||
public AuthenticatorItemModel(IAuthenticatorDTO authenticatorDto)
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ public record AuthenticatorImportMethod(string Name, string Description, string?
|
||||
|
||||
public class AuthenticatorImportPageViewModel : ViewModelBase
|
||||
{
|
||||
public static string Name => Strings.PleaseSelect + Strings.AuthImport;
|
||||
public static string Name => Strings.AuthImport;
|
||||
|
||||
public IReadOnlyCollection<AuthenticatorImportMethod> AuthenticatorImportMethods { get; }
|
||||
|
||||
|
||||
@@ -34,19 +34,21 @@
|
||||
</Viewbox>
|
||||
</Button>-->
|
||||
<Button
|
||||
Padding="8"
|
||||
Command="{Binding EditAuthNameAsync}"
|
||||
Theme="{StaticResource TransparentButton}"
|
||||
ToolTip.Tip="{Binding Path=Res.Auth_EditName, Mode=OneWay, Source={x:Static s:ResourceService.Current}}">
|
||||
<Viewbox Width="20">
|
||||
<Viewbox Width="16">
|
||||
<ui:SymbolIcon Symbol="Edit" />
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button
|
||||
Padding="8"
|
||||
Command="{Binding ShowSteamTradeWindow}"
|
||||
IsVisible="{Binding IsSteamAuthenticator, Mode=OneWay}"
|
||||
Theme="{StaticResource TransparentButton}"
|
||||
ToolTip.Tip="{Binding Path=Res.LocalAuth_AuthTrade, Mode=OneWay, Source={x:Static s:ResourceService.Current}}">
|
||||
<Viewbox Width="20">
|
||||
<Viewbox Width="16">
|
||||
<ui:FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="" />
|
||||
</Viewbox>
|
||||
</Button>
|
||||
|
||||
@@ -24,4 +24,24 @@ public interface IRequestCacheRepository : IRequestCache
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<int> DeleteAllAsync(DateTimeOffset dateTimeOffset);
|
||||
|
||||
const string DefaultRequestUri = "/";
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
static string GetOriginalRequestUri(HttpRequestMessage request)
|
||||
{
|
||||
string? originalRequestUri;
|
||||
if (request is ImageHttpClientService.ImageHttpRequestMessage request2)
|
||||
{
|
||||
// 对于一些重定向的 Url 使用原始 Url 进行唯一性的计算
|
||||
originalRequestUri = request2.OriginalRequestUri;
|
||||
}
|
||||
else
|
||||
{
|
||||
originalRequestUri = request.RequestUri?.ToString()!;
|
||||
}
|
||||
if (string.IsNullOrEmpty(originalRequestUri))
|
||||
originalRequestUri = DefaultRequestUri;
|
||||
return originalRequestUri;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ namespace BD.WTTS.Repositories;
|
||||
|
||||
internal sealed class RequestCacheRepository : IRequestCacheRepository, IDisposable
|
||||
{
|
||||
const string DefaultRequestUri = "/";
|
||||
const string CacheDirName = "Http";
|
||||
const string TableName = "Fusillade_RequestCache";
|
||||
const string DbFileName = "RequestCache.LiteDB";
|
||||
@@ -49,17 +48,7 @@ internal sealed class RequestCacheRepository : IRequestCacheRepository, IDisposa
|
||||
if (!bytes.Any_Nullable())
|
||||
return;
|
||||
|
||||
var requestUri = response.RequestMessage?.RequestUri ?? request.RequestUri;
|
||||
string requestUriString;
|
||||
if (requestUri == null)
|
||||
{
|
||||
requestUriString = DefaultRequestUri;
|
||||
}
|
||||
else
|
||||
{
|
||||
requestUriString = requestUri.ToString();
|
||||
}
|
||||
|
||||
var requestUriString = IRequestCacheRepository.GetOriginalRequestUri(request);
|
||||
var fileTypeResult = FileFormat.AnalyzeFileType(bytes);
|
||||
var hashKey = Hashs.String.SHA384(bytes, false);
|
||||
var fileEx = fileTypeResult.FileEx;
|
||||
@@ -116,6 +105,7 @@ internal sealed class RequestCacheRepository : IRequestCacheRepository, IDisposa
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
return;
|
||||
|
||||
key = UniqueKeyForRequest(requestUriString, request);
|
||||
var entity = table.FindById(key);
|
||||
bool isInsertOrUpdate;
|
||||
if (entity == null)
|
||||
@@ -158,17 +148,8 @@ internal sealed class RequestCacheRepository : IRequestCacheRepository, IDisposa
|
||||
string key,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var requestUri = request.RequestUri;
|
||||
string requestUriString;
|
||||
if (requestUri == null)
|
||||
{
|
||||
requestUriString = DefaultRequestUri;
|
||||
}
|
||||
else
|
||||
{
|
||||
requestUriString = requestUri.ToString();
|
||||
}
|
||||
|
||||
var requestUriString = IRequestCacheRepository.GetOriginalRequestUri(request);
|
||||
key = UniqueKeyForRequest(requestUriString, request);
|
||||
var entity = table.Query().Where(x => x.Id == key &&
|
||||
x.HttpMethod == request.Method.Method &&
|
||||
x.RequestUri == requestUriString).FirstOrDefault();
|
||||
@@ -249,4 +230,49 @@ internal sealed class RequestCacheRepository : IRequestCacheRepository, IDisposa
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
static string UniqueKeyForRequest(string originalRequestUri, HttpRequestMessage request)
|
||||
{
|
||||
// https://github.com/reactiveui/Fusillade/blob/2.4.67/src/Fusillade/RateLimitedHttpMessageHandler.cs#L54-L89
|
||||
|
||||
using var s = new MemoryStream();
|
||||
s.Write(Encoding.UTF8.GetBytes(originalRequestUri));
|
||||
s.Write("\r\n"u8);
|
||||
s.Write(Encoding.UTF8.GetBytes(request.Method.Method));
|
||||
s.Write("\r\n"u8);
|
||||
static void Write(Stream s, IEnumerable<object> items)
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
var str = item.ToString();
|
||||
if (!string.IsNullOrEmpty(str))
|
||||
s.Write(Encoding.UTF8.GetBytes(str));
|
||||
s.Write("|"u8);
|
||||
}
|
||||
}
|
||||
Write(s, request.Headers.Accept);
|
||||
s.Write("\r\n"u8);
|
||||
Write(s, request.Headers.AcceptEncoding);
|
||||
s.Write("\r\n"u8);
|
||||
var referrer = request.Headers.Referrer;
|
||||
if (referrer == default)
|
||||
s.Write("http://example"u8);
|
||||
else
|
||||
s.Write(Encoding.UTF8.GetBytes(referrer.ToString()));
|
||||
s.Write("\r\n"u8);
|
||||
Write(s, request.Headers.UserAgent);
|
||||
s.Write("\r\n"u8);
|
||||
if (request.Headers.Authorization != null)
|
||||
{
|
||||
var parameter = request.Headers.Authorization.Parameter;
|
||||
if (!string.IsNullOrEmpty(parameter))
|
||||
s.Write(Encoding.UTF8.GetBytes(parameter));
|
||||
s.Write(Encoding.UTF8.GetBytes(request.Headers.Authorization.Scheme));
|
||||
s.Write("\r\n"u8);
|
||||
}
|
||||
s.Position = 0;
|
||||
var bytes = SHA384.HashData(s);
|
||||
var str = bytes.ToHexString();
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4847,15 +4847,6 @@ namespace BD.WTTS.Client.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 请选择 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string PleaseSelect {
|
||||
get {
|
||||
return ResourceManager.GetString("PleaseSelect", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 作者:{0} 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -729,9 +729,6 @@
|
||||
<data name="PleaseEnterNickName" xml:space="preserve">
|
||||
<value>请输入昵称</value>
|
||||
</data>
|
||||
<data name="PleaseSelect" xml:space="preserve">
|
||||
<value>请选择</value>
|
||||
</data>
|
||||
<data name="RecoveryCode" xml:space="preserve">
|
||||
<value>恢复代码</value>
|
||||
</data>
|
||||
|
||||
@@ -175,7 +175,9 @@ public sealed partial class IPCMainProcessServiceImpl : IPCMainProcessService
|
||||
psi.ArgumentList.Add(pid.ToString());
|
||||
psi.ArgumentList.Add(mSubProcessArgumentIndex2Model.Value);
|
||||
configure?.Invoke(psi);
|
||||
#if !MACOS
|
||||
DotNetRuntimeHelper.AddEnvironment(psi);
|
||||
#endif
|
||||
var nativeLibraryPath = Startup.NativeLibraryPath;
|
||||
if (!string.IsNullOrWhiteSpace(nativeLibraryPath))
|
||||
{
|
||||
|
||||
@@ -9,8 +9,6 @@ partial interface IPlatformService
|
||||
/// 获取 排除代理地址
|
||||
/// </summary>
|
||||
protected static string[] GetNoProxyHostName => new string[] {
|
||||
"localhost",
|
||||
"127.*",
|
||||
"10.*",
|
||||
"172.16.*",
|
||||
"172.17.*",
|
||||
|
||||
@@ -27,7 +27,9 @@ public sealed class HomePageViewModel : TabItemViewModel
|
||||
|
||||
public HomePageViewModel()
|
||||
{
|
||||
Articles = new ObservableCollection<ArticleItemDTO>();
|
||||
#pragma warning disable CS8625 // 初始化3个null 为解决调试报错中断
|
||||
Articles = new ObservableCollection<ArticleItemDTO>() { null, null, null };
|
||||
#pragma warning restore CS8625 // 无法将 null 字面量转换为非 null 的引用类型。
|
||||
NavigationBanners = new ObservableCollection<AdvertisementDTO>();
|
||||
Shops = new ObservableCollection<ShopRecommendGoodItem>();
|
||||
|
||||
@@ -41,8 +43,7 @@ public sealed class HomePageViewModel : TabItemViewModel
|
||||
var result = await Instance.Article.Order(null, ArticleOrderBy.DateTime);
|
||||
if (result.IsSuccess && result.Content != null)
|
||||
{
|
||||
Articles.Clear();
|
||||
Articles.Add(result.Content.DataSource);
|
||||
Articles = new ObservableCollection<ArticleItemDTO>(result.Content.DataSource);
|
||||
}
|
||||
|
||||
var result2 = await Instance.Shop.RecommendGoods();
|
||||
|
||||
Reference in New Issue
Block a user