mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-27 21:43:14 +08:00
Compare commits
17
Commits
3.0.0-rc.8
..
push
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96a14d69bd | ||
|
|
c79fba98d3 | ||
|
|
4160bb43c5 | ||
|
|
67209f3861 | ||
|
|
110c92d909 | ||
|
|
cdc773ba74 | ||
|
|
8ea8b73aab | ||
|
|
0614e172b8 | ||
|
|
4c73a5b622 | ||
|
|
34341172b8 | ||
|
|
6813ed9ece | ||
|
|
3eb916e78a | ||
|
|
7424d05f54 | ||
|
|
76829b0ca2 | ||
|
|
bbe98f68f6 | ||
|
|
96025c9ef5 | ||
|
|
2fb12f1b7f |
@@ -496,6 +496,15 @@
|
||||
"Summary": "账号平台设置集合",
|
||||
"IsRegionOrEndregion": null,
|
||||
"IsValueType": null
|
||||
},
|
||||
{
|
||||
"TypeName": "bool",
|
||||
"PropertyName": "IsShowAccountName",
|
||||
"DefaultValue": "false",
|
||||
"DefaultValueIsConst": false,
|
||||
"Summary": "是否显示账号用户名",
|
||||
"IsRegionOrEndregion": null,
|
||||
"IsValueType": null
|
||||
}
|
||||
],
|
||||
"Usings": ""
|
||||
@@ -970,6 +979,15 @@
|
||||
"Summary": "自定义 DNS over HTTPS 地址",
|
||||
"IsRegionOrEndregion": null,
|
||||
"IsValueType": null
|
||||
},
|
||||
{
|
||||
"TypeName": "int",
|
||||
"PropertyName": "AcceleratorTabsSelectedIndex",
|
||||
"DefaultValue": "0",
|
||||
"DefaultValueIsConst": false,
|
||||
"Summary": "加速页面 Tab 选项卡选中下标",
|
||||
"IsRegionOrEndregion": null,
|
||||
"IsValueType": null
|
||||
}
|
||||
],
|
||||
"Usings": ""
|
||||
|
||||
+1
-1
Submodule ref/DirectoryPackages updated: ee8197bcbd...b6b85044cc
Submodule ref/SteamAchievementManager updated: 4c578c1cc4...39dbdc9678
+1
-1
Submodule ref/SteamClient updated: 7a7aca2567...fddb907049
@@ -3,6 +3,14 @@ namespace BD.WTTS;
|
||||
/// <summary>
|
||||
/// 提供用来获取应用程序信息(如版本号、说明、加载的程序集等)的属性。
|
||||
/// </summary>
|
||||
[Mobius3(
|
||||
"""
|
||||
Mobius.AssemblyInfo
|
||||
AssemblyInfo.cs
|
||||
AssemblyInfo.Version.cs
|
||||
AssemblyInfo.Version.NativeHost.cs
|
||||
AssemblyInfo.Version.Setup.Windows.cs
|
||||
""")]
|
||||
public static partial class AssemblyInfo
|
||||
{
|
||||
const string Version2 = "3.0";
|
||||
@@ -146,4 +154,20 @@ false
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.All, Inherited = false)]
|
||||
sealed class Mobius3Attribute : Attribute
|
||||
{
|
||||
public Mobius3Attribute()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Mobius3Attribute(string str)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool Obsolete { get; set; }
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// Mobius Properties\XmlnsDefinition.cs
|
||||
#if (WINDOWS || MACCATALYST || MACOS || LINUX) && !(IOS || ANDROID)
|
||||
// C# 10 定义全局 using
|
||||
|
||||
|
||||
+166
-2505
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@
|
||||
<Identity
|
||||
Name="4651ED44255E.47979655102CE"
|
||||
Publisher="CN=A90E406B-B2D3-4A23-B061-0FA1D65C4F66"
|
||||
Version="3.0.207.0" />
|
||||
Version="3.0.999.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>Watt Toolkit</DisplayName>
|
||||
@@ -66,15 +66,6 @@
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Extensions>
|
||||
<desktop2:Extension Category="windows.firewallRules">
|
||||
<desktop2:FirewallRules Executable="Steam++\modules\Accelerator\Steam++.Accelerator.exe">
|
||||
<desktop2:Rule Direction="in" IPProtocol="TCP" Profile="all"/>
|
||||
<desktop2:Rule Direction="in" IPProtocol="UDP" Profile="all"/>
|
||||
</desktop2:FirewallRules>
|
||||
</desktop2:Extension>
|
||||
</Extensions>
|
||||
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
|
||||
@@ -81,8 +81,10 @@
|
||||
<PackageReference Include="Avalonia" />
|
||||
<PackageReference Include="Avalonia.ReactiveUI" />
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" />
|
||||
<PackageReference Include="Avalonia.Controls.ItemsRepeater" />
|
||||
<PackageReference Include="Avalonia.Xaml.Behaviors" />
|
||||
<!--<PackageReference Include="Avalonia.AvaloniaEdit" />-->
|
||||
<PackageReference Include="Avalonia.AvaloniaEdit" />
|
||||
<PackageReference Include="AvaloniaEdit.TextMate" />
|
||||
<!--<PackageReference Include="Markdown.Avalonia" />-->
|
||||
<PackageReference Include="FluentAvaloniaUI" />
|
||||
<PackageReference Include="LiveChartsCore.SkiaSharpView.Avalonia" />
|
||||
|
||||
@@ -7,12 +7,28 @@ namespace BD.WTTS.UI;
|
||||
|
||||
partial class App
|
||||
{
|
||||
[Mobius(
|
||||
"""
|
||||
App.DefaultActualTheme
|
||||
""")]
|
||||
const AppTheme _DefaultActualTheme = AppTheme.FollowingSystem;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.DefaultActualTheme
|
||||
""")]
|
||||
AppTheme IApplication.DefaultActualTheme => _DefaultActualTheme;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.mTheme
|
||||
""")]
|
||||
AppTheme mTheme = _DefaultActualTheme;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.Theme
|
||||
""")]
|
||||
public AppTheme Theme
|
||||
{
|
||||
get => mTheme;
|
||||
@@ -50,6 +66,10 @@ partial class App
|
||||
}
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.SetThemeNotChangeValue
|
||||
""")]
|
||||
public void SetThemeNotChangeValue(AppTheme value)
|
||||
{
|
||||
var mode = value switch
|
||||
@@ -71,6 +91,10 @@ partial class App
|
||||
}
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.SetThemeAccent
|
||||
""")]
|
||||
public static void SetThemeAccent(string? colorHex)
|
||||
{
|
||||
if (colorHex == null)
|
||||
|
||||
@@ -9,14 +9,34 @@ namespace BD.WTTS.UI;
|
||||
|
||||
partial class App
|
||||
{
|
||||
[Mobius(
|
||||
"""
|
||||
App.TrayMenus
|
||||
""")]
|
||||
public Dictionary<string, TrayMenuItem> TrayMenus { get; } = new Dictionary<string, TrayMenuItem>();
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.TrayIcons
|
||||
""")]
|
||||
public TrayIcons TrayIcons { get; init; } = new TrayIcons();
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.trayIconMenus
|
||||
""")]
|
||||
readonly Dictionary<string, ICommand> trayIconMenus = new();
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.TrayIconMenus
|
||||
""")]
|
||||
public IReadOnlyDictionary<string, ICommand> TrayIconMenus => trayIconMenus;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.InitTrayIcon
|
||||
""")]
|
||||
void InitTrayIcon()
|
||||
{
|
||||
if (ApplicationLifetime is not
|
||||
@@ -67,6 +87,10 @@ partial class App
|
||||
}
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.UpdateMenuItems
|
||||
""")]
|
||||
public void UpdateMenuItems()
|
||||
{
|
||||
MainThread2.BeginInvokeOnMainThread(() =>
|
||||
@@ -166,6 +190,10 @@ partial class App
|
||||
});
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.UpdateMenuItems
|
||||
""")]
|
||||
public void UpdateMenuItems(string menuKey, TrayMenuItem trayMenuItem)
|
||||
{
|
||||
if (TrayMenus != null)
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<ui:FABorder
|
||||
<Border
|
||||
Name="Root"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
@@ -101,19 +101,19 @@
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
RecognizesAccessKey="True" />
|
||||
</ui:FABorder>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
@@ -122,7 +122,7 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorDisabledBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
@@ -131,7 +131,7 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:checked">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundChecked}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
@@ -140,7 +140,7 @@
|
||||
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundCheckedPointerOver}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
@@ -149,7 +149,7 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundCheckedPressed}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
@@ -158,7 +158,7 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorDisabledBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
@@ -168,19 +168,19 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:indeterminate">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTransparentBrush}" />
|
||||
</Style>
|
||||
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
@@ -189,7 +189,7 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorDisabledBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
@@ -214,7 +214,7 @@
|
||||
<Style Selector="Button.Plain:pointerover">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="Button.Plain:pointerover /template/ ui|FABorder#Root">
|
||||
<Style Selector="Button.Plain:pointerover /template/ Border#Root">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="Button.Plain:pointerover /template/ ContentPresenter">
|
||||
|
||||
@@ -63,14 +63,13 @@
|
||||
Height="10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Bottom">
|
||||
<ItemsRepeater Name="Swiper" IsVisible="False">
|
||||
<ItemsRepeater.Layout>
|
||||
<StackLayout
|
||||
DisableVirtualization="True"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8" />
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<ItemsControl Name="Swiper" IsVisible="False">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DataTemplate.DataType>
|
||||
<x:Type x:TypeArguments="x:Int32, x:String" TypeName="generic:KeyValuePair" />
|
||||
@@ -91,8 +90,8 @@
|
||||
StrokeThickness="0" />
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Panel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@@ -46,19 +46,19 @@
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<StackPanel>
|
||||
<ui:FABorder
|
||||
<Border
|
||||
Name="LayoutRoot"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ui:FABorder.Transitions>
|
||||
<Border.Transitions>
|
||||
<Transitions>
|
||||
<BrushTransition Property="Background" Duration="00:00:00.083" />
|
||||
<BrushTransition Property="BorderBrush" Duration="00:00:00.083" />
|
||||
</Transitions>
|
||||
</ui:FABorder.Transitions>
|
||||
</Border.Transitions>
|
||||
<Grid MinHeight="{TemplateBinding MinHeight}" ColumnDefinitions="Auto,*,Auto,Auto">
|
||||
<Viewbox
|
||||
Name="IconHost"
|
||||
@@ -113,7 +113,7 @@
|
||||
VerticalAlignment="Center"
|
||||
FontSize="18" />
|
||||
</Grid>
|
||||
</ui:FABorder>
|
||||
</Border>
|
||||
|
||||
<ContentPresenter
|
||||
Name="ExpandedContentPresenter"
|
||||
@@ -144,10 +144,10 @@
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="spp|OptionsDisplayItem /template/ ui|FABorder#LayoutRoot:pointerover">
|
||||
<Style Selector="spp|OptionsDisplayItem /template/ Border#LayoutRoot:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
|
||||
</Style>
|
||||
<Style Selector="spp|OptionsDisplayItem:pressed /template/ ui|FABorder#LayoutRoot:pointerover">
|
||||
<Style Selector="spp|OptionsDisplayItem:pressed /template/ Border#LayoutRoot:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlFillColorTertiaryBrush}" />
|
||||
</Style>
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
<Setter Property="CornerRadius" Value="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomCornerRadiusFilterConverter}}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="spp|OptionsDisplayItem:expanded /template/ ui|FABorder#LayoutRoot">
|
||||
<Style Selector="spp|OptionsDisplayItem:expanded /template/ Border#LayoutRoot">
|
||||
<Setter Property="CornerRadius" Value="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopCornerRadiusFilterConverter}}" />
|
||||
</Style>
|
||||
|
||||
@@ -195,19 +195,19 @@
|
||||
<Style Selector="spp|OptionsDisplayItem.Vertical">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<ui:FABorder
|
||||
<Border
|
||||
Name="LayoutRoot"
|
||||
Padding="12"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ui:FABorder.Transitions>
|
||||
<Border.Transitions>
|
||||
<Transitions>
|
||||
<BrushTransition Property="Background" Duration="00:00:00.083" />
|
||||
<BrushTransition Property="BorderBrush" Duration="00:00:00.083" />
|
||||
</Transitions>
|
||||
</ui:FABorder.Transitions>
|
||||
</Border.Transitions>
|
||||
<Grid RowDefinitions="*,*">
|
||||
<Border
|
||||
Width="72"
|
||||
@@ -241,7 +241,7 @@
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ui:FABorder>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
@@ -38,18 +38,18 @@
|
||||
<Setter Property="MinHeight" Value="{DynamicResource SettingsExpanderItemMinHeight}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<ui:FABorder
|
||||
<Border
|
||||
Name="Root"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<ui:FABorder.Transitions>
|
||||
<Border.Transitions>
|
||||
<Transitions>
|
||||
<BrushTransition Property="Background" Duration="00:00:00.083" />
|
||||
<BrushTransition Property="BorderBrush" Duration="00:00:00.083" />
|
||||
</Transitions>
|
||||
</ui:FABorder.Transitions>
|
||||
</Border.Transitions>
|
||||
|
||||
<Grid ColumnDefinitions="*,Auto,Auto" RowDefinitions="*,Auto">
|
||||
<Viewbox
|
||||
@@ -102,7 +102,7 @@
|
||||
<ContentPresenter Name="ExpandChevronActionIconContainer" Content="{Binding TemplateSettings.ActionIcon, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
</ui:FABorder>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:nth-last-child(1) /template/ ui|FABorder#Root">
|
||||
<Style Selector="^:nth-last-child(1) /template/ Border#Root">
|
||||
<Setter Property="CornerRadius" Value="{Binding Source={StaticResource ControlCornerRadius}, Converter={StaticResource BottomCornerRadiusFilterConverter}}" />
|
||||
</Style>
|
||||
|
||||
@@ -152,11 +152,11 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:allowClick">
|
||||
<Style Selector="^:pointerover /template/ ui|FABorder#Root">
|
||||
<Style Selector="^:pointerover /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ ui|FABorder#Root">
|
||||
<Style Selector="^:pressed /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlFillColorTertiaryBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
@@ -164,7 +164,7 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlFillColorDisabledBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<LayoutTransformControl Name="PART_LayoutTransformControl" UseRenderTransform="True">
|
||||
<ui:FABorder
|
||||
<Border
|
||||
Name="ContentRoot"
|
||||
VerticalAlignment="Top"
|
||||
BorderBrush="{DynamicResource InfoBarBorderBrush}"
|
||||
@@ -205,13 +205,13 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
</Panel>
|
||||
</ui:FABorder>
|
||||
</Border>
|
||||
</LayoutTransformControl>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:informational">
|
||||
<Style Selector="^ /template/ ui|FABorder#ContentRoot">
|
||||
<Style Selector="^ /template/ Border#ContentRoot">
|
||||
<!--<Setter Property="Background" Value="{DynamicResource InfoBarInformationalSeverityBackgroundBrush}" />-->
|
||||
<Setter Property="Background" Value="{DynamicResource SolidBackgroundFillColorBaseBrush}" />
|
||||
</Style>
|
||||
@@ -226,7 +226,7 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:error">
|
||||
<Style Selector="^ /template/ ui|FABorder#ContentRoot">
|
||||
<Style Selector="^ /template/ Border#ContentRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource InfoBarErrorSeverityBackgroundBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Ellipse#IconBackground">
|
||||
@@ -241,7 +241,7 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:warning">
|
||||
<Style Selector="^ /template/ ui|FABorder#ContentRoot">
|
||||
<Style Selector="^ /template/ Border#ContentRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource InfoBarWarningSeverityBackgroundBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Ellipse#IconBackground">
|
||||
@@ -255,7 +255,7 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:success">
|
||||
<Style Selector="^ /template/ ui|FABorder#ContentRoot">
|
||||
<Style Selector="^ /template/ Border#ContentRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource InfoBarSuccessSeverityBackgroundBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Ellipse#IconBackground">
|
||||
@@ -294,7 +294,7 @@
|
||||
</Style>
|
||||
|
||||
<!-- Visible -->
|
||||
<Style Selector="^:hidden /template/ ui|FABorder#ContentRoot">
|
||||
<Style Selector="^:hidden /template/ Border#ContentRoot">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<ui:FABorder
|
||||
<Border
|
||||
Name="Root"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
@@ -83,19 +83,19 @@
|
||||
BorderThickness="1"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
TemplatedControl.IsTemplateFocusTarget="True">
|
||||
<ui:FABorder.Transitions>
|
||||
<Border.Transitions>
|
||||
<Transitions>
|
||||
<BrushTransition Property="Background" Duration="00:00:00.083" />
|
||||
</Transitions>
|
||||
</ui:FABorder.Transitions>
|
||||
</Border.Transitions>
|
||||
|
||||
<Panel>
|
||||
<ui:FABorder
|
||||
<Border
|
||||
Name="Hover"
|
||||
Margin="3"
|
||||
Background="Transparent"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ui:FABorder.Transitions>
|
||||
<Border.Transitions>
|
||||
<Transitions>
|
||||
<BrushTransition Property="Background" Duration="00:00:00.083" />
|
||||
<TransformOperationsTransition
|
||||
@@ -103,8 +103,8 @@
|
||||
Property="RenderTransform"
|
||||
Duration="00:00:00.167" />
|
||||
</Transitions>
|
||||
</ui:FABorder.Transitions>
|
||||
</ui:FABorder>
|
||||
</Border.Transitions>
|
||||
</Border>
|
||||
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
@@ -139,19 +139,19 @@
|
||||
</Rectangle>
|
||||
|
||||
</Panel>
|
||||
</ui:FABorder>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ ui|FABorder#Hover">
|
||||
<Style Selector="^ /template/ Border#Hover">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Style Selector="^ /template/ ui|FABorder#Hover">
|
||||
<Style Selector="^ /template/ Border#Hover">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
|
||||
<Setter Property="RenderTransform" Value="scale(0.96)" />
|
||||
</Style>
|
||||
@@ -161,10 +161,10 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:selected">
|
||||
<Style Selector="^ /template/ ui|FABorder#Hover">
|
||||
<Style Selector="^ /template/ Border#Hover">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
|
||||
</Style>
|
||||
@@ -181,10 +181,10 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ ui|FABorder#Hover">
|
||||
<Style Selector="^ /template/ Border#Hover">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ui|FABorder#Root">
|
||||
<Style Selector="^ /template/ Border#Root">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlFillColorDisabledBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ControlAltFillColorSecondaryBrush}" />
|
||||
</Style>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Panel Name="LayoutRoot" Background="{x:Null}">
|
||||
<ui:FABorder
|
||||
<Border
|
||||
Name="ContentRoot"
|
||||
MinWidth="{DynamicResource TaskDialogMinWidth}"
|
||||
MinHeight="{DynamicResource TaskDialogMinHeight}"
|
||||
@@ -216,7 +216,7 @@
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ui:FABorder>
|
||||
</Border>
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
@@ -303,7 +303,7 @@
|
||||
<Style Selector="^ /template/ Panel#LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TaskDialogSmokeFill}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ui|FABorder#ContentRoot">
|
||||
<Style Selector="^ /template/ Border#ContentRoot">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TaskDialogBorderBrush}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource TaskDialogBorderWidth}" />
|
||||
@@ -332,7 +332,7 @@
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<Style Selector="^:hidden /template/ ui|FABorder#ContentRoot">
|
||||
<Style Selector="^:hidden /template/ Border#ContentRoot">
|
||||
<Style.Animations>
|
||||
<Animation FillMode="Forward" Duration="00:00:00.167">
|
||||
<KeyFrame Cue="0%">
|
||||
@@ -368,7 +368,7 @@
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<Style Selector="^:open /template/ ui|FABorder#ContentRoot">
|
||||
<Style Selector="^:open /template/ Border#ContentRoot">
|
||||
<Style.Animations>
|
||||
<Animation FillMode="Forward" Duration="00:00:00.250">
|
||||
<KeyFrame Cue="0%">
|
||||
@@ -389,7 +389,7 @@
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Panel Name="LayoutRoot" Background="{x:Null}">
|
||||
<ui:FABorder
|
||||
<Border
|
||||
Name="ContentRoot"
|
||||
MinWidth="{DynamicResource TaskDialogMinWidth}"
|
||||
MinHeight="{DynamicResource TaskDialogMinHeight}"
|
||||
@@ -521,7 +521,7 @@
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ui:FABorder>
|
||||
</Border>
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
@@ -14,4 +14,5 @@
|
||||
</Styles.Resources>
|
||||
|
||||
<StyleInclude Source="/UI/Styling/Controls.axaml" />
|
||||
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml" />
|
||||
</Styles>
|
||||
|
||||
@@ -126,7 +126,7 @@ public class OptionsDisplayItem : TemplatedControl
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
|
||||
_layoutRoot = e.NameScope.Find<FABorder>("LayoutRoot");
|
||||
_layoutRoot = e.NameScope.Find<Border>("LayoutRoot");
|
||||
if (_layoutRoot != null)
|
||||
{
|
||||
_layoutRoot.PointerPressed += OnLayoutRootPointerPressed;
|
||||
@@ -172,5 +172,5 @@ public class OptionsDisplayItem : TemplatedControl
|
||||
|
||||
private bool _isPressed;
|
||||
private bool _isExpanded;
|
||||
private FABorder? _layoutRoot;
|
||||
private Border? _layoutRoot;
|
||||
}
|
||||
|
||||
@@ -62,14 +62,13 @@
|
||||
Margin="0,0,0,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Bottom">
|
||||
<ItemsRepeater Name="Swiper" IsVisible="False">
|
||||
<ItemsRepeater.Layout>
|
||||
<StackLayout
|
||||
DisableVirtualization="True"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8" />
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<ItemsControl Name="Swiper" IsVisible="False">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DataTemplate.DataType>
|
||||
<x:Type x:TypeArguments="x:Int32, x:String" TypeName="generic:KeyValuePair" />
|
||||
@@ -110,8 +109,8 @@
|
||||
</i:Interaction.Behaviors>-->
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Panel>
|
||||
</Panel>
|
||||
</Border>
|
||||
|
||||
@@ -55,7 +55,7 @@ public class CarouselItems : ItemsControl
|
||||
Carousel? _carouselControl;
|
||||
Button? _leftButton;
|
||||
Button? _rightButton;
|
||||
ItemsRepeater? _swiper;
|
||||
ItemsControl? _swiper;
|
||||
Timer? _timer;
|
||||
|
||||
public ICommand? CarouselBannerIndexCommand { get; }
|
||||
@@ -72,7 +72,7 @@ public class CarouselItems : ItemsControl
|
||||
_carouselControl = e.NameScope.Find<Carousel>("CarouselControl");
|
||||
_leftButton = e.NameScope.Find<Button>("Left");
|
||||
_rightButton = e.NameScope.Find<Button>("Right");
|
||||
_swiper = e.NameScope.Find<ItemsRepeater>("Swiper");
|
||||
_swiper = e.NameScope.Find<Avalonia.Controls.ItemsControl>("Swiper");
|
||||
|
||||
if (_leftButton != null)
|
||||
{
|
||||
|
||||
@@ -139,20 +139,24 @@
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="{Binding Path=Res.Link, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
<ItemsRepeater Margin="0,0,6,6" ItemsSource="{Binding Hyperlinks, Mode=OneTime}">
|
||||
<ItemsRepeater.Layout>
|
||||
<UniformGridLayout MinItemWidth="166" />
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<ItemsControl Margin="0,0,6,6" ItemsSource="{Binding Hyperlinks, Mode=OneTime}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="spp:HyperlinkModel">
|
||||
<Button
|
||||
Command="{Binding Command, Mode=OneWay}"
|
||||
Content="{Binding Text, Mode=OneWay}"
|
||||
Cursor="Hand"
|
||||
Theme="{StaticResource HyperlinkButton}" />
|
||||
<Border MinWidth="166">
|
||||
<Button
|
||||
Command="{Binding Command, Mode=OneWay}"
|
||||
Content="{Binding Text, Mode=OneWay}"
|
||||
Cursor="Hand"
|
||||
Theme="{StaticResource HyperlinkButton}" />
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<Border
|
||||
Height="1"
|
||||
Margin="-50,0"
|
||||
@@ -162,20 +166,24 @@
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="{Binding Path=Res.OpenSourceLibrary, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
<ItemsRepeater Margin="0,0,6,6" ItemsSource="{Binding OSL, Mode=OneTime}">
|
||||
<ItemsRepeater.Layout>
|
||||
<UniformGridLayout MinItemWidth="290" />
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<ItemsControl Margin="0,0,6,6" ItemsSource="{Binding OSL, Mode=OneTime}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="spp:HyperlinkModel">
|
||||
<Button
|
||||
Command="{Binding Command, Mode=OneWay}"
|
||||
Content="{Binding Text, Mode=OneWay}"
|
||||
Cursor="Hand"
|
||||
Theme="{StaticResource HyperlinkButton}" />
|
||||
<Border MinWidth="290">
|
||||
<Button
|
||||
Command="{Binding Command, Mode=OneWay}"
|
||||
Content="{Binding Text, Mode=OneWay}"
|
||||
Cursor="Hand"
|
||||
Theme="{StaticResource HyperlinkButton}" />
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</spp:OptionsDisplayItem.Content>
|
||||
</spp:OptionsDisplayItem>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="spp:DebugPageViewModel"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<spp:DebugPageViewModel />
|
||||
@@ -176,7 +177,7 @@
|
||||
CornerRadius="2"
|
||||
IsActive="{Binding #active.IsChecked}"
|
||||
IsLoading="{Binding #loading.IsChecked}">
|
||||
<SelectableTextBlock Margin="0,2" Text="是先有鸡还是先有蛋" />
|
||||
<SelectableTextBlock Margin="0,2" Text="不忘初心,方得始终" />
|
||||
</spp:Skeleton>
|
||||
<spp:Skeleton
|
||||
Margin="0,0,100,0"
|
||||
@@ -184,14 +185,14 @@
|
||||
CornerRadius="2"
|
||||
IsActive="{Binding #active.IsChecked}"
|
||||
IsLoading="{Binding #loading.IsChecked}">
|
||||
<SelectableTextBlock Margin="0,2" Text="什么是工匠精神" />
|
||||
<SelectableTextBlock Margin="0,2" Text="---" />
|
||||
</spp:Skeleton>
|
||||
<spp:Skeleton
|
||||
VerticalAlignment="Bottom"
|
||||
CornerRadius="2"
|
||||
IsActive="{Binding #active.IsChecked}"
|
||||
IsLoading="{Binding #loading.IsChecked}">
|
||||
<SelectableTextBlock Margin="0,2" Text="看山不是山,看水不是水,看山还是山,看水还是水" />
|
||||
<SelectableTextBlock Margin="0,2" Text="路漫漫其修远兮,吾将上下而求索。" />
|
||||
</spp:Skeleton>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace BD;
|
||||
|
||||
[AttributeUsage(AttributeTargets.All, Inherited = false)]
|
||||
public sealed class MobiusAttribute : Attribute
|
||||
{
|
||||
public MobiusAttribute()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MobiusAttribute(string str)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool Obsolete { get; set; }
|
||||
}
|
||||
@@ -6,6 +6,7 @@ namespace BD.WTTS.Services;
|
||||
/// <summary>
|
||||
/// 子进程的 IPC 服务实现
|
||||
/// </summary>
|
||||
[Mobius(Obsolete = true)]
|
||||
public interface IPCSubProcessService : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ public static class KestrelServerOptionsExtensions
|
||||
var httpsPort = IReverseProxyConfig.HttpsPort;
|
||||
options.Listen(IReverseProxyService.Constants.Instance.ProxyIp, httpsPort, listen =>
|
||||
{
|
||||
listen.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
|
||||
listen.Protocols = HttpProtocols.Http1AndHttp2;
|
||||
listen.UseFlowAnalyze();
|
||||
listen.UseTls();
|
||||
});
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace BD;
|
||||
|
||||
[AttributeUsage(AttributeTargets.All, Inherited = false)]
|
||||
public sealed class MobiusAttribute : Attribute
|
||||
{
|
||||
public MobiusAttribute()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MobiusAttribute(string str)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool Obsolete { get; set; }
|
||||
}
|
||||
+15
-1
@@ -155,7 +155,21 @@ public static class CertGenerator
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AddDnsName(name);
|
||||
try
|
||||
{
|
||||
builder.AddDnsName(name);
|
||||
}
|
||||
catch
|
||||
{
|
||||
/* name = Environment.MachineName
|
||||
* System.ArgumentException: Decoded string is not a valid IDN name. (Parameter 'unicode')
|
||||
* at System.Globalization.IdnMapping.IcuGetAsciiCore(String unicodeString, Char* unicode, Int32 count)
|
||||
* at System.Globalization.IdnMapping.GetAscii(String unicode, Int32 index, Int32 count)
|
||||
* at System.Security.Cryptography.X509Certificates.SubjectAlternativeNameBuilder.AddDnsName(String dnsName)
|
||||
* at BD.WTTS.Services.Implementation.CertGenerator.Add(SubjectAlternativeNameBuilder builder, String name)
|
||||
* at BD.WTTS.Services.Implementation.CertGenerator.CreateEndCertificate(X509Certificate2 issuerCertificate, X500DistinguishedName subjectName, IEnumerable`1 extraDnsNames, Nullable`1 notBefore, Nullable`1 notAfter, Int32 rsaKeySizeInBits)
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -503,7 +503,8 @@ public sealed partial class GameAcceleratorService
|
||||
if (GameAcceleratorSettings.MyGames.Any_Nullable())
|
||||
{
|
||||
Games.Clear();
|
||||
foreach (var item in GameAcceleratorSettings.MyGames.Value!.Values)
|
||||
var temp = GameAcceleratorSettings.MyGames.Value!.Values.ToArray();
|
||||
foreach (var item in temp)
|
||||
{
|
||||
if (item.PicInfo == null)
|
||||
item.PicInfo = XunYouSDK.GetPicInfo(item.Id);
|
||||
@@ -517,7 +518,8 @@ public sealed partial class GameAcceleratorService
|
||||
{
|
||||
Games.Clear();
|
||||
GameAcceleratorSettings.MyGames.AddRange(games.Select(s => new KeyValuePair<int, XunYouGameViewModel>(s.Id, new XunYouGameViewModel(s))));
|
||||
foreach (var item in GameAcceleratorSettings.MyGames.Value!.Values)
|
||||
var temp = GameAcceleratorSettings.MyGames.Value!.Values.ToArray();
|
||||
foreach (var item in temp)
|
||||
{
|
||||
if (item.PicInfo == null)
|
||||
item.PicInfo = XunYouSDK.GetPicInfo(item.Id);
|
||||
|
||||
@@ -155,6 +155,11 @@ public partial interface IProxySettings
|
||||
/// </summary>
|
||||
string? CustomDohAddres { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 加速页面 Tab 选项卡选中下标
|
||||
/// </summary>
|
||||
int AcceleratorTabsSelectedIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启用脚本自动检查更新的默认值
|
||||
/// </summary>
|
||||
@@ -270,4 +275,9 @@ public partial interface IProxySettings
|
||||
/// </summary>
|
||||
const string? DefaultCustomDohAddres = null;
|
||||
|
||||
/// <summary>
|
||||
/// 加速页面 Tab 选项卡选中下标的默认值
|
||||
/// </summary>
|
||||
static readonly int DefaultAcceleratorTabsSelectedIndex = 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public sealed partial class ProxySettings_ : IProxySettings, ISettings, ISetting
|
||||
/// 加速页面 Tab 选项卡选中下标
|
||||
/// </summary>
|
||||
[MPKey(23), MP2Key(23), JsonPropertyOrder(23)]
|
||||
public int AcceleratorTabsSelectedIndex { get; set; }
|
||||
public int AcceleratorTabsSelectedIndex { get; set; } = IProxySettings.DefaultAcceleratorTabsSelectedIndex;
|
||||
|
||||
}
|
||||
|
||||
@@ -369,5 +369,6 @@ public static partial class ProxySettings
|
||||
/// 加速页面 Tab 选项卡选中下标
|
||||
/// </summary>
|
||||
public static SettingsStructProperty<int, ProxySettings_> AcceleratorTabsSelectedIndex { get; }
|
||||
= new();
|
||||
= new(DefaultAcceleratorTabsSelectedIndex);
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -28,7 +28,6 @@ public sealed partial class ArchiSteamFarmPlusPageViewModel : ViewModelBase
|
||||
var model = new ArchiSteamFarmExePathSettingsPageViewModel();
|
||||
await IWindowManager.Instance.ShowTaskDialogAsync(model,
|
||||
title: BDStrings.ASF_Settings,
|
||||
subHeader: BDStrings.ASF_SetExePathFirst,
|
||||
pageContent: new ArchiSteamFarmExePathSettingsPage(),
|
||||
isCancelButton: true,
|
||||
cancelCloseAction: () =>
|
||||
|
||||
+10
-47
@@ -2,6 +2,7 @@
|
||||
x:Class="BD.WTTS.UI.Views.Controls.ConsoleShell"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:AvaloniaEdit="using:AvaloniaEdit"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ms="https://steampp.net/settings"
|
||||
@@ -13,7 +14,7 @@
|
||||
FontFamily="{StaticResource UnicodeFont}"
|
||||
FontSize="16"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Styles>
|
||||
<!--<UserControl.Styles>
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="FontSize" Value="{ReflectionBinding #u.FontSize}" />
|
||||
<Setter Property="FontFamily" Value="{ReflectionBinding #u.FontFamily}" />
|
||||
@@ -27,35 +28,15 @@
|
||||
<Style Selector="TextBox /template/ TextBlock#PART_BorderElement">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
</UserControl.Styles>-->
|
||||
<Border Background="{DynamicResource CardBackgroundFillColorDefaultBrush}" CornerRadius="{DynamicResource ControlCornerRadius}">
|
||||
<Grid RowDefinitions="*,Auto">
|
||||
<ScrollViewer
|
||||
x:Name="ConsoleScroll"
|
||||
Grid.Row="0"
|
||||
<AvaloniaEdit:TextEditor
|
||||
x:Name="LogTextbox"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
IsScrollChainingEnabled="True"
|
||||
VerticalScrollBarVisibility="Visible">
|
||||
<TextBox
|
||||
x:Name="LogTextbox"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Classes="readonlybox"
|
||||
Focusable="False"
|
||||
IsReadOnly="True"
|
||||
IsVisible="False"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||
Text="{ReflectionBinding #u.LogText}"
|
||||
TextWrapping="Wrap" />
|
||||
</ScrollViewer>
|
||||
IsReadOnly="True"
|
||||
ShowLineNumbers="True" />
|
||||
<DockPanel Grid.Row="1">
|
||||
<TextBlock
|
||||
x:Name="InputIndicatorTextBlock"
|
||||
Margin="10,0,10,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{ReflectionBinding #u.FontFamily}" />
|
||||
<AutoCompleteBox
|
||||
x:Name="CommandTextbox"
|
||||
FilterMode="StartsWithOrdinal"
|
||||
@@ -67,20 +48,12 @@
|
||||
ValueMemberBinding="{ReflectionBinding Command}">
|
||||
<AutoCompleteBox.Styles>
|
||||
<Style Selector="AutoCompleteBox">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Watermark" Value="请输入命令或消息内容" />
|
||||
<Setter Property="Watermark" Value="输入指令或消息内容" />
|
||||
</Style>
|
||||
<Style Selector="AutoCompleteBox /template/ TextBox#PART_TextBox">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="AcceptsReturn" Value="False" />
|
||||
<Setter Property="IsReadOnly" Value="False" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="TextWrapping" Value="WrapWithOverflow" />
|
||||
@@ -88,29 +61,19 @@
|
||||
<Style Selector="AutoCompleteBox:password /template/ TextBox#PART_TextBox">
|
||||
<Setter Property="PasswordChar" Value="{StaticResource PasswordChar}" />
|
||||
</Style>
|
||||
<Style Selector="AutoCompleteBox /template/ TextBox#PART_TextBox:pointerover /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
</Style>
|
||||
<Style Selector="AutoCompleteBox /template/ TextBox#PART_TextBox:focus /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="AutoCompleteBox /template/ Popup#PART_Popup">
|
||||
<Setter Property="MaxWidth" Value="{ReflectionBinding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Style>
|
||||
</AutoCompleteBox.Styles>
|
||||
</AutoCompleteBox>
|
||||
<ui:FontIcon
|
||||
<!--<ui:FontIcon
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
FontSize="18"
|
||||
Glyph=""
|
||||
ToolTip.Tip="回车键发送" />
|
||||
ToolTip.Tip="回车键发送" />-->
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
|
||||
+32
-15
@@ -5,6 +5,10 @@ using Avalonia.Controls.Templates;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Styling;
|
||||
using AvaloniaEdit;
|
||||
using AvaloniaEdit.TextMate;
|
||||
using TextMateSharp.Grammars;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
@@ -122,10 +126,10 @@ public partial class ConsoleShell : UserControl
|
||||
/// </summary>
|
||||
public event EventHandler<CommandEventArgs>? CommandSubmit;
|
||||
|
||||
private readonly TextBlock inputIndicatorTextBlock;
|
||||
//private readonly TextBlock inputIndicatorTextBlock;
|
||||
private readonly AutoCompleteBox commandTextbox;
|
||||
private readonly TextBox logTextbox;
|
||||
private readonly ScrollViewer consoleScroll;
|
||||
private readonly TextEditor logTextbox;
|
||||
//private readonly ScrollViewer consoleScroll;
|
||||
private readonly ArchiSteamFarmCommandHistory commandHistory;
|
||||
|
||||
/// <summary>
|
||||
@@ -136,9 +140,9 @@ public partial class ConsoleShell : UserControl
|
||||
InitializeComponent();
|
||||
|
||||
commandHistory = new();
|
||||
inputIndicatorTextBlock = this.FindControl<TextBlock>("InputIndicatorTextBlock")!;
|
||||
logTextbox = this.FindControl<TextBox>("LogTextbox")!;
|
||||
consoleScroll = this.FindControl<ScrollViewer>("ConsoleScroll")!;
|
||||
//inputIndicatorTextBlock = this.FindControl<TextBlock>("InputIndicatorTextBlock")!;
|
||||
logTextbox = this.FindControl<TextEditor>("LogTextbox")!;
|
||||
//consoleScroll = this.FindControl<ScrollViewer>("ConsoleScroll")!;
|
||||
commandTextbox = this.FindControl<AutoCompleteBox>("CommandTextbox")!;
|
||||
commandTextbox.KeyUp += CommandTextbox_KeyUp;
|
||||
|
||||
@@ -159,12 +163,22 @@ public partial class ConsoleShell : UserControl
|
||||
}
|
||||
});
|
||||
|
||||
this.GetObservable(InputIndicatorProperty)
|
||||
.Subscribe(x => inputIndicatorTextBlock.Text = $"{InputIndicator}{InputIndicatorSuffix}");
|
||||
//this.GetObservable(InputIndicatorProperty)
|
||||
// .Subscribe(x => inputIndicatorTextBlock.Text = $"{InputIndicator}{InputIndicatorSuffix}");
|
||||
|
||||
this.GetObservable(IsMaskProperty)
|
||||
.Subscribe(x => ((IPseudoClasses)commandTextbox.Classes).Set(":password", x));
|
||||
|
||||
//Here we initialize RegistryOptions with the theme we want to use.
|
||||
var registryOptions = new TextMateSharp.Grammars.RegistryOptions(ThemeName.Dark);
|
||||
|
||||
//Initial setup of TextMate.
|
||||
var textMateInstallation = logTextbox.InstallTextMate(registryOptions);
|
||||
|
||||
//Here we are getting the language by the extension and right after that we are initializing grammar with this language.
|
||||
//And that's all 😀, you are ready to use AvaloniaEdit with syntax highlighting!
|
||||
textMateInstallation.SetGrammar(registryOptions.GetScopeByLanguageId(registryOptions.GetLanguageByExtension(".log").Id));
|
||||
|
||||
this.GetObservable(LogTextProperty)
|
||||
.Subscribe(x =>
|
||||
{
|
||||
@@ -172,19 +186,22 @@ public partial class ConsoleShell : UserControl
|
||||
{
|
||||
logTextbox.IsVisible = true;
|
||||
}
|
||||
|
||||
//logTextbox.Text = x;
|
||||
|
||||
if (logTextbox.Width > 0)
|
||||
logTextbox.MaxLength = (int)(logTextbox.Width / (logTextbox.FontSize + logTextbox.LetterSpacing)) * logTextbox.MaxLines;
|
||||
|
||||
//if (logTextbox.Width > 0)
|
||||
// logTextbox.MaxLength = (int)(logTextbox.Width / (logTextbox.FontSize + logTextbox.LetterSpacing)) * logTextbox.MaxLines;
|
||||
logTextbox.Text = LogText;
|
||||
commandTextbox.Focus();
|
||||
consoleScroll.ScrollToEnd();
|
||||
logTextbox.ScrollToLine(logTextbox.Document.LineCount);
|
||||
//logTextbox.ScrollToLine();
|
||||
//consoleScroll.ScrollToEnd();
|
||||
});
|
||||
|
||||
this.GetObservable(MaxLineProperty)
|
||||
.Subscribe(x => logTextbox.MaxHeight = (logTextbox.LineHeight = logTextbox.FontSize) * (logTextbox.MaxLines = x));
|
||||
//this.GetObservable(MaxLineProperty)
|
||||
// .Subscribe(x => logTextbox.MaxHeight = (logTextbox.LineHeight = logTextbox.FontSize) * (logTextbox.MaxLines = x));
|
||||
|
||||
this.GetObservable(FontSizeProperty).Subscribe(x => logTextbox.MaxHeight = (logTextbox.LineHeight = logTextbox.FontSize = x) * logTextbox.MaxLines);
|
||||
//this.GetObservable(FontSizeProperty).Subscribe(x => logTextbox.MaxHeight = (logTextbox.LineHeight = logTextbox.FontSize = x) * logTextbox.MaxLines);
|
||||
}
|
||||
|
||||
private void CommandTextbox_KeyUp(object? sender, Avalonia.Input.KeyEventArgs e)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
Margin="28,4,0,4"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="Json文件导入" />
|
||||
Text="导入配置" />
|
||||
</Panel>
|
||||
</Button>
|
||||
<Button
|
||||
@@ -130,6 +130,77 @@
|
||||
IsClickEnabled="True"
|
||||
ToolTip.Tip="{Binding Path=., Mode=OneWay, Source={x:Static spp:Strings.Settings_General_BrowseCustomFolder}, Converter={StaticResource StringFormatConverter}, ConverterParameter=www}" />
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<!--<spp:OptionsDisplayItem Header="ASF 文件路径">
|
||||
<spp:OptionsDisplayItem.Description>
|
||||
<TextBlock
|
||||
MaxWidth="120"
|
||||
MaxLines="1"
|
||||
Text="{Binding Source={x:Static ms:ASFSettings.ArchiSteamFarmExePath}, Path=Value, Mode=OneWay}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</spp:OptionsDisplayItem.Description>
|
||||
<spp:OptionsDisplayItem.Icon>
|
||||
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="" />
|
||||
</spp:OptionsDisplayItem.Icon>
|
||||
<spp:OptionsDisplayItem.ActionButton>
|
||||
<Button Command="{Binding SelectASFExePath}" Content="选择路径" />
|
||||
</spp:OptionsDisplayItem.ActionButton>
|
||||
</spp:OptionsDisplayItem>-->
|
||||
|
||||
<spp:OptionsDisplayItem Header="自动启动 ASF">
|
||||
<spp:OptionsDisplayItem.Icon>
|
||||
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="" />
|
||||
</spp:OptionsDisplayItem.Icon>
|
||||
<spp:OptionsDisplayItem.ActionButton>
|
||||
<ToggleSwitch Classes="LeftContent" IsChecked="{Binding Source={x:Static ms:ASFSettings.AutoRunArchiSteamFarm}, Path=Value, Mode=TwoWay}" />
|
||||
</spp:OptionsDisplayItem.ActionButton>
|
||||
</spp:OptionsDisplayItem>
|
||||
|
||||
<spp:OptionsDisplayItem Header="检查文件安全性">
|
||||
<spp:OptionsDisplayItem.Icon>
|
||||
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="" />
|
||||
</spp:OptionsDisplayItem.Icon>
|
||||
<spp:OptionsDisplayItem.ActionButton>
|
||||
<ToggleSwitch Classes="LeftContent" IsChecked="{Binding Source={x:Static ms:ASFSettings.CheckArchiSteamFarmExe}, Path=Value, Mode=TwoWay}" />
|
||||
</spp:OptionsDisplayItem.ActionButton>
|
||||
</spp:OptionsDisplayItem>
|
||||
|
||||
<spp:OptionsDisplayItem Header="ASF 监听端口">
|
||||
<spp:OptionsDisplayItem.Icon>
|
||||
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="" />
|
||||
</spp:OptionsDisplayItem.Icon>
|
||||
<spp:OptionsDisplayItem.ActionButton>
|
||||
<ui:NumberBox Minimum="5000" Value="{Binding Source={x:Static ms:ASFSettings.IPCPortId}, Path=Value, Mode=TwoWay}" />
|
||||
</spp:OptionsDisplayItem.ActionButton>
|
||||
</spp:OptionsDisplayItem>
|
||||
|
||||
<spp:OptionsDisplayItem Header="端口被占时随机端口号">
|
||||
<spp:OptionsDisplayItem.Icon>
|
||||
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="" />
|
||||
</spp:OptionsDisplayItem.Icon>
|
||||
<spp:OptionsDisplayItem.ActionButton>
|
||||
<ToggleSwitch Classes="LeftContent" IsChecked="{Binding Source={x:Static ms:ASFSettings.IPCPortOccupiedRandom}, Path=Value, Mode=TwoWay}" />
|
||||
</spp:OptionsDisplayItem.ActionButton>
|
||||
</spp:OptionsDisplayItem>
|
||||
|
||||
<spp:OptionsDisplayItem Header="控制台最大行数">
|
||||
<spp:OptionsDisplayItem.Icon>
|
||||
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="" />
|
||||
</spp:OptionsDisplayItem.Icon>
|
||||
<spp:OptionsDisplayItem.ActionButton>
|
||||
<ui:NumberBox Minimum="1" Value="{Binding Source={x:Static ms:ASFSettings.ConsoleMaxLine}, Path=Value, Mode=TwoWay}" />
|
||||
</spp:OptionsDisplayItem.ActionButton>
|
||||
</spp:OptionsDisplayItem>
|
||||
|
||||
<spp:OptionsDisplayItem Header="控制台字体大小">
|
||||
<spp:OptionsDisplayItem.Icon>
|
||||
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="" />
|
||||
</spp:OptionsDisplayItem.Icon>
|
||||
<spp:OptionsDisplayItem.ActionButton>
|
||||
<ui:NumberBox Minimum="1" Value="{Binding Source={x:Static ms:ASFSettings.ConsoleFontSize}, Path=Value, Mode=TwoWay}" />
|
||||
</spp:OptionsDisplayItem.ActionButton>
|
||||
</spp:OptionsDisplayItem>
|
||||
|
||||
</StackPanel>
|
||||
</spp:ContentLoader>
|
||||
</spp:PageBase>
|
||||
|
||||
+32
-32
@@ -14,6 +14,7 @@
|
||||
x:CompileBindings="True"
|
||||
x:DataType="spp:ArchiSteamFarmPlusPageViewModel"
|
||||
Description="{Binding Description, Source={x:Static s:Plugin.Instance}, Mode=OneWay}"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||
Subtitle="{Binding Author, Source={x:Static s:Plugin.Instance}, Mode=OneWay, Converter={StaticResource StringFormatConverter}, ConverterParameter=Plugin_Author}"
|
||||
mc:Ignorable="d">
|
||||
<spp:PageBase.PreviewImage>
|
||||
@@ -76,7 +77,7 @@
|
||||
Margin="28,4,0,4"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="打开WebUI" />
|
||||
Text="打开 WebUI" />
|
||||
</Panel>
|
||||
</Button>
|
||||
<ToggleButton
|
||||
@@ -204,9 +205,9 @@
|
||||
|
||||
</StackPanel>
|
||||
</spp:PageBase.PaneContent>
|
||||
|
||||
<spp:ContentLoader IsLoading="False">
|
||||
<StackPanel Orientation="Vertical" Spacing="2">
|
||||
<!--<StackPanel Orientation="Horizontal" Spacing="2">
|
||||
<!--<StackPanel Orientation="Horizontal" Spacing="2">
|
||||
<Label
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
@@ -221,34 +222,33 @@
|
||||
|
||||
<TextBlock Text="{Binding Source={x:Static s:ASFService.Current}, Path=ConsoleLogText, Mode=TwoWay}" />-->
|
||||
|
||||
<spp:ConsoleShell
|
||||
AutoCompleteBoxItems="{ReflectionBinding Path=Value,
|
||||
Source={x:Static spp:ArchiSteamFarmCommand.Commands}}"
|
||||
CommandSubmit="ConsoleShell_CommandSubmit"
|
||||
FontSize="{ReflectionBinding Source={x:Static ms:ASFSettings.ConsoleFontSize},
|
||||
Path=Value,
|
||||
Mode=OneWay}"
|
||||
InputIndicator="用户输入"
|
||||
IsMask="false"
|
||||
LogText="{ReflectionBinding Source={x:Static s:ASFService.Current},
|
||||
Path=ConsoleLogText,
|
||||
Mode=TwoWay}"
|
||||
MaxLine="{ReflectionBinding Source={x:Static ms:ASFSettings.ConsoleMaxLine},
|
||||
Path=Value,
|
||||
Mode=OneWay}">
|
||||
<spp:ConsoleShell.AutoCompleteBoxItemTemplate>
|
||||
<DataTemplate x:DataType="spp:ArchiSteamFarmCommand">
|
||||
<DockPanel>
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding CommandText}" />
|
||||
<TextBlock
|
||||
Margin="15,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Description}"
|
||||
TextWrapping="Wrap" />
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</spp:ConsoleShell.AutoCompleteBoxItemTemplate>
|
||||
</spp:ConsoleShell>
|
||||
</StackPanel>
|
||||
<spp:ConsoleShell
|
||||
AutoCompleteBoxItems="{ReflectionBinding Path=Value,
|
||||
Source={x:Static spp:ArchiSteamFarmCommand.Commands}}"
|
||||
CommandSubmit="ConsoleShell_CommandSubmit"
|
||||
FontSize="{ReflectionBinding Source={x:Static ms:ASFSettings.ConsoleFontSize},
|
||||
Path=Value,
|
||||
Mode=OneWay}"
|
||||
InputIndicator="用户输入"
|
||||
IsMask="false"
|
||||
LogText="{ReflectionBinding Source={x:Static s:ASFService.Current},
|
||||
Path=ConsoleLogText,
|
||||
Mode=TwoWay}"
|
||||
MaxLine="{ReflectionBinding Source={x:Static ms:ASFSettings.ConsoleMaxLine},
|
||||
Path=Value,
|
||||
Mode=OneWay}">
|
||||
<spp:ConsoleShell.AutoCompleteBoxItemTemplate>
|
||||
<DataTemplate x:DataType="spp:ArchiSteamFarmCommand">
|
||||
<DockPanel>
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding CommandText}" />
|
||||
<TextBlock
|
||||
Margin="15,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Description}"
|
||||
TextWrapping="Wrap" />
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</spp:ConsoleShell.AutoCompleteBoxItemTemplate>
|
||||
</spp:ConsoleShell>
|
||||
</spp:ContentLoader>
|
||||
</spp:PageBase>
|
||||
@@ -30,7 +30,7 @@
|
||||
Command="{Binding $parent[spp:PageBase].((spp:BotPageViewModel)DataContext).EditBotFile}"
|
||||
CommandParameter="{Binding Bot}"
|
||||
IconSource="Edit"
|
||||
Text="编辑Json文件" />
|
||||
Text="编辑 Json 文件" />
|
||||
<ui:MenuFlyoutSeparator />
|
||||
<ui:MenuFlyoutItem
|
||||
Command="{Binding $parent[spp:PageBase].((spp:BotPageViewModel)DataContext).DeleteBot}"
|
||||
@@ -58,7 +58,7 @@
|
||||
Margin="28,4,0,4"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="Json文件导入" />
|
||||
Text="导入 Bot" />
|
||||
</Panel>
|
||||
</Button>
|
||||
<Button
|
||||
@@ -103,7 +103,7 @@
|
||||
</spp:PageBase.ActionContent>
|
||||
<spp:ContentLoader
|
||||
CustomLoadingText="请先启动 ArchiSteamFarm"
|
||||
IsLoading="{Binding Source={x:Static s:ASFService.Current}, Path=!IsASFRuning, Mode=OneWay}"
|
||||
IsLoading="False"
|
||||
IsShowNoResultText="{Binding !!!SteamBots.Count}"
|
||||
NoResultMessage="当前列表没有 Bot 账号">
|
||||
<spp:ContentLoader.GestureRecognizers>
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
<x:Type TypeName="spp:ArchiSteamFarmPage" />
|
||||
</TabStripItem.Tag>
|
||||
</TabStripItem>
|
||||
<TabStripItem Content="Bot">
|
||||
<TabStripItem Content="Bot 配置">
|
||||
<TabStripItem.Tag>
|
||||
<x:Type TypeName="spp:BotPage" />
|
||||
</TabStripItem.Tag>
|
||||
</TabStripItem>
|
||||
<TabStripItem Content="ASF">
|
||||
<TabStripItem Content="ASF 配置">
|
||||
<TabStripItem.Tag>
|
||||
<x:Type TypeName="spp:ASFSettingsPage" />
|
||||
</TabStripItem.Tag>
|
||||
|
||||
@@ -90,6 +90,9 @@
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="UI\Views\Pages\JoinSteamAuthenticatorPage.axaml.cs">
|
||||
<DependentUpon>JoinSteamAuthenticatorPage.axaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
+5
-1
@@ -1,6 +1,6 @@
|
||||
using SJsonSerializer = System.Text.Json.JsonSerializer;
|
||||
using BD.WTTS.UI.Views.Pages;
|
||||
using WinAuth;
|
||||
using SJsonSerializer = System.Text.Json.JsonSerializer;
|
||||
|
||||
namespace BD.WTTS.UI.ViewModels;
|
||||
|
||||
@@ -26,6 +26,8 @@ public class AuthenticatorImportPageViewModel : ViewModelBase
|
||||
if (await AuthenticatorHelper.VerifyMaxValue())
|
||||
await ImportFromSdaFile();
|
||||
})),
|
||||
new AuthenticatorImportMethod(Strings.LocalAuth_Import.Format(Strings.LocalAuth_JoinSteamAuthenticator), Strings.LocalAuth_JoinSteamAuthenticatorDesc,
|
||||
PageType: typeof(JoinSteamAuthenticatorPage)),
|
||||
new AuthenticatorImportMethod(Strings.LocalAuth_Import.Format(Strings.WattToolKitV2), Strings.LocalAuth_WattToolKitV2Import,
|
||||
Command: ReactiveCommand.Create(async () =>
|
||||
{
|
||||
@@ -123,6 +125,7 @@ public class AuthenticatorImportPageViewModel : ViewModelBase
|
||||
? Strings.LocalAuth_AddAuthSuccess
|
||||
: Strings.LocalAuth_AddAuth_PartSuccess);
|
||||
break;
|
||||
|
||||
case IAccountPlatformAuthenticatorRepository.ImportResultCode.SecondaryPasswordFail:
|
||||
Toast.Show(ToastIcon.Warning, Strings.LocalAuth_ProtectionAuth_PasswordErrorTip);
|
||||
var textViewModel =
|
||||
@@ -136,6 +139,7 @@ public class AuthenticatorImportPageViewModel : ViewModelBase
|
||||
}
|
||||
await ImportFromWattToolKitV2(exportPassword, password, isLocalProtect, filePath);
|
||||
break;
|
||||
|
||||
default:
|
||||
Toast.Show(ToastIcon.Error, Strings.LocalAuth_ExportAuth_Error.Format(result.resultCode));
|
||||
break;
|
||||
|
||||
+442
@@ -0,0 +1,442 @@
|
||||
using BD.SteamClient.Models;
|
||||
using BD.SteamClient.Services;
|
||||
using WinAuth;
|
||||
using AppResources = BD.WTTS.Client.Resources.Strings;
|
||||
|
||||
namespace BD.WTTS.UI.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// 联合Steam令牌页面
|
||||
/// </summary>
|
||||
public sealed partial class JoinSteamAuthenticatorPageViewModel : ViewModelBase
|
||||
{
|
||||
#region 步骤索引常量
|
||||
|
||||
const int STEPINDEX_LOGIN = 0;
|
||||
|
||||
const int STEPINDEX_VERIFY = 1;
|
||||
|
||||
const int STEPINDEX_DONE = 2;
|
||||
|
||||
#endregion 步骤索引常量
|
||||
|
||||
#region 页面属性
|
||||
|
||||
/// <summary>
|
||||
/// 用户填入的 Steam 令牌验证码
|
||||
/// </summary>
|
||||
[Reactive]
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
[Reactive]
|
||||
public string? UserNameText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
[Reactive]
|
||||
public string? PasswordText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证码
|
||||
/// </summary>
|
||||
[Reactive]
|
||||
public string? VerifyCodeText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 恢复代码
|
||||
/// </summary>
|
||||
[Reactive]
|
||||
public string? RevocationCodeText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前步骤
|
||||
/// </summary>
|
||||
[Reactive]
|
||||
public int SelectIndex { get; set; } = STEPINDEX_LOGIN;
|
||||
|
||||
/// <summary>
|
||||
/// 加载
|
||||
/// </summary>
|
||||
[Reactive]
|
||||
public bool Loading { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否需要验证码
|
||||
/// </summary>
|
||||
[Reactive]
|
||||
public bool RequireVerifyCode { get; set; } = false;
|
||||
|
||||
#endregion 页面属性
|
||||
|
||||
#region 私有变量
|
||||
|
||||
/// <summary>
|
||||
/// Steam 账号服务
|
||||
/// </summary>
|
||||
private static readonly ISteamAccountService _steamAccountService = Ioc.Get<ISteamAccountService>();
|
||||
|
||||
/// <summary>
|
||||
/// 当前页面待导入的 Steam Authenticator
|
||||
/// </summary>
|
||||
private SteamAuthenticator? _currentSteamAuthenticator;
|
||||
|
||||
private SteamLoginState? _currentSteamLoginState;
|
||||
|
||||
#endregion 私有变量
|
||||
|
||||
#region 联合 Steam令牌 页面流程
|
||||
|
||||
/// <summary>
|
||||
/// 登录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task LoginAsync()
|
||||
{
|
||||
if (Loading)
|
||||
return;
|
||||
|
||||
Loading = true;
|
||||
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(UserNameText) || string.IsNullOrEmpty(PasswordText))
|
||||
{
|
||||
Toast.Show(ToastIcon.Error, AppResources.Error_PleaseEnterUsernamePassword);
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化登录状态
|
||||
var loginState = _currentSteamLoginState ??= new SteamLoginState();
|
||||
|
||||
loginState.Username = UserNameText;
|
||||
loginState.Password = PasswordText;
|
||||
loginState.Language = ResourceService.GetCurrentCultureSteamLanguageName();
|
||||
|
||||
if (RequireVerifyCode && loginState.RequiresEmailAuth)
|
||||
{
|
||||
loginState.EmailCode = VerifyCodeText;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// 开始登录
|
||||
await _steamAccountService.DoLoginV2Async(loginState);
|
||||
}
|
||||
catch (HttpRequestException)
|
||||
{
|
||||
Toast.Show(ToastIcon.Error, AppResources.LocalAuth_JoinSteamAuthenticator_LoginRequestError);
|
||||
return;
|
||||
}
|
||||
|
||||
// 登陆结果
|
||||
if (!loginState.Success)
|
||||
{
|
||||
if (loginState.RequiresEmailAuth)
|
||||
{
|
||||
RequireVerifyCode = true;
|
||||
Toast.Show(ToastIcon.Info, Strings.LocalAuth_EmailCodeTip);
|
||||
return;
|
||||
}
|
||||
else if (loginState.Requires2FA)
|
||||
{
|
||||
Toast.Show(ToastIcon.Error, AppResources.LocalAuth_SteamUser_Requires2FA);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Toast.Show(ToastIcon.Error, loginState.Message ?? string.Empty);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据登录信息 获取/初始化 TwoFA Steam Authenticator 信息
|
||||
var (initialized, errMsg) = await InitTwoFASteamAuthenticatorAsync(loginState);
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
Toast.Show(ToastIcon.Error, errMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
RevocationCodeText = _currentSteamAuthenticator!.RecoveryCode;
|
||||
// 跳转到验证页面
|
||||
SelectIndex = STEPINDEX_VERIFY;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 校验验证码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task VerifyCodeAsync()
|
||||
{
|
||||
if (Loading)
|
||||
return;
|
||||
|
||||
Loading = true;
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Code))
|
||||
{
|
||||
Toast.Show(ToastIcon.Error, AppResources.LocalAuth_JoinSteamAuthenticator_SteamGuardCodeEmptyError);
|
||||
return;
|
||||
}
|
||||
|
||||
var equals = await CompareCodeAsync();
|
||||
|
||||
if (!equals)
|
||||
{
|
||||
Toast.Show(ToastIcon.Warning,
|
||||
$@"{AppResources.LocalAuth_JoinSteamAuthenticator_VerifySteamGuardCodeError}: {Code} != {_currentSteamAuthenticator?.CurrentCode}");
|
||||
return;
|
||||
}
|
||||
|
||||
RevocationCodeText = _currentSteamAuthenticator!.RecoveryCode;
|
||||
SelectIndex = STEPINDEX_DONE;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存令牌
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task SaveAsync()
|
||||
{
|
||||
if (Loading)
|
||||
return;
|
||||
|
||||
Loading = true;
|
||||
|
||||
try
|
||||
{
|
||||
if (_currentSteamAuthenticator == null)
|
||||
{
|
||||
Toast.Show(ToastIcon.Error, AppResources.LocalAuth_JoinSteamAuthenticator_InitLocalAuthenticatorError);
|
||||
SelectIndex = STEPINDEX_LOGIN;
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(Code))
|
||||
{
|
||||
Toast.Show(ToastIcon.Error, AppResources.LocalAuth_JoinSteamAuthenticator_SteamGuardCodeEmptyError);
|
||||
SelectIndex = STEPINDEX_VERIFY;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!await SaveAuthenticatorAsync(UserNameText!, _currentSteamAuthenticator))
|
||||
{
|
||||
Toast.Show(ToastIcon.Error, AppResources.LocalAuth_JoinSteamAuthenticator_SaveLocalAuthenticatorError);
|
||||
return;
|
||||
}
|
||||
|
||||
// 保存完成重置
|
||||
Reset();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置恢复代码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task ResetRevocationCodeAsync()
|
||||
{
|
||||
if (_currentSteamLoginState == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据登录信息 获取/初始化 TwoFA Steam Authenticator 信息
|
||||
var (initialized, errMsg) = await InitTwoFASteamAuthenticatorAsync(_currentSteamLoginState);
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
Toast.Show(ToastIcon.Error, errMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
RevocationCodeText = _currentSteamAuthenticator!.RecoveryCode;
|
||||
}
|
||||
|
||||
#endregion 联合 Steam令牌 页面流程
|
||||
|
||||
#region 辅助方法
|
||||
|
||||
/// <summary>
|
||||
/// 初始化 TwoFA Steam Authenticator 信息
|
||||
/// </summary>
|
||||
/// <param name="loginState"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<(bool initialized, string errorMsg)> InitTwoFASteamAuthenticatorAsync(SteamLoginState loginState)
|
||||
{
|
||||
_currentSteamAuthenticator = new SteamAuthenticator();
|
||||
|
||||
string? steamId = loginState.SteamId != default
|
||||
? loginState.SteamId.ToString()
|
||||
: null;
|
||||
|
||||
if (string.IsNullOrEmpty(steamId))
|
||||
return (false, $"{AppResources.LocalAuth_JoinSteamAuthenticator_InitLocalAuthenticatorError}:{nameof(steamId)}");
|
||||
|
||||
string deviceId = CreateNewDeviceId();
|
||||
|
||||
var client = _currentSteamAuthenticator.GetClient();
|
||||
|
||||
string authenticatorJson;
|
||||
|
||||
try
|
||||
{
|
||||
authenticatorJson = await client
|
||||
.AddAuthenticatorAsync(
|
||||
steamId,
|
||||
DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(),
|
||||
deviceId,
|
||||
loginState.AccessToken ?? string.Empty
|
||||
);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return (false, $"{AppResources.LocalAuth_JoinSteamAuthenticator_RequestUser2FAInfoError}:{ex.Message}");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(authenticatorJson))
|
||||
return (false, AppResources.LocalAuth_JoinSteamAuthenticator_RequestUser2FAInfoError);
|
||||
|
||||
var (initialized, msg) = TryParseSteamAuthenticator(authenticatorJson, out var parsedSteamData)
|
||||
? (true, string.Empty)
|
||||
: (false, AppResources.LocalAuth_JoinSteamAuthenticator_ParseUser2FAInfoError);
|
||||
|
||||
// 解析响应之后赋值给当前本地令牌
|
||||
if (initialized)
|
||||
{
|
||||
_currentSteamAuthenticator.DeviceId = deviceId;
|
||||
_currentSteamAuthenticator.SteamData = SystemTextJsonSerializer.Serialize(parsedSteamData!, SteamJsonContext.Default.SteamConvertSteamDataJsonStruct);
|
||||
_currentSteamAuthenticator.SecretKey = Base64Extensions.Base64DecodeToByteArray_Nullable(parsedSteamData!.SharedSecret);
|
||||
_currentSteamAuthenticator.Serial = parsedSteamData.SerialNumber;
|
||||
}
|
||||
|
||||
return (initialized, msg);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证令牌验证码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task<bool> CompareCodeAsync()
|
||||
{
|
||||
if (_currentSteamAuthenticator == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
await Task.Yield();
|
||||
|
||||
_currentSteamAuthenticator.Sync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.LogAndShowT();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool compareResult = string.Equals(Code, _currentSteamAuthenticator?.CurrentCode, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
return compareResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解析 Steam Authenticator json响应
|
||||
/// </summary>
|
||||
/// <param name="authenticatorJson"></param>
|
||||
/// <param name="parsedSteamAuthenticator">已解析的响应信息</param>
|
||||
/// <returns></returns>
|
||||
private static bool TryParseSteamAuthenticator(string authenticatorJson, out SteamConvertSteamDataJsonStruct? parsedSteamAuthenticator)
|
||||
{
|
||||
parsedSteamAuthenticator = default;
|
||||
|
||||
SteamDoLoginTfaJsonStruct? authenticatorDataResp;
|
||||
|
||||
try
|
||||
{
|
||||
authenticatorDataResp = SystemTextJsonSerializer.Deserialize(
|
||||
authenticatorJson,
|
||||
SteamJsonContext.Default.SteamDoLoginTfaJsonStruct
|
||||
);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (authenticatorDataResp == null || authenticatorDataResp.Response == null)
|
||||
return false;
|
||||
|
||||
parsedSteamAuthenticator = authenticatorDataResp.Response;
|
||||
|
||||
// 目前只需要知道是否含有令牌数据信息
|
||||
// 不需要知道当前状态可不可以绑定,绑定操作在 Steam App 中完成
|
||||
// 这里只是将令牌数据保存到本地 以便后续计算
|
||||
return parsedSteamAuthenticator != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存令牌
|
||||
/// </summary>
|
||||
/// <param name="authenticatorName"></param>
|
||||
/// <param name="authenticator"></param>
|
||||
/// <returns></returns>
|
||||
private static Task<bool> SaveAuthenticatorAsync(string authenticatorName, SteamAuthenticator authenticator)
|
||||
{
|
||||
var iADTO = new AuthenticatorDTO
|
||||
{
|
||||
Name = $"Steam({authenticatorName})",
|
||||
Value = authenticator,
|
||||
Created = DateTimeOffset.Now,
|
||||
};
|
||||
|
||||
return AuthenticatorHelper.SaveAuthenticator(iADTO);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建新的设备ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static string CreateNewDeviceId() => $"android:{Guid.NewGuid()}";
|
||||
|
||||
/// <summary>
|
||||
/// 重置页面绑定信息
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
UserNameText = default;
|
||||
PasswordText = default;
|
||||
Code = default;
|
||||
VerifyCodeText = default;
|
||||
RequireVerifyCode = default;
|
||||
RevocationCodeText = default;
|
||||
SelectIndex = STEPINDEX_LOGIN;
|
||||
|
||||
_currentSteamAuthenticator = default;
|
||||
_currentSteamLoginState = default;
|
||||
}
|
||||
|
||||
#endregion 辅助方法
|
||||
}
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
<UserControl
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:s="https://steampp.net/services"
|
||||
xmlns:spp="https://steampp.net/ui"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="spp:JoinSteamAuthenticatorPageViewModel"
|
||||
x:Class="BD.WTTS.UI.Views.Pages.JoinSteamAuthenticatorPage"
|
||||
mc:Ignorable="d">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<spp:Stepper SelectedIndex="{Binding SelectIndex}">
|
||||
<spp:StepperItem Content="{Binding Path=Res.Steam_Login, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
<spp:StepperItem Content="{Binding Path=Res.LocalAuth_JoinSteamAuthenticator_ConfirmSteamAppAuthenticatorCode, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
<spp:StepperItem Content="{Binding Path=Res.Btn_Text_Complete, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
</spp:Stepper>
|
||||
|
||||
<spp:ContentLoader
|
||||
Grid.Row="1"
|
||||
MinWidth="600"
|
||||
MinHeight="400"
|
||||
IsLoading="{Binding Loading}"
|
||||
IsShowNoResultText="False">
|
||||
<Carousel IsVisible="{Binding !Loading}" SelectedIndex="{Binding SelectIndex}">
|
||||
<Panel>
|
||||
<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 RequireVerifyCode}"
|
||||
Message="{Binding Path=Res.LocalAuth_EmailCodeTip, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
Severity="Warning" />
|
||||
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Spacing="10">
|
||||
<PathIcon
|
||||
Width="88"
|
||||
Height="88"
|
||||
Data="{StaticResource Steam}" />
|
||||
<TextBox
|
||||
MaxWidth="280"
|
||||
Text="{Binding UserNameText}"
|
||||
Watermark="{Binding Path=Res.Steam_User, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
<TextBox
|
||||
Name="PasswordText"
|
||||
MaxWidth="280"
|
||||
Classes="revealPasswordButton"
|
||||
PasswordChar="{StaticResource PasswordChar}"
|
||||
Text="{Binding PasswordText}"
|
||||
Watermark="{Binding Path=Res.Steam_Password, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
<TextBox
|
||||
IsVisible="{Binding RequireVerifyCode}"
|
||||
Watermark="{Binding Path=Res.EmailCode, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
Text="{Binding VerifyCodeText}" />
|
||||
<Button
|
||||
MinWidth="280"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalContentAlignment="Center"
|
||||
Command="{Binding LoginAsync}"
|
||||
Content="{Binding Path=Res.Login, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
|
||||
<Panel>
|
||||
<spp:Snackbar
|
||||
Title="{Binding Path=Res.Notice_Tray_Title, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
VerticalAlignment="Top"
|
||||
IsClosable="False"
|
||||
IsOpen="True"
|
||||
Message="{Binding Path=Res.LocalAuth_JoinSteamAuthenticator_InputSteamAppAuthenticatorCodeTips, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
Severity="Warning" />
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Spacing="10">
|
||||
<DockPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,0,6"
|
||||
DockPanel.Dock="Top"
|
||||
Text="{Binding Path=Res.RecoveryCode, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
<TextBox
|
||||
MaxWidth="300"
|
||||
Text="{Binding RevocationCodeText}"
|
||||
IsReadOnly="True" />
|
||||
<!--<Button
|
||||
Content="重新生成"
|
||||
Command="{Binding ResetRevocationCodeAsync}" />-->
|
||||
</DockPanel>
|
||||
<DockPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,0,6"
|
||||
DockPanel.Dock="Top"
|
||||
Text="{Binding Path=Res.LocalAuth_JoinSteamAuthenticator_SteamAppAuthenticatorCode, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
<TextBox
|
||||
MaxWidth="300"
|
||||
Watermark="{Binding Path=Res.LocalAuth_JoinSteamAuthenticator_InputSteamAppAuthenticatorCode, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
Text="{Binding Code}" />
|
||||
</DockPanel>
|
||||
|
||||
<Button
|
||||
MinWidth="280"
|
||||
HorizontalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Command="{Binding VerifyCodeAsync}"
|
||||
Content="{Binding Path=Res.Continue, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
|
||||
<Panel>
|
||||
<spp:Snackbar
|
||||
Title="{Binding Path=Res.Notice_Tray_Title, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
VerticalAlignment="Top"
|
||||
IsClosable="False"
|
||||
IsOpen="True"
|
||||
Message="{Binding Path=Res.RecoveryCode_RememberTip, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
Severity="Success" />
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Spacing="10">
|
||||
|
||||
<DockPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,0,6"
|
||||
DockPanel.Dock="Top"
|
||||
Text="{Binding Path=Res.RecoveryCode, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
<TextBox
|
||||
MaxWidth="300"
|
||||
Text="{Binding RevocationCodeText}"
|
||||
IsReadOnly="True" />
|
||||
</DockPanel>
|
||||
|
||||
<Button
|
||||
MinWidth="280"
|
||||
HorizontalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Command="{Binding SaveAsync}"
|
||||
Content="{Binding Path=Res.Confirm, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Carousel>
|
||||
</spp:ContentLoader>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
public partial class JoinSteamAuthenticatorPage : UserControl
|
||||
{
|
||||
public JoinSteamAuthenticatorPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DataContext = new JoinSteamAuthenticatorPageViewModel();
|
||||
}
|
||||
}
|
||||
@@ -102,11 +102,13 @@
|
||||
IsVisible="{Binding !!!Confirmations.Count}"
|
||||
Text="{Binding Path=Res.LocalAuth_AuthTrade_Null, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
||||
<ItemsRepeater ItemsSource="{Binding Confirmations}">
|
||||
<ItemsRepeater.Layout>
|
||||
<StackLayout Orientation="Vertical" Spacing="5" />
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<ItemsControl ItemsSource="{Binding Confirmations}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical" Spacing="5" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type spp:SteamTradeConfirmationModel}">
|
||||
<ui:SettingsExpander>
|
||||
<ui:SettingsExpander.Header>
|
||||
@@ -210,8 +212,8 @@
|
||||
IsClickEnabled="True" />-->
|
||||
</ui:SettingsExpander>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</Panel>
|
||||
</Grid>
|
||||
|
||||
@@ -40,6 +40,11 @@ public partial interface IGameAccountSettings
|
||||
/// </summary>
|
||||
ConcurrentDictionary<string, PlatformSettings>? PlatformSettings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否显示账号用户名
|
||||
/// </summary>
|
||||
bool IsShowAccountName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号备注字典的默认值
|
||||
/// </summary>
|
||||
@@ -60,4 +65,9 @@ public partial interface IGameAccountSettings
|
||||
/// </summary>
|
||||
static readonly ConcurrentDictionary<string, PlatformSettings> DefaultPlatformSettings = new();
|
||||
|
||||
/// <summary>
|
||||
/// 是否显示账号用户名的默认值
|
||||
/// </summary>
|
||||
static readonly bool DefaultIsShowAccountName = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -67,6 +67,12 @@ public sealed partial class GameAccountSettings_ : IGameAccountSettings, ISettin
|
||||
[MPKey(3), MP2Key(3), JsonPropertyOrder(3)]
|
||||
public ConcurrentDictionary<string, PlatformSettings>? PlatformSettings { get; set; } = IGameAccountSettings.DefaultPlatformSettings;
|
||||
|
||||
/// <summary>
|
||||
/// 是否显示账号用户名
|
||||
/// </summary>
|
||||
[MPKey(4), MP2Key(4), JsonPropertyOrder(4)]
|
||||
public bool IsShowAccountName { get; set; } = IGameAccountSettings.DefaultIsShowAccountName;
|
||||
|
||||
}
|
||||
|
||||
public static partial class GameAccountSettings
|
||||
@@ -95,4 +101,10 @@ public static partial class GameAccountSettings
|
||||
public static SettingsProperty<string, PlatformSettings, ConcurrentDictionary<string, PlatformSettings>, GameAccountSettings_> PlatformSettings { get; }
|
||||
= new(DefaultPlatformSettings);
|
||||
|
||||
/// <summary>
|
||||
/// 是否显示账号用户名
|
||||
/// </summary>
|
||||
public static SettingsStructProperty<bool, GameAccountSettings_> IsShowAccountName { get; }
|
||||
= new(DefaultIsShowAccountName);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:i="using:Avalonia.Xaml.Interactivity"
|
||||
xmlns:ia="using:Avalonia.Xaml.Interactions.Core"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ms="https://steampp.net/settings"
|
||||
xmlns:s="https://steampp.net/services"
|
||||
xmlns:spp="https://steampp.net/ui"
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
||||
@@ -219,8 +220,13 @@
|
||||
ContextFlyout="{StaticResource SharedMenuFlyout}"
|
||||
Description="{Binding LastLoginTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
|
||||
MoreFlyout="{StaticResource SharedMenuFlyout}"
|
||||
Status="{Binding Path=Res.UserChange_RecentLogin, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
|
||||
Tags="{Binding AliasName}">
|
||||
Status="{Binding Path=Res.UserChange_RecentLogin, Mode=OneWay, Source={x:Static s:ResourceService.Current}}">
|
||||
<spp:AppItem.Tags>
|
||||
<WrapPanel>
|
||||
<TextBlock IsVisible="{Binding Source={x:Static ms:GameAccountSettings.IsShowAccountName}, Path=Value, Mode=OneWay}" Text="{Binding AccountName}" />
|
||||
<TextBlock IsVisible="{Binding AliasName, Converter={StaticResource IsNullConverter}, ConverterParameter=invert}" Text="{Binding AliasName, StringFormat={}({0})}" />
|
||||
</WrapPanel>
|
||||
</spp:AppItem.Tags>
|
||||
<ToolTip.Tip>
|
||||
<TextBlock>
|
||||
<Run Text="双击可快速切换到此账号登录" />
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ms="https://steampp.net/settings"
|
||||
xmlns:s="https://steampp.net/services"
|
||||
xmlns:spp="https://steampp.net/ui"
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
||||
@@ -125,6 +126,10 @@
|
||||
IsVisible="{Binding !IsSelectedSteam}"
|
||||
Text="平台设置" />
|
||||
<!--<ui:MenuFlyoutItem x:Name="PluginSettingButton" Text="{Binding Path=Res.Settings_Plugin, Mode=OneWay,Source={x:Static s:ResourceService.Current}}" />-->
|
||||
<ui:ToggleMenuFlyoutItem
|
||||
IsChecked="{Binding Source={x:Static ms:GameAccountSettings.IsShowAccountName}, Path=Value, Mode=TwoWay}"
|
||||
IsVisible="{Binding IsSelectedSteam}"
|
||||
Text="显示用户名" />
|
||||
<ui:MenuFlyoutSeparator IsVisible="{Binding !IsSelectedSteam}" />
|
||||
<ui:MenuFlyoutItem IsEnabled="False">
|
||||
<ui:MenuFlyoutItem.Text>
|
||||
|
||||
@@ -394,11 +394,13 @@
|
||||
<TabItem Header="{Binding Path=Res.LaunchItem, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" IsVisible="{Binding App.IsInstalled}">
|
||||
<ScrollViewer>
|
||||
<StackPanel Classes="InfoBox">
|
||||
<ItemsRepeater ItemsSource="{Binding App.LaunchItems}">
|
||||
<ItemsRepeater.Layout>
|
||||
<StackLayout Orientation="Vertical" Spacing="{StaticResource SettingsSpacing}" />
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<ItemsControl ItemsSource="{Binding App.LaunchItems}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical" Spacing="{StaticResource SettingsSpacing}" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type spp:SteamAppLaunchItem}">
|
||||
<Border Classes="Item">
|
||||
<StackPanel Spacing="5">
|
||||
@@ -460,8 +462,8 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<Border Classes="Item">
|
||||
<Button
|
||||
HorizontalAlignment="Stretch"
|
||||
@@ -502,11 +504,13 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<ItemsRepeater ItemsSource="{Binding App.SaveFiles}">
|
||||
<ItemsRepeater.Layout>
|
||||
<StackLayout Orientation="Vertical" Spacing="{StaticResource SettingsSpacing}" />
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<ItemsControl ItemsSource="{Binding App.SaveFiles}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical" Spacing="{StaticResource SettingsSpacing}" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type spp:SteamAppSaveFile}">
|
||||
<Border Classes="Item">
|
||||
<StackPanel Spacing="5">
|
||||
@@ -539,8 +543,8 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
||||
@@ -349,63 +349,17 @@
|
||||
<spp:ContentLoader.GestureRecognizers>
|
||||
<ScrollGestureRecognizer CanHorizontallyScroll="True" CanVerticallyScroll="True" />
|
||||
</spp:ContentLoader.GestureRecognizers>
|
||||
<ItemsRepeater
|
||||
x:Name="GameListRepeater"
|
||||
ItemsSource="{Binding SteamApps}"
|
||||
VerticalCacheLength="300">
|
||||
<!--
|
||||
Classes.Compact="{Binding Path=Value, Mode=OneWay, Source={x:Static ms:GameLibrarySettings.GameLibraryLayoutType}, Converter={StaticResource EnumEqualValueConverter}, ConverterParameter={x:Static spp:GridLayoutType.CompactGrid}}"
|
||||
Classes.Grid="{Binding Path=Value, Mode=OneWay, Source={x:Static ms:GameLibrarySettings.GameLibraryLayoutType}, Converter={StaticResource EnumEqualValueConverter}, ConverterParameter={x:Static spp:GridLayoutType.Grid}}"
|
||||
Classes.List="{Binding Path=Value, Mode=OneWay, Source={x:Static ms:GameLibrarySettings.GameLibraryLayoutType}, Converter={StaticResource EnumEqualValueConverter}, ConverterParameter={x:Static spp:GridLayoutType.List}}"
|
||||
-->
|
||||
<!--<ItemsRepeater.Styles>
|
||||
<Style Selector="ItemsRepeater.Grid">
|
||||
<Setter Property="Layout">
|
||||
<Setter.Value>
|
||||
<UniformGridLayout
|
||||
ItemsJustification="Start"
|
||||
ItemsStretch="Uniform"
|
||||
MinColumnSpacing="10"
|
||||
MinItemHeight="310"
|
||||
MinItemWidth="150"
|
||||
MinRowSpacing="10" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="ItemsRepeater.List">
|
||||
<Setter Property="Layout">
|
||||
<Setter.Value>
|
||||
<StackLayout Orientation="Vertical" Spacing="10" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="ItemsRepeater.Compact">
|
||||
<Setter Property="Layout">
|
||||
<Setter.Value>
|
||||
<UniformGridLayout
|
||||
ItemsJustification="Start"
|
||||
ItemsStretch="Uniform"
|
||||
MinColumnSpacing="5"
|
||||
MinItemHeight="65"
|
||||
MinItemWidth="230"
|
||||
MinRowSpacing="5" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="spp|AppItem.List">
|
||||
<Setter Property="MaxHeight" Value="65" />
|
||||
</Style>
|
||||
</ItemsRepeater.Styles>-->
|
||||
<ItemsRepeater.Layout>
|
||||
<UniformGridLayout
|
||||
<ui:ItemsRepeater ItemsSource="{Binding SteamApps}">
|
||||
<ui:ItemsRepeater.Layout>
|
||||
<ui:UniformGridLayout
|
||||
ItemsJustification="Start"
|
||||
ItemsStretch="Uniform"
|
||||
MinColumnSpacing="10"
|
||||
MinItemHeight="310"
|
||||
MinItemWidth="150"
|
||||
MinRowSpacing="10" />
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
</ui:ItemsRepeater.Layout>
|
||||
<ui:ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate DataType="spp:SteamApp">
|
||||
<!-- Classes.Vertical="{Binding Path=Value, Mode=OneWay, Source={x:Static ms:GameLibrarySettings.GameLibraryLayoutType}, Converter={StaticResource EnumEqualValueConverter}, ConverterParameter={x:Static spp:GridLayoutType.Grid}}" -->
|
||||
<spp:AppItem
|
||||
@@ -465,8 +419,8 @@
|
||||
</spp:AppItem.Image>
|
||||
</spp:AppItem>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</ui:ItemsRepeater.ItemTemplate>
|
||||
</ui:ItemsRepeater>
|
||||
|
||||
</spp:ContentLoader>
|
||||
</spp:PageBase>
|
||||
|
||||
@@ -11,45 +11,8 @@ public partial class GameListPage : PageBase<GameListPageViewModel>
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext ??= new GameListPageViewModel();
|
||||
|
||||
//GameLibrarySettings.GameLibraryLayoutType.Subscribe(x =>
|
||||
//{
|
||||
// GameListRepeater.Layout = GetGameLayout(x);
|
||||
//});
|
||||
}
|
||||
|
||||
//static VirtualizingLayout GetGameLayout(GridLayoutType layoutType)
|
||||
//{
|
||||
// VirtualizingLayout layout = layoutType switch
|
||||
// {
|
||||
// GridLayoutType.List => new StackLayout()
|
||||
// {
|
||||
// Orientation = Orientation.Vertical,
|
||||
// Spacing = 10,
|
||||
// },
|
||||
// GridLayoutType.CompactGrid => new UniformGridLayout()
|
||||
// {
|
||||
// MinItemWidth = 230,
|
||||
// MinItemHeight = 65,
|
||||
// MinColumnSpacing = 5,
|
||||
// MinRowSpacing = 5,
|
||||
// ItemsJustification = UniformGridLayoutItemsJustification.Start,
|
||||
// ItemsStretch = UniformGridLayoutItemsStretch.Uniform,
|
||||
// },
|
||||
// _ => new UniformGridLayout()
|
||||
// {
|
||||
// MinItemWidth = 150,
|
||||
// MinItemHeight = 310,
|
||||
// MinColumnSpacing = 10,
|
||||
// MinRowSpacing = 10,
|
||||
// ItemsJustification = UniformGridLayoutItemsJustification.Start,
|
||||
// ItemsStretch = UniformGridLayoutItemsStretch.Uniform,
|
||||
// },
|
||||
// };
|
||||
|
||||
// return layout;
|
||||
//}
|
||||
|
||||
private void AppOpenLink_MenuItem_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||
{
|
||||
if (sender is MenuFlyoutItem item && item.DataContext is SteamApp app)
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
Command="{Binding $parent[spp:PageBase].((spp:IdleAppsPageViewModel)DataContext).RunStopBtnCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
Cursor="Hand"
|
||||
IsVisible="{Binding !Process, Converter={StaticResource IsNullConverter}}"
|
||||
IsVisible="{Binding Process, Converter={StaticResource IsNullConverter}, ConverterParameter=invert}"
|
||||
ToolTip.Tip="{Binding Path=Res.GameList_StopItemBtn, Mode=OneWay, Source={x:Static s:ResourceService.Current}}">
|
||||
<Viewbox Width="60" Height="60">
|
||||
<ui:SymbolIcon Symbol="Pause" />
|
||||
|
||||
@@ -428,7 +428,7 @@ public sealed partial class IdleCardPageViewModel : ViewModelBase
|
||||
{
|
||||
var multi = IdleGameList.Where(z => z.Badge.HoursPlayed >= SteamIdleSettings.MinRunTime.Value).ToList();
|
||||
|
||||
if (multi.Count > 1)
|
||||
if (multi.Count > 1 || (multi.Count == 1 && IdleGameList.Count == 1))
|
||||
{
|
||||
idleApp = VerifyIsNext(multi, isNext);
|
||||
PauseAutoNext(false);
|
||||
|
||||
@@ -529,20 +529,20 @@
|
||||
IsVisible="{Binding !IdleGameList.Count}"
|
||||
Text="未获取到挂卡游戏数据" />
|
||||
</StackPanel>
|
||||
<ItemsRepeater
|
||||
<ui:ItemsRepeater
|
||||
DockPanel.Dock="Bottom"
|
||||
ItemsSource="{Binding IdleGameList}"
|
||||
VerticalCacheLength="50">
|
||||
<ItemsRepeater.Layout>
|
||||
<UniformGridLayout
|
||||
<ui:ItemsRepeater.Layout>
|
||||
<ui:UniformGridLayout
|
||||
ItemsJustification="Start"
|
||||
ItemsStretch="Uniform"
|
||||
MinColumnSpacing="5"
|
||||
MinItemHeight="160"
|
||||
MinItemWidth="280"
|
||||
MinRowSpacing="5" />
|
||||
</ItemsRepeater.Layout>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
</ui:ItemsRepeater.Layout>
|
||||
<ui:ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate DataType="spp:IdleApp">
|
||||
<spp:AppItem
|
||||
Title="{Binding App.DisplayName}"
|
||||
@@ -701,8 +701,8 @@
|
||||
</spp:AppItem.Image>
|
||||
</spp:AppItem>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</ui:ItemsRepeater.ItemTemplate>
|
||||
</ui:ItemsRepeater>
|
||||
</Panel>
|
||||
</spp:OptionsDisplayItem.Content>
|
||||
</spp:OptionsDisplayItem>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace BD;
|
||||
|
||||
[AttributeUsage(AttributeTargets.All, Inherited = false)]
|
||||
public sealed class MobiusAttribute : Attribute
|
||||
{
|
||||
public MobiusAttribute()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MobiusAttribute(string str)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool Obsolete { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace BD;
|
||||
|
||||
[AttributeUsage(AttributeTargets.All, Inherited = false)]
|
||||
public sealed class MobiusAttribute : Attribute
|
||||
{
|
||||
public MobiusAttribute()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MobiusAttribute(string str)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool Obsolete { get; set; }
|
||||
}
|
||||
@@ -10,6 +10,8 @@ partial interface IApplication
|
||||
/// </summary>
|
||||
/// <param name="iconKey"></param>
|
||||
/// <returns></returns>
|
||||
[Mobius(Obsolete = true)]
|
||||
[Obsolete]
|
||||
string? GetIconSourceByIconKey(string? iconKey) => string.IsNullOrWhiteSpace(iconKey) ? null :
|
||||
#if WINDOWS || MACCATALYST || MACOS || LINUX
|
||||
$"avares://BD.WTTS.Client.Avalonia.App/UI/Assets/Icons/{iconKey}.ico";
|
||||
@@ -22,6 +24,8 @@ partial interface IApplication
|
||||
/// </summary>
|
||||
/// <param name="typeName"></param>
|
||||
/// <returns></returns>
|
||||
[Mobius(Obsolete = true)]
|
||||
[Obsolete]
|
||||
string GetIconKeyByTypeName(string typeName)
|
||||
{
|
||||
#if WINDOWS || MACCATALYST || MACOS || LINUX
|
||||
|
||||
@@ -12,6 +12,12 @@ partial interface IApplication
|
||||
/// <param name="msgToast"></param>
|
||||
/// <param name="showToast"></param>
|
||||
/// <returns></returns>
|
||||
[Mobius(
|
||||
"""
|
||||
App // ICommand
|
||||
async void CopyToClipboardCommandCore(object? text)
|
||||
ICommand CopyToClipboardCommand
|
||||
""")]
|
||||
static async Task CopyToClipboardAsync(string? text, string? msgToast = null, bool showToast = true)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(text))
|
||||
|
||||
@@ -3,37 +3,65 @@ namespace BD.WTTS;
|
||||
|
||||
partial interface IApplication : IDisposableHolder
|
||||
{
|
||||
[Mobius(
|
||||
"""
|
||||
App.CompositeDisposable
|
||||
""")]
|
||||
new CompositeDisposable CompositeDisposable { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 切换当前桌面应用的主题而不改变设置值
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
[Mobius(
|
||||
"""
|
||||
App.SetThemeNotChangeValue
|
||||
""")]
|
||||
void SetThemeNotChangeValue(AppTheme value) { }
|
||||
|
||||
/// <summary>
|
||||
/// 退出整个程序
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
App.Shutdown
|
||||
""")]
|
||||
void Shutdown() { }
|
||||
|
||||
/// <summary>
|
||||
/// 主窗口恢复显示
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
App.RestoreMainWindow
|
||||
""")]
|
||||
void RestoreMainWindow() { }
|
||||
|
||||
/// <summary>
|
||||
/// 主窗口置顶一次
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
App.RestoreMainWindow
|
||||
""")]
|
||||
void SetTopmostOneTime() { }
|
||||
|
||||
/// <summary>
|
||||
/// 托盘菜单
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
App.TrayIconMenus
|
||||
""")]
|
||||
IReadOnlyDictionary<string, ICommand> TrayIconMenus { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否有活动窗口
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Mobius(
|
||||
"""
|
||||
App.HasActiveWindow
|
||||
""")]
|
||||
bool HasActiveWindow();
|
||||
}
|
||||
@@ -5,8 +5,16 @@ partial interface IApplication
|
||||
{
|
||||
#region Logger
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Helpers.LogInitHelper
|
||||
""")]
|
||||
const LogLevel DefaultLoggerMinLevel = IPCSubProcessFileSystem.DefaultLoggerMinLevel;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Helpers.LogInitHelper
|
||||
""")]
|
||||
public static NLogLevel DefaultNLoggerMinLevel => IPCSubProcessFileSystem.DefaultNLoggerMinLevel;
|
||||
|
||||
/// <summary>
|
||||
@@ -14,12 +22,24 @@ partial interface IApplication
|
||||
/// </summary>
|
||||
/// <param name="logLevel">level to be converted.</param>
|
||||
/// <returns></returns>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Helpers.LogInitHelper
|
||||
""")]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
static NLogLevel ConvertLogLevel(LogLevel logLevel) => IPCSubProcessFileSystem.ConvertLogLevel(logLevel);
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Helpers.LogInitHelper
|
||||
""")]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
static void SetNLoggerMinLevel(LogLevel logLevel) => SetNLoggerMinLevel(ConvertLogLevel(logLevel));
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Helpers.LogInitHelper
|
||||
""")]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
static void SetNLoggerMinLevel(NLogLevel logLevel)
|
||||
{
|
||||
@@ -27,6 +47,7 @@ partial interface IApplication
|
||||
NInternalLogger.LogLevel = logLevel;
|
||||
}
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void TrySetLoggerMinLevel(LogLevel logLevel)
|
||||
{
|
||||
@@ -41,11 +62,19 @@ partial interface IApplication
|
||||
SetNLoggerMinLevel(ConvertLogLevel(logLevel));
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Helpers.LogInitHelper
|
||||
""")]
|
||||
private static LoggerFilterOptions? _LoggerFilterOptions;
|
||||
|
||||
/// <summary>
|
||||
/// 日志过滤选项
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Helpers.LogInitHelper
|
||||
""")]
|
||||
static LoggerFilterOptions? LoggerFilterOptions
|
||||
{
|
||||
get
|
||||
@@ -59,6 +88,10 @@ partial interface IApplication
|
||||
/// <summary>
|
||||
/// 配置 NLog 提供程序,仅初始化时调用
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Helpers.LogInitHelper.GetMobiusLoggingBuilder
|
||||
""")]
|
||||
public static Action<ILoggingBuilder> ConfigureLogging(LogLevel minLevel = DefaultLoggerMinLevel)
|
||||
{
|
||||
return (ILoggingBuilder builder) =>
|
||||
@@ -92,6 +125,10 @@ partial interface IApplication
|
||||
/// <summary>
|
||||
/// 日志最低等级
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Helpers.LogInitHelper
|
||||
""")]
|
||||
public static LogLevel LoggerMinLevel
|
||||
{
|
||||
get
|
||||
@@ -119,6 +156,7 @@ partial interface IApplication
|
||||
/// <summary>
|
||||
/// 启用日志
|
||||
/// </summary>
|
||||
[Mobius(Obsolete = true)]
|
||||
public static bool EnableLogger
|
||||
{
|
||||
get => LoggerMinLevel > LogLevel.None;
|
||||
@@ -135,6 +173,10 @@ partial interface IApplication
|
||||
/// <summary>
|
||||
/// 日志存放文件夹路径
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
MobiusHost.LogDirPath
|
||||
""")]
|
||||
static string LogDirPath { get; internal set; } = string.Empty;
|
||||
|
||||
#if (WINDOWS || MACCATALYST || MACOS || LINUX) && !(IOS || ANDROID)
|
||||
@@ -142,6 +184,7 @@ partial interface IApplication
|
||||
/// <summary>
|
||||
/// 日志存放文件夹路径(ASF)
|
||||
/// </summary>
|
||||
[Mobius(Obsolete = true)]
|
||||
static string LogDirPathASF { get; set; } = string.Empty;
|
||||
|
||||
#endif
|
||||
@@ -154,6 +197,7 @@ partial interface IApplication
|
||||
static bool LogUnderCache => true;
|
||||
#endif
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
static Action? ASFInitCoreLoggers { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -3,6 +3,10 @@ namespace BD.WTTS;
|
||||
|
||||
partial interface IApplication
|
||||
{
|
||||
[Mobius(
|
||||
"""
|
||||
MobiusHost.EnableDevTools
|
||||
""")]
|
||||
public static bool EnableDevtools { get; set; } =
|
||||
#if DEBUG
|
||||
true
|
||||
@@ -14,10 +18,18 @@ partial interface IApplication
|
||||
/// <summary>
|
||||
/// 禁用 GPU 硬件加速
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
MobiusHost.DisableGPU
|
||||
""")]
|
||||
public static bool DisableGPU { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 使用 native OpenGL(仅 Windows)
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
MobiusHost.UseWgl
|
||||
""")]
|
||||
public static bool UseWgl { get; set; }
|
||||
}
|
||||
@@ -20,11 +20,19 @@ partial interface IApplication
|
||||
}
|
||||
#endif
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
AppConstants.ProgramName
|
||||
""")]
|
||||
private static string? _ProgramName;
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前主程序文件名,例如 steam++.exe
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
AppConstants.ProgramName
|
||||
""")]
|
||||
static string ProgramName
|
||||
{
|
||||
get
|
||||
@@ -34,6 +42,10 @@ partial interface IApplication
|
||||
}
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
AppConstants.ProgramName
|
||||
""")]
|
||||
private static string GetProgramName()
|
||||
{
|
||||
var processPath = Environment.ProcessPath;
|
||||
|
||||
@@ -6,11 +6,19 @@ partial interface IApplication
|
||||
/// <summary>
|
||||
/// 获取或设置当前应用的主题,例如跟随系统,浅色,深色
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
App.Theme
|
||||
""")]
|
||||
AppTheme Theme { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前应用的实际主题
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
App.ActualTheme
|
||||
""")]
|
||||
AppTheme ActualTheme => Theme switch
|
||||
{
|
||||
AppTheme.FollowingSystem => GetActualThemeByFollowingSystem(),
|
||||
@@ -22,8 +30,13 @@ partial interface IApplication
|
||||
/// <summary>
|
||||
/// 获取当前应用的默认主题
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
App.DefaultActualTheme
|
||||
""")]
|
||||
protected AppTheme DefaultActualTheme { get; }
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
static AppTheme GetAppThemeByIsLightOrDarkTheme(bool isLightOrDarkTheme) => isLightOrDarkTheme ? AppTheme.Light : AppTheme.Dark;
|
||||
|
||||
@@ -31,6 +44,10 @@ partial interface IApplication
|
||||
/// 获取当前应用主题跟随系统时的实际主题
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Mobius(
|
||||
"""
|
||||
App.GetActualThemeByFollowingSystem
|
||||
""")]
|
||||
protected AppTheme GetActualThemeByFollowingSystem()
|
||||
{
|
||||
var dps = IPlatformService.Instance;
|
||||
|
||||
@@ -2,6 +2,10 @@ namespace BD.WTTS;
|
||||
|
||||
public partial interface IApplication
|
||||
{
|
||||
[Mobius(
|
||||
"""
|
||||
App.TrayMenus
|
||||
""")]
|
||||
Dictionary<string, TrayMenuItem>? TrayMenus { get; }
|
||||
|
||||
/// <summary>
|
||||
@@ -9,5 +13,9 @@ public partial interface IApplication
|
||||
/// </summary>
|
||||
/// <param name="menuKey"></param>
|
||||
/// <param name="trayMenuItem"></param>
|
||||
[Mobius(
|
||||
"""
|
||||
App.UpdateMenuItems
|
||||
""")]
|
||||
void UpdateMenuItems(string menuKey, TrayMenuItem trayMenuItem);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@ namespace BD.WTTS;
|
||||
/// </summary>
|
||||
public partial interface IApplication
|
||||
{
|
||||
[Mobius(
|
||||
"""
|
||||
App // ICommand
|
||||
async void CopyToClipboardCommandCore(object? text)
|
||||
ICommand CopyToClipboardCommand
|
||||
""")]
|
||||
static IApplication Instance => Ioc.Get<IApplication>();
|
||||
|
||||
/// <summary>
|
||||
@@ -13,6 +19,7 @@ public partial interface IApplication
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[Mobius(Obsolete = true)]
|
||||
static bool IsDesktop()
|
||||
#if WINDOWS || MACOS || LINUX
|
||||
=> true;
|
||||
@@ -24,6 +31,7 @@ public partial interface IApplication
|
||||
=> OperatingSystem.IsWindows() || OperatingSystem.IsMacOS() || (OperatingSystem.IsLinux() && !OperatingSystem.IsAndroid());
|
||||
#endif
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
[Obsolete("use IsDesktop", true)]
|
||||
static bool IsDesktopPlatform => IsDesktop();
|
||||
|
||||
@@ -31,6 +39,7 @@ public partial interface IApplication
|
||||
/// 获取当前平台 UI Host
|
||||
/// <para>reference to the ViewController (if using Xamarin.iOS), Activity (if using Xamarin.Android) IWin32Window or IntPtr (if using .Net Framework).</para>
|
||||
/// </summary>
|
||||
[Mobius(Obsolete = true)]
|
||||
object CurrentPlatformUIHost { get; }
|
||||
|
||||
#if WINDOWS
|
||||
@@ -52,6 +61,7 @@ public partial interface IApplication
|
||||
});
|
||||
#endif
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
DeploymentMode DeploymentMode =>
|
||||
#if WINDOWS
|
||||
_DeploymentMode.Value;
|
||||
@@ -60,8 +70,16 @@ public partial interface IApplication
|
||||
#endif
|
||||
|
||||
/// <inheritdoc cref="IPlatformService.SetBootAutoStart(bool, string)"/>
|
||||
[Mobius(
|
||||
"""
|
||||
SystemBootHelper.SetBootAutoStart
|
||||
""")]
|
||||
static void SetBootAutoStart(bool isAutoStart) => IPlatformService.Instance.SetBootAutoStart(isAutoStart, Constants.HARDCODED_APP_NAME);
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
ISppWebApiService.clientPlatform
|
||||
""")]
|
||||
private static readonly Lazy<ClientPlatform> clientPlatform = new(() =>
|
||||
{
|
||||
var platform = DeviceInfo2.Platform();
|
||||
@@ -145,13 +163,29 @@ public partial interface IApplication
|
||||
return default;
|
||||
});
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.GetApplicationIcon
|
||||
""")]
|
||||
static byte[] Login_512 => Properties.Resources.AppLogo_512;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
ISppWebApiService.clientPlatform
|
||||
""")]
|
||||
static ClientPlatform ClientPlatform => clientPlatform.Value;
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
System.Drawing.Size? GetScreenSize() => null;
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
bool? IsAnyWindowNotMinimized() => null;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App // ICommand
|
||||
async void OpenBrowserCommandCore(object? url)
|
||||
ICommand OpenBrowserCommand
|
||||
""")]
|
||||
async void OpenBrowserCommandCore(object? url) => await Browser2.OpenAsync(url?.ToString());
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ namespace BD.WTTS;
|
||||
/// 指定应用此特性的类需要指定的授权
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, Inherited = true)]
|
||||
[Mobius(Obsolete = true)]
|
||||
[Obsolete]
|
||||
public sealed class AuthorizeAttribute : Attribute
|
||||
{
|
||||
public static bool HasAuthorize(object obj)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace BD.WTTS.Columns;
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
public interface IReadOnlyName
|
||||
{
|
||||
string? Name { get; }
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace BD.WTTS.Columns;
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
[Obsolete]
|
||||
public interface IReadOnlyStaticDisplayName
|
||||
{
|
||||
static abstract string? DisplayName { get; }
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace BD.WTTS;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
CertificateConstants
|
||||
""")]
|
||||
public static class CertificateConstants
|
||||
{
|
||||
public const int CertificateValidDays = 300;
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace BD.WTTS;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Constants.UrlConstants
|
||||
""")]
|
||||
[Obsolete("use Constants.Urls/Constants", true)]
|
||||
public static class UrlConstants
|
||||
{
|
||||
|
||||
@@ -4,11 +4,19 @@ namespace BD.WTTS.Diagnostics;
|
||||
/// 启动耗时跟踪
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
[Mobius(
|
||||
"""
|
||||
App.WriteElapsedMilliseconds
|
||||
""", Obsolete = true)]
|
||||
public static class StartWatchTrace
|
||||
{
|
||||
static Stopwatch? sw;
|
||||
static StringBuilder? sb;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.WriteElapsedMilliseconds
|
||||
""")]
|
||||
public static void Record(string? mark = null, bool dispose = false)
|
||||
{
|
||||
if (sw != null)
|
||||
@@ -41,7 +49,12 @@ public static class StartWatchTrace
|
||||
}
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
App.Elapsed
|
||||
""")]
|
||||
public static new string ToString() => sb?.ToString() ?? string.Empty;
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
public static long ElapsedMilliseconds => sw == null ? 0L : sw.ElapsedMilliseconds;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace BD.WTTS.Entities;
|
||||
/// <summary>
|
||||
/// 通知记录
|
||||
/// </summary>
|
||||
[Mobius(Obsolete = true)]
|
||||
[SQLiteTable("A765AD32")]
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public sealed class Notification : IEntity<Guid>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Entities;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Entities.Http.RequestCache
|
||||
""")]
|
||||
[SQLiteTable(TableName)]
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public sealed class RequestCache : IEntity<string>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Entities;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Entities.Identity.User
|
||||
""")]
|
||||
[SQLiteTable("D5428AED")]
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public sealed class User : IEntity<Guid>
|
||||
|
||||
@@ -3,6 +3,10 @@ namespace BD.WTTS.Enums;
|
||||
/// <summary>
|
||||
/// 应用程序终结点路由
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.App.AppEndPoint
|
||||
""", Obsolete = true)]
|
||||
public enum AppEndPoint : byte
|
||||
{
|
||||
LoginOrRegister = 1,
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace BD.WTTS.Enums;
|
||||
/// <summary>
|
||||
/// 指定用于检索应用程序所使用的文件夹目录路径的枚举常数
|
||||
/// </summary>
|
||||
[Mobius(Obsolete = true)]
|
||||
public enum AppFolder : byte
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,6 +25,7 @@ public enum AppFolder : byte
|
||||
/// <summary>
|
||||
/// Enum 扩展 <see cref="AppFolder"/>
|
||||
/// </summary>
|
||||
[Mobius(Obsolete = true)]
|
||||
public static class AppFolderEnumExtensions
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -4,6 +4,10 @@ namespace BD.WTTS.Enums;
|
||||
/// 应用服务级别,较低的级别注入较少的服务,适用于其他轻量进程业务启动
|
||||
/// </summary>
|
||||
[Flags]
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.App.AppServicesLevel
|
||||
""")]
|
||||
public enum AppServicesLevel : uint
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -5,6 +5,10 @@ namespace BD.WTTS.Enums;
|
||||
/// <summary>
|
||||
/// 应用程序主题
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.App.AppTheme
|
||||
""")]
|
||||
public enum AppTheme : byte
|
||||
{
|
||||
/// <summary>
|
||||
@@ -34,6 +38,7 @@ public enum AppTheme : byte
|
||||
Custom,
|
||||
}
|
||||
|
||||
[Mobius(Obsolete = true)]
|
||||
public static partial class AppThemeEnumExtensions
|
||||
{
|
||||
#if DEBUG
|
||||
|
||||
@@ -3,6 +3,10 @@ namespace BD.WTTS.Enums;
|
||||
/// <summary>
|
||||
/// 应用程序 Web 代理模式
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.App.AppWebProxyMode
|
||||
""")]
|
||||
public enum AppWebProxyMode : byte
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
namespace BD.WTTS.Enums;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.ExitCode
|
||||
// src/ExitCode.cs
|
||||
""")]
|
||||
public enum CommandExitCode
|
||||
{
|
||||
#region 100 ~ 5xx HttpStatusCode
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Enums;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.Text.EncodingType
|
||||
""")]
|
||||
public enum EncodingType : byte
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -23,6 +23,10 @@ namespace BD.WTTS.Enums;
|
||||
/// <para>在<see cref="NotificationType_Channel_EnumExtensions.GetDescription(NotificationChannelType)"/>中添加渠道描述</para>
|
||||
/// <para>在<see cref="NotificationType_Channel_EnumExtensions.GetImportanceLevel(NotificationChannelType)"/>中添加渠道重要性级别</para>
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.PlatformNotification.PlatformNotificationChannelType
|
||||
""")]
|
||||
public enum NotificationChannelType
|
||||
{
|
||||
/// <inheritdoc cref="NotificationType.NewVersion"/>
|
||||
@@ -45,6 +49,10 @@ public enum NotificationChannelType
|
||||
/// <summary>
|
||||
/// Enum 扩展 <see cref="NotificationType"/> AND <see cref="NotificationChannelType"/>
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.PlatformNotification.PlatformNotificationType_Channel_EnumExtensions
|
||||
""")]
|
||||
public static partial class NotificationType_Channel_EnumExtensions
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -3,6 +3,10 @@ namespace BD.WTTS.Enums;
|
||||
/// <summary>
|
||||
/// 退出操作系统方式
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.App.OSExitMode
|
||||
""")]
|
||||
public enum OSExitMode : byte
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace BD.WTTS.Enums;
|
||||
/// 表示操作结果的枚举
|
||||
/// </summary>
|
||||
[Description("操作结果的枚举")]
|
||||
[Mobius(Obsolete = true)]
|
||||
public enum OperationResultType
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -3,6 +3,10 @@ namespace BD.WTTS.Enums;
|
||||
/// <summary>
|
||||
/// 文本阅读器提供商
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.Text.TextReaderProvider
|
||||
""")]
|
||||
public enum TextReaderProvider
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Enums;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.UI.GridLayoutType
|
||||
""")]
|
||||
public enum GridLayoutType
|
||||
{
|
||||
List = 0,
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Enums;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.UI.NavigationTransitionEffect
|
||||
""")]
|
||||
public enum NavigationTransitionEffect
|
||||
{
|
||||
None = 0,
|
||||
|
||||
@@ -4,6 +4,10 @@ namespace BD.WTTS.Enums;
|
||||
/// <summary>
|
||||
/// 资源图标
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.UI.ResIcon
|
||||
""")]
|
||||
public enum ResIcon
|
||||
{
|
||||
None,
|
||||
|
||||
@@ -4,6 +4,10 @@ namespace BD.WTTS.Enums;
|
||||
/// <summary>
|
||||
/// 指定是否可以调整窗口大小,并在可调整大小的情况下指定如何调整窗口大小。由 SetResizeMode 使用
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.UI.ResizeMode
|
||||
""")]
|
||||
public enum ResizeMode : byte
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace BD.WTTS.Enums;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.UI.WindowBackgroundMaterial
|
||||
""")]
|
||||
public enum WindowBackgroundMaterial : byte
|
||||
{
|
||||
None = 0,
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace BD.WTTS.Enums;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.UI.XamlMediaStretch
|
||||
""")]
|
||||
public enum XamlMediaStretch : byte
|
||||
{
|
||||
None = 0,
|
||||
|
||||
@@ -3,10 +3,18 @@ namespace BD.WTTS;
|
||||
/// <summary>
|
||||
/// <see cref="ApiRspImpl"/> 的扩展函数
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.ApiRspImplHandleUIExtensions
|
||||
""", Obsolete = true)]
|
||||
public static class ApiRspImplHandleUIExtensions
|
||||
{
|
||||
const string TAG = "HandleUI";
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.ApiRspImplHandleUIExtensions
|
||||
""", Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
static void LogError(this ApiRspBase apiRsp, string message)
|
||||
{
|
||||
@@ -22,6 +30,10 @@ public static class ApiRspImplHandleUIExtensions
|
||||
/// <param name="errorAppendText"></param>
|
||||
/// <param name="errorFormat"></param>
|
||||
/// <returns></returns>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.ApiRspImplHandleUIExtensions
|
||||
""", Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool HandleUI(this ApiRspBase apiRsp, ToastIcon icon = ToastIcon.Error, string? errorAppendText = null, string? errorFormat = null)
|
||||
{
|
||||
@@ -52,6 +64,10 @@ public static class ApiRspImplHandleUIExtensions
|
||||
/// <param name="errorAppendText"></param>
|
||||
/// <param name="errorFormat"></param>
|
||||
/// <returns></returns>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.ApiRspImplHandleUIExtensions
|
||||
""", Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool HandleUI<TContent>(this ApiRsp<TContent> apiRsp,
|
||||
[NotNullWhen(true)] out TContent? content, ToastIcon icon = ToastIcon.Error, string? errorAppendText = null, string? errorFormat = null)
|
||||
@@ -107,6 +123,10 @@ public static class ApiRspImplHandleUIExtensions
|
||||
/// <param name="errorAppendText"></param>
|
||||
/// <param name="errorFormat"></param>
|
||||
/// <returns></returns>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.ApiRspImplHandleUIExtensions
|
||||
""", Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool HandleUIAllowNull<TContent>(this ApiRsp<TContent> apiRsp,
|
||||
out TContent? content, ToastIcon icon = ToastIcon.Error, string? errorAppendText = null, string? errorFormat = null)
|
||||
|
||||
@@ -3,12 +3,15 @@ using System.Reactive.Disposables;
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace System;
|
||||
|
||||
[BD.Mobius(Obsolete = true)]
|
||||
public static partial class CompositeDisposableExtensions
|
||||
{
|
||||
[BD.Mobius(Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void Add(this CompositeDisposable @this, Action dispose)
|
||||
=> @this.Add(Disposable.Create(dispose));
|
||||
|
||||
[BD.Mobius(Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void Add(this CompositeDisposable @this, Func<ValueTask> dispose)
|
||||
=> @this.Add(new AsyncDisposable(dispose));
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
public static partial class ServiceCollectionExtensions
|
||||
{
|
||||
[BD.Mobius(
|
||||
"""
|
||||
Mobius.Helpers.*
|
||||
""", Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static IServiceCollection AddPlatformService(
|
||||
this IServiceCollection services,
|
||||
|
||||
+4
@@ -4,6 +4,10 @@ namespace Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
public static partial class ServiceCollectionExtensions
|
||||
{
|
||||
[BD.Mobius(
|
||||
"""
|
||||
Mobius.Helpers.WinScheduledTaskHelper
|
||||
""", Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static IServiceCollection AddScheduledTaskService(this IServiceCollection services)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace System;
|
||||
public static class ProcessExtensions
|
||||
{
|
||||
/// <inheritdoc cref="IPlatformService.GetCommandLineArgs(Process)"/>
|
||||
[BD.Mobius(Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static string GetCommandLineArgs(this Process process)
|
||||
{
|
||||
|
||||
+4
@@ -8,6 +8,10 @@ public static partial class ServiceCollectionExtensions
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
[BD.Mobius(
|
||||
"""
|
||||
BD.Common8.Security.Extensions.AddSecurityService
|
||||
""")]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static IServiceCollection AddSecurityService(this IServiceCollection services)
|
||||
{
|
||||
|
||||
+4
@@ -10,6 +10,10 @@ public static partial class ServiceCollectionExtensions
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
[BD.Mobius(
|
||||
"""
|
||||
Mobius.Helpers.LogInitHelper.AddMobiusLogging
|
||||
""")]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static IServiceCollection AddGeneralLogging(this IServiceCollection services)
|
||||
{
|
||||
|
||||
+4
@@ -9,6 +9,10 @@ public static partial class ServiceCollectionExtensions
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
[BD.Mobius(
|
||||
"""
|
||||
services.AddSingleton<IHostsFileService, HostsFileServiceImpl>();
|
||||
""", Obsolete = true)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static IServiceCollection AddHostsFileService(this IServiceCollection services)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user