mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-19 07:01:35 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ee4a12e9b5 | |||
| 5e815ac0d3 | |||
| 96a14d69bd | |||
| c79fba98d3 | |||
| 4160bb43c5 |
@@ -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" />
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.WaveProgressGradientOffsetConverter
|
||||
""")]
|
||||
public sealed class BitmapAssetValueConverter : ImageValueConverter
|
||||
{
|
||||
public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.ColorStringToBrushConverter
|
||||
""")]
|
||||
public sealed class ColorStringToBrushConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.EnumConverter
|
||||
""")]
|
||||
public sealed class EnumConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
|
||||
@@ -2,6 +2,10 @@ using IBinding = BD.WTTS.Converters.Abstractions.IBinding;
|
||||
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.EnumEqualValueConverter
|
||||
""")]
|
||||
public sealed class EnumEqualValueConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.EnumLocalizationNameConverter
|
||||
""")]
|
||||
public sealed class EnumLocalizationNameConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
|
||||
@@ -2,6 +2,10 @@ using SkiaSharp;
|
||||
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.Abstractions.ImageValueConverter
|
||||
""")]
|
||||
public abstract class ImageValueConverter : IValueConverter
|
||||
{
|
||||
public abstract object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture);
|
||||
@@ -46,6 +50,7 @@ public abstract class ImageValueConverter : IValueConverter
|
||||
/// <param name="clipStream"></param>
|
||||
/// <param name="bitmap"></param>
|
||||
/// <returns></returns>
|
||||
[Mobius("", Obsolete = true)]
|
||||
static bool TryGetBitmap([NotNullWhen(true)] ImageSource.ClipStream? clipStream, [NotNullWhen(true)] out SKBitmap? bitmap)
|
||||
{
|
||||
if (clipStream?.Stream == null)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.IsNullConverter
|
||||
""")]
|
||||
public sealed class IsNullConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.NameToFontFamilyConverter
|
||||
""")]
|
||||
public sealed class NameToFontFamilyConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.RangeToSweepConverter
|
||||
""")]
|
||||
public sealed class RangeToSweepConverter : IMultiValueConverter
|
||||
{
|
||||
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.ResourceKeyValueConverter
|
||||
""")]
|
||||
public sealed class ResourceKeyValueConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.StringEqualsConverter
|
||||
""")]
|
||||
public class StringEqualsConverter : IValueConverter
|
||||
{
|
||||
static string ToString(object? obj) => obj?.ToString() ?? string.Empty;
|
||||
|
||||
@@ -2,6 +2,10 @@ using SteamKit2;
|
||||
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.StringFormatConverter
|
||||
""")]
|
||||
public sealed class StringFormatConverter : IValueConverter, IMultiValueConverter
|
||||
{
|
||||
const string Size = "size";
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.VisibleStringConverter
|
||||
""")]
|
||||
public sealed class VisibleStringConverter : IMultiValueConverter
|
||||
{
|
||||
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Converters;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.WaveProgressValueConverter
|
||||
""")]
|
||||
public sealed class WaveProgressValueConverter : IValueConverter
|
||||
{
|
||||
public static readonly WaveProgressValueConverter Instance = new();
|
||||
@@ -18,6 +22,10 @@ public sealed class WaveProgressValueConverter : IValueConverter
|
||||
}
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.WaveProgressValueColorConverter
|
||||
""")]
|
||||
public class WaveProgressValueColorConverter : IValueConverter
|
||||
{
|
||||
public static readonly WaveProgressValueColorConverter Instance = new();
|
||||
@@ -37,6 +45,10 @@ public class WaveProgressValueColorConverter : IValueConverter
|
||||
}
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.WaveProgressValueTextConverter
|
||||
""")]
|
||||
public class WaveProgressValueTextConverter : IValueConverter
|
||||
{
|
||||
public static readonly WaveProgressValueTextConverter Instance = new();
|
||||
@@ -54,6 +66,10 @@ public class WaveProgressValueTextConverter : IValueConverter
|
||||
}
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Converters.WaveProgressGradientOffsetConverter
|
||||
""")]
|
||||
public class WaveProgressGradientOffsetConverter : IValueConverter
|
||||
{
|
||||
public static readonly WaveProgressGradientOffsetConverter Instance = new();
|
||||
|
||||
@@ -2,6 +2,10 @@ namespace BD.WTTS.UI;
|
||||
|
||||
public static class ControlExtensions
|
||||
{
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.ControlExtensions.SetViewModel
|
||||
""")]
|
||||
public static void SetViewModel<T>(this Control c, bool useCache = false) where T : ViewModelBase, new()
|
||||
{
|
||||
if (c.DataContext == null || c.DataContext.GetType() != typeof(T))
|
||||
|
||||
@@ -3,6 +3,10 @@ namespace BD.WTTS;
|
||||
/// <summary>
|
||||
/// <see cref="IEnumerable"/> extensions methods
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.IEnumerableExtensions
|
||||
""")]
|
||||
public static class IEnumerableExtensions
|
||||
{
|
||||
public static IEnumerable<IEnumerable> Batch(this IEnumerable source, int size)
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace Avalonia.Controls;
|
||||
|
||||
[BD.Mobius(
|
||||
"""
|
||||
Mobius.UI.WindowExtensions
|
||||
""")]
|
||||
public static partial class WindowExtensions
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
|
||||
@@ -3,6 +3,10 @@ namespace BD.WTTS;
|
||||
|
||||
public static class WindowTransparencyLevelExtensions
|
||||
{
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Enums.UI.WindowTransparencyLevelExtensions
|
||||
""")]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static WindowTransparencyLevel ToWindowTransparencyLevel(
|
||||
this WindowBackgroundMaterial value)
|
||||
|
||||
@@ -2,6 +2,10 @@ using BD.WTTS.Markup.Abstractions;
|
||||
|
||||
namespace BD.WTTS.Markup;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Markup.OnPlatformExtension
|
||||
""")]
|
||||
public sealed class OnPlatformExtension : MarkupExtension<bool>
|
||||
{
|
||||
public OnPlatformExtension(string member) : base(member)
|
||||
|
||||
+4
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.Services.Implementation;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
BD.Common8.Essentials.Services.Implementation.AvaloniaMainThreadPlatformServiceImpl
|
||||
""")]
|
||||
sealed class MainThreadPlatformServiceImpl : IMainThreadPlatformService
|
||||
{
|
||||
public bool PlatformIsMainThread
|
||||
|
||||
+8
@@ -4,10 +4,18 @@ using System.Collections.Immutable;
|
||||
namespace BD.WTTS.Services.Implementation;
|
||||
|
||||
/// <inheritdoc cref="IWindowManager"/>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Services.WindowManagerService
|
||||
""")]
|
||||
public sealed class AvaloniaWindowManagerImpl : IWindowManagerImpl
|
||||
{
|
||||
Type? IWindowManagerImpl.WindowType => typeof(Window);
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Services.WindowManagerService.GetWindowTopLevel
|
||||
""")]
|
||||
public static TopLevel? GetWindowTopLevel()
|
||||
{
|
||||
if (App.Instance.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
|
||||
+4
@@ -3,6 +3,10 @@ using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace BD.WTTS.Services.Implementation;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
BD.Common8.Essentials.Services.Implementation.AvaloniaClipboardPlatformServiceImpl
|
||||
""")]
|
||||
public sealed class AvaloniaClipboardPlatformService : IClipboardPlatformService
|
||||
{
|
||||
public bool PlatformHasText => !string.IsNullOrEmpty(PlatformGetTextAsync().GetAwaiter().GetResult());
|
||||
|
||||
+4
@@ -5,6 +5,10 @@ using AvaNotificationType = Avalonia.Controls.Notifications.NotificationType;
|
||||
|
||||
namespace BD.WTTS.Services.Implementation;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Services.ToastService
|
||||
""")]
|
||||
[TemplatePart("PART_Items", typeof(Panel))]
|
||||
[PseudoClasses(":topleft", ":topright", ":bottomleft", ":bottomright")]
|
||||
sealed class AvaloniaToastServiceImpl : IToastService
|
||||
|
||||
@@ -8,6 +8,10 @@ using WinUI = Windows.UI.StartScreen;
|
||||
namespace BD.WTTS.Services.Implementation;
|
||||
|
||||
/// <inheritdoc cref="IJumpListService"/>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Services.Platform.Windows.Abstractions.IJumpListService
|
||||
""")]
|
||||
internal sealed class JumpListServiceImpl : IJumpListService
|
||||
{
|
||||
#if WINDOWS
|
||||
|
||||
@@ -6,6 +6,10 @@ using System.Xml.Linq;
|
||||
|
||||
namespace BD.WTTS.Services.Implementation;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.Services.NavigationService
|
||||
""")]
|
||||
public sealed class NavigationService : INavigationService
|
||||
{
|
||||
public static NavigationService Instance { get; } = (NavigationService)Ioc.Get<INavigationService>();
|
||||
@@ -14,6 +18,14 @@ public sealed class NavigationService : INavigationService
|
||||
|
||||
public Type? CurrnetPage => _frame?.CurrentSourcePageType;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
isCreateInstance = true
|
||||
Mobius.Services.NavigationService.GetViewModelToPageContent
|
||||
|
||||
isCreateInstance = false
|
||||
Mobius.Services.NavigationService.GetViewModelToPageContentType
|
||||
""")]
|
||||
public object? GetViewModelToPageContent(object viewModel, bool isCreateInstance = true)
|
||||
{
|
||||
string name;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -7,6 +7,10 @@ using System.Drawing.Drawing2D;
|
||||
|
||||
namespace BD.WTTS.UI;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.App
|
||||
""")]
|
||||
public sealed partial class App : Application
|
||||
{
|
||||
const string TAG = "AvaApp";
|
||||
@@ -233,6 +237,12 @@ public sealed partial class App : Application
|
||||
|
||||
public ICommand OpenBrowserCommand { get; }
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.App.OpenBrowserCommandCore
|
||||
1. 不提示 打开链接失败
|
||||
2. 使用统一的 OpenAuthUrl
|
||||
""")]
|
||||
public async void OpenBrowserCommandCore(object? url)
|
||||
{
|
||||
try
|
||||
@@ -266,6 +276,11 @@ public sealed partial class App : Application
|
||||
|
||||
public ICommand CopyToClipboardCommand { get; }
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.App.OpenBrowserCommandCore
|
||||
1. 不提示 复制内容失败
|
||||
""")]
|
||||
public async void CopyToClipboardCommandCore(object? text)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -5,6 +5,10 @@ using Visual = Avalonia.Visual;
|
||||
|
||||
namespace BD.WTTS.UI;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Animations.Animations
|
||||
""")]
|
||||
public static class Animations
|
||||
{
|
||||
private static readonly Easing DefaultEasing = new LinearEasing();
|
||||
|
||||
@@ -3,6 +3,10 @@ using System.Windows.Input;
|
||||
|
||||
namespace BD.WTTS.UI;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls.Stepper.DelegateInputCommand
|
||||
""")]
|
||||
internal class Command : ICommand
|
||||
{
|
||||
private readonly Action<object?> _onExecute;
|
||||
|
||||
@@ -3,6 +3,10 @@ using FluentAvalonia.UI.Media.Animation;
|
||||
|
||||
namespace BD.WTTS.UI;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Animations.FrameEffect
|
||||
""")]
|
||||
public static class FrameEffect
|
||||
{
|
||||
public static SlideNavigationTransitionEffect GetEffect(int oldIndex, int index)
|
||||
|
||||
@@ -6,6 +6,10 @@ using System.Collections.Specialized;
|
||||
|
||||
namespace BD.WTTS.UI;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Behaviors.ItemDragBehavior
|
||||
""")]
|
||||
public class ItemDragBehavior : Behavior<Control>
|
||||
{
|
||||
private bool _enableDrag;
|
||||
|
||||
@@ -3,6 +3,10 @@ namespace BD.WTTS.UI.Styling;
|
||||
/// <summary>
|
||||
/// Includes the fluent theme in an application.
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Styling.CustomTheme
|
||||
""")]
|
||||
public class CustomTheme : Styles, IResourceProvider
|
||||
{
|
||||
public const string LightModeString = "Light";
|
||||
|
||||
@@ -5,6 +5,10 @@ using FluentAvalonia.UI.Navigation;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages.Abstractions.PageBase
|
||||
""")]
|
||||
public class PageBase : UserControl
|
||||
{
|
||||
public PageBase() : base()
|
||||
@@ -321,6 +325,10 @@ public class PageBase : UserControl
|
||||
private CompositeDisposable _disposables;
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages.Abstractions.PageBase<TViewModel>
|
||||
""")]
|
||||
public class PageBase<TViewModel> : PageBase, IViewFor<TViewModel> where TViewModel : class
|
||||
{
|
||||
public static readonly StyledProperty<TViewModel?> ViewModelProperty = AvaloniaProperty.Register<PageBase<TViewModel>, TViewModel?>(nameof(ViewModel));
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace BD.WTTS.UI.Views.Windows;
|
||||
/// and vice versa.
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">ViewModel type.</typeparam>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Windows.Abstractions.ReactiveAppWindow<TViewModel>
|
||||
""")]
|
||||
public class ReactiveAppWindow<TViewModel> : AppWindow, IViewFor<TViewModel>, IViewFor, IActivatableView where TViewModel : class
|
||||
{
|
||||
public static readonly StyledProperty<TViewModel?> ViewModelProperty = ReactiveWindow<TViewModel>.ViewModelProperty.AddOwner<ReactiveAppWindow<TViewModel>>();
|
||||
|
||||
@@ -4,6 +4,10 @@ using FluentAvalonia.Core;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public partial class AdControl : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -4,6 +4,10 @@ using System.Numerics;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class AppItem : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<string> TitleProperty =
|
||||
|
||||
@@ -4,6 +4,10 @@ using FluentAvalonia.Core;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class ContentLoader : ContentControl
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Input;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public sealed class CustomFilePicker : ContentControl
|
||||
{
|
||||
public static readonly StyledProperty<string?> FileNameProperty = AvaloniaProperty.Register<CustomFilePicker, string?>(nameof(FileName), null);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public enum AlignContent
|
||||
{
|
||||
FlexStart,
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public enum AlignItems
|
||||
{
|
||||
FlexStart,
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public static class Flex
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public readonly struct FlexBasis : IEquatable<FlexBasis>
|
||||
{
|
||||
public double Value { get; }
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public enum FlexBasisKind
|
||||
{
|
||||
Auto,
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public enum FlexDirection
|
||||
{
|
||||
Row,
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public sealed class FlexPanel : Panel
|
||||
{
|
||||
private static readonly Func<Layoutable, int> s_getOrder = x => x is { } y ? Flex.GetOrder(y) : 0;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public enum FlexWrap
|
||||
{
|
||||
NoWrap,
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public enum JustifyContent
|
||||
{
|
||||
FlexStart,
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
internal readonly struct Uv(double u, double v)
|
||||
{
|
||||
public double U { get; } = u;
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Controls;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class OptionsDisplayItem : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<object?> HeaderProperty =
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class PureCircle : Control
|
||||
{
|
||||
public static readonly StyledProperty<double> DiameterProperty = AvaloniaProperty.Register<PureCircle, double>(
|
||||
|
||||
@@ -3,6 +3,10 @@ namespace BD.WTTS.UI.Views.Controls;
|
||||
/// <summary>
|
||||
/// Provide the most simplified shape implementation. This is a rectangle with a background, without border and corner radius.
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class PureRectangle : Control
|
||||
{
|
||||
public static readonly StyledProperty<IBrush?> BackgroundProperty =
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class PureRing : PureCircle
|
||||
{
|
||||
public static readonly StyledProperty<double> InnerDiameterProperty = AvaloniaProperty.Register<PureRing, double>(
|
||||
|
||||
@@ -6,6 +6,10 @@ namespace BD.WTTS.UI.Views.Controls;
|
||||
/// <summary>
|
||||
/// An <see cref="INotificationManager"/> that displays notifications in a <see cref="Window"/>.
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
[TemplatePart("PART_Items", typeof(Panel))]
|
||||
[PseudoClasses(":topleft", ":topright", ":bottomleft", ":bottomright")]
|
||||
public class SnackbarManager : TemplatedControl, IManagedNotificationManager
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Controls;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public partial class SplashScreen : UserControl
|
||||
{
|
||||
public SplashScreen()
|
||||
|
||||
@@ -3,6 +3,10 @@ using BD.Common.Models.Abstractions;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public partial class TitleBar : UserControl
|
||||
{
|
||||
public Image WindowIcon => BarIcon;
|
||||
|
||||
@@ -3,6 +3,10 @@ using FluentAvalonia.Core;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls
|
||||
{
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public partial class CarouselBanner : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -5,6 +5,10 @@ using System.Reactive;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class CarouselItems : ItemsControl
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -5,6 +5,10 @@ namespace BD.WTTS.UI.Views.Controls;
|
||||
/// <summary>
|
||||
/// 固定的 WrapPanel
|
||||
/// </summary>
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class FixedWrapPanel : Panel, INavigableContainer
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -3,6 +3,10 @@ using Avalonia.Controls.Shapes;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class Ripple : Ellipse
|
||||
{
|
||||
private static Easing _easing = new CircularEaseOut();
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Controls.Shapes;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class RippleEffect : ContentControl
|
||||
{
|
||||
// ReSharper disable once InconsistentNaming
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class Skeleton : ContentControl
|
||||
{
|
||||
public static readonly StyledProperty<bool> IsActiveProperty =
|
||||
|
||||
@@ -3,6 +3,10 @@ using Avalonia.Controls.Notifications;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public class Snackbar : InfoBar
|
||||
{
|
||||
private bool _isClosing;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
[TemplatePart("PART_ItemsPresenter", typeof(ItemsPresenter))]
|
||||
[TemplatePart("PART_ProgressBar", typeof(ProgressBar))]
|
||||
public class Stepper : SelectingItemsControl
|
||||
|
||||
@@ -4,6 +4,10 @@ using Avalonia.Controls.Mixins;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
[PseudoClasses(":pressed", ":selected")]
|
||||
public class StepperItem : ContentControl, ISelectable
|
||||
{
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public sealed class TaskDialogEx : TaskDialog
|
||||
{
|
||||
private Button? _closeButton;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Controls;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Controls
|
||||
""")]
|
||||
public sealed partial class WaveProgress : UserControl
|
||||
{
|
||||
public static readonly DirectProperty<WaveProgress, double> ValueProperty =
|
||||
|
||||
@@ -3,6 +3,10 @@ using BD.WTTS.Services;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class AboutPage : ReactiveUserControl<AboutPageViewModel>
|
||||
{
|
||||
public AboutPage()
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class MessageBoxPage : ReactiveUserControl<MessageBoxWindowViewModel>
|
||||
{
|
||||
public MessageBoxPage()
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Markup.Xaml.MarkupExtensions;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class TextInputDialogPage : ReactiveUserControl<TextBoxWindowViewModel>
|
||||
{
|
||||
public TextInputDialogPage()
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Controls;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class DebugPage : PageBase<DebugPageViewModel>
|
||||
{
|
||||
public DebugPage()
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Controls;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class ErrorPage : UserControl
|
||||
{
|
||||
public ErrorPage()
|
||||
|
||||
@@ -2,6 +2,10 @@ using BD.WTTS.Client.Resources;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class HomePage : ReactiveUserControl<HomePageViewModel>
|
||||
{
|
||||
public HomePage()
|
||||
|
||||
@@ -6,6 +6,10 @@ using FluentAvalonia.UI.Navigation;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public sealed partial class MainView : ReactiveUserControl<MainWindowViewModel>
|
||||
{
|
||||
public MainView()
|
||||
|
||||
@@ -3,6 +3,10 @@ using FluentAvalonia.UI.Navigation;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class PluginStorePage : UserControl
|
||||
{
|
||||
public PluginStorePage()
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class SettingsPage : PageBase<SettingsPageViewModel>
|
||||
{
|
||||
public SettingsPage()
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Controls;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class Settings_General : UserControl
|
||||
{
|
||||
public Settings_General()
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Controls;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class Settings_Plugin : ReactiveUserControl<SettingsPageViewModel>
|
||||
{
|
||||
public Settings_Plugin()
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Controls;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class Settings_Steam : UserControl
|
||||
{
|
||||
public Settings_Steam()
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Controls;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class Settings_UI : UserControl
|
||||
{
|
||||
public List<Color> PredefinedColors { get; } = new List<Color>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class LoginOrRegisterPage : ReactiveUserControl<LoginOrRegisterWindowViewModel>
|
||||
{
|
||||
public LoginOrRegisterPage()
|
||||
|
||||
@@ -2,6 +2,10 @@ using Avalonia.Controls;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Pages;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Pages
|
||||
""")]
|
||||
public partial class NoticeFlyout : UserControl
|
||||
{
|
||||
public NoticeFlyout()
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Windows;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Windows
|
||||
""")]
|
||||
public partial class ContentWindow : ReactiveAppWindow<ContentWindowViewModel>
|
||||
{
|
||||
public ContentWindow()
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace BD.WTTS.UI.Views.Windows;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Windows
|
||||
""")]
|
||||
public partial class DebugWindow : Window
|
||||
{
|
||||
public DebugWindow()
|
||||
|
||||
@@ -6,6 +6,10 @@ using static BD.WTTS.Startup;
|
||||
|
||||
namespace BD.WTTS.UI.Views.Windows;
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.Views.Windows.MainWindow
|
||||
""")]
|
||||
public sealed partial class MainWindow : ReactiveAppWindow<MainWindowViewModel>
|
||||
{
|
||||
public MainWindow()
|
||||
@@ -96,6 +100,10 @@ public sealed partial class MainWindow : ReactiveAppWindow<MainWindowViewModel>
|
||||
}
|
||||
}
|
||||
|
||||
[Mobius(
|
||||
"""
|
||||
Mobius.UI.MobiusSplashScreen
|
||||
""")]
|
||||
public sealed class AppSplashScreen : IApplicationSplashScreen
|
||||
{
|
||||
public static bool IsInitialized = false;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user