Skip to content

Commit

Permalink
Project adjustment
Browse files Browse the repository at this point in the history
Project adjustment
  • Loading branch information
Gaoyifei1011 committed Aug 26, 2023
1 parent f0d3f63 commit 94a6a60
Show file tree
Hide file tree
Showing 144 changed files with 3,889 additions and 4,601 deletions.
8 changes: 4 additions & 4 deletions GetStoreApp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using GetStoreApp.Extensions.DataType.Enums;
using GetStoreApp.Helpers.Root;
using GetStoreApp.Services.Controls.Download;
using GetStoreApp.Services.Controls.Settings.Appearance;
using GetStoreApp.Services.Controls.Settings;
using GetStoreApp.Services.Root;
using GetStoreApp.Views.Windows;
using GetStoreApp.WindowsAPI.PInvoke.Kernel32;
Expand Down Expand Up @@ -113,13 +113,13 @@ public void OnUnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExcep
// 系统背景色弹出的异常,不进行处理
if (args.Exception.HResult is -2147024809 && args.Exception.StackTrace.Contains("SystemBackdropConfiguration"))
{
LogService.WriteLog(LogType.WARNING, "System backdrop config warning.", args.Exception);
LogService.WriteLog(LogLevel.WARNING, "System backdrop config warning.", args.Exception);
return;
}
// 处理其他异常
else
{
LogService.WriteLog(LogType.ERROR, "Unknown unhandled exception.", args.Exception);
LogService.WriteLog(LogLevel.ERROR, "Unknown unhandled exception.", args.Exception);

// 退出应用
Dispose();
Expand Down Expand Up @@ -232,7 +232,7 @@ private void CloseApp()
/// </summary>
private void SaveWindowInformation()
{
ConfigService.SaveSetting(ConfigKey.IsWindowMaximizedKey, MainWindow.AppTitlebar.IsWindowMaximized);
ConfigService.SaveSetting(ConfigKey.IsWindowMaximizedKey, MainWindow.IsWindowMaximized);
ConfigService.SaveSetting(ConfigKey.WindowWidthKey, MainWindow.AppWindow.Size.Width);
ConfigService.SaveSetting(ConfigKey.WindowHeightKey, MainWindow.AppWindow.Size.Height);
ConfigService.SaveSetting(ConfigKey.WindowPositionXAxisKey, MainWindow.AppWindow.Position.X);
Expand Down
2 changes: 1 addition & 1 deletion GetStoreApp/Extensions/DataType/Constant/ConfigKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static class ConfigKey

public const string NotificationKey = "AppNotification";

public const string StartsWithEFilterKey = "StartsWithEFilterValue";
public const string EncryptedPackageFilterKey = "EncryptedPackageFilterValue";

public const string ThemeKey = "AppTheme";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
/// <summary>
/// 应用排序规则
/// </summary>
public enum AppListRuleSeletedType
public enum AppSortRuleKind
{
PackageName = 0,
DisplayName = 0,
PublisherName = 1,
InstallDate = 2
}
Expand Down
11 changes: 11 additions & 0 deletions GetStoreApp/Extensions/DataType/Enums/ChannelKind.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace GetStoreApp.Extensions.DataType.Enums
{
public enum ChannelKind
{
WIF = 0,
WIS = 1,
RP = 2,
Retail = 3,
None = 4
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// 痕迹清理枚举值
/// </summary>
public enum CleanArgs
public enum CleaKind
{
ActionCenter = 0,
Download = 1,
Expand Down
11 changes: 0 additions & 11 deletions GetStoreApp/Extensions/DataType/Enums/ConsoleLaunchModeArgs.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// 数据复制类型
/// </summary>
public enum DataCopyType
public enum DataCopyKind
{
AppInformation = 0,
AppUserModelId = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// 历史记录删除方式枚举值
/// </summary>
public enum DeleteArgs
public enum DeleteKind
{
History = 0,
Download = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// 重复数据参数枚举值
/// </summary>
public enum DuplicatedDataInfoArgs
public enum DuplicatedDataKind
{
None = 0,
Unfinished = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// 日志输出级别
/// </summary>
public enum LogType
public enum LogLevel
{
DEBUG = 0,
INFO = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// 需要发送的消息类型
/// </summary>
public enum MessageType : uint
public enum MessageKind : uint
{
None = 0,
Normal = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// 应用通知参数
/// </summary>
public enum NotificationArgs
public enum NotificationKind
{
DownloadAborted = 0,
InstallApp = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace GetStoreApp.Extensions.DataType.Enums
/// 应用包签名类型
/// </summary>
[Flags]
public enum PackageSignType
public enum PackageSignKind
{
/// <summary>
/// 该包未签名。 例如,从布局运行的 Visual Studio 项目 (F5) 。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
/// <summary>
/// 快捷操作枚举值
/// </summary>
public enum QuickOperationType
public enum QuickOperationKind
{
DesktopShortcut = 0,
Desktop = 0,
StartScreen = 1,
Taskbar = 2,
}
Expand Down
11 changes: 11 additions & 0 deletions GetStoreApp/Extensions/DataType/Enums/TypeKind.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace GetStoreApp.Extensions.DataType.Enums
{
public enum TypeKind
{
URL = 0,
ProductId = 1,
PackageFamilyName = 2,
CategoryId = 3,
None = 4
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// WinGet 复制命令枚举值
/// </summary>
public enum WinGetOptionArgs
public enum WinGetOptionKind
{
SearchInstall = 0,
UnInstall = 1,
Expand Down
64 changes: 1 addition & 63 deletions GetStoreApp/GetStoreApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,44 +123,12 @@
<None Remove="Styles\ScrollBar.xaml" />
<None Remove="Styles\SplitButton.xaml" />

<None Remove="UI\Controls\About\HeaderControl.xaml" />
<None Remove="UI\Controls\About\InstructionsControl.xaml" />
<None Remove="UI\Controls\About\IntroductionControl.xaml" />
<None Remove="UI\Controls\About\PrecautionControl.xaml" />
<None Remove="UI\Controls\About\ReferenceControl.xaml" />
<None Remove="UI\Controls\About\SettingsHelpControl.xaml" />
<None Remove="UI\Controls\About\ThanksControl.xaml" />

<None Remove="UI\Controls\Download\CompletedControl.xaml" />
<None Remove="UI\Controls\Download\DownloadingControl.xaml" />
<None Remove="UI\Controls\Download\UnfinishedControl.xaml" />

<None Remove="UI\Controls\Settings\Advanced\ExperimentalFeaturesControl.xaml" />
<None Remove="UI\Controls\Settings\Advanced\InstallModeControl.xaml" />
<None Remove="UI\Controls\Settings\Advanced\LogControl.xaml" />
<None Remove="UI\Controls\Settings\Advanced\TraceCleanupControl.xaml" />

<None Remove="UI\Controls\Settings\Appearance\AlwaysShowBackdropControl.xaml" />
<None Remove="UI\Controls\Settings\Appearance\BackdropControl.xaml" />
<None Remove="UI\Controls\Settings\Appearance\LanguageControl.xaml" />
<None Remove="UI\Controls\Settings\Appearance\ThemeControl.xaml" />
<None Remove="UI\Controls\Settings\Appearance\TopMostControl.xaml" />

<None Remove="UI\Controls\Settings\Common\DownloadOptionsControl.xaml" />
<None Remove="UI\Controls\Settings\Common\HistoryRecordControl.xaml" />
<None Remove="UI\Controls\Settings\Common\LinkFilterControl.xaml" />
<None Remove="UI\Controls\Settings\Common\NotificationControl.xaml" />
<None Remove="UI\Controls\Settings\Common\RegionControl.xaml" />
<None Remove="UI\Controls\Settings\Common\WinGetConfigControl.xaml" />

<None Remove="UI\Controls\Settings\Experiment\NetWorkMonitorControl.xaml" />
<None Remove="UI\Controls\Settings\Experiment\OpenConfigFileControl.xaml" />

<None Remove="UI\Controls\Window\AppTitleBarControl.xaml" />

<None Remove="UI\Controls\WinGet\InstalledAppsControl.xaml" />
<None Remove="UI\Controls\WinGet\SearchAppsControl.xaml" />
<None Remove="UI\Controls\WinGet\InitializeFailedControl.xaml" />
<None Remove="UI\Controls\WinGet\UpgradableAppsControl.xaml" />

<None Remove="UI\Dialogs\About\AppInformationDialog.xaml" />
Expand Down Expand Up @@ -230,44 +198,14 @@
<Page Update="Styles\ScrollBar.xaml" Generator="MSBuild:Compile" />
<Page Update="Styles\SplitButton.xaml" Generator="MSBuild:Compile" />

<Page Update="UI\Controls\About\HeaderControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\About\InstructionsControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\About\IntroductionControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\About\PrecautionControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\About\ReferenceControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\About\SettingsHelpControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\About\ThanksControl.xaml" Generator="MSBuild:Compile" />

<Page Update="UI\Controls\Download\CompletedControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Download\DownloadingControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Download\UnfinishedControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Advanced\ExperimentalFeaturesControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Advanced\InstallModeControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Advanced\LogControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Advanced\TraceCleanupControl.xaml" Generator="MSBuild:Compile" />

<Page Update="UI\Controls\Settings\Appearance\AlwaysShowBackdropControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Appearance\BackdropControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Appearance\LanguageControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Appearance\ThemeControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Appearance\TopMostControl.xaml" Generator="MSBuild:Compile" />

<Page Update="UI\Controls\Settings\Common\DownloadOptionsControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Common\HistoryRecordControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Common\LinkFilterControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Common\NotificationControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Common\WinGetConfigControl.xaml" Generator="MSBuild:Compile" />

<Page Update="UI\Controls\Settings\Experiment\NetWorkMonitorControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\Settings\Experiment\OpenConfigFileControl.xaml" Generator="MSBuild:Compile" />

<Page Update="UI\Controls\WinGet\InitializeFailedControl.xaml" Generator="MSBuild:Compile" />

<Page Update="UI\Controls\WinGet\InstalledAppsControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\WinGet\SearchAppsControl.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Controls\WinGet\UpgradableAppsControl.xaml" Generator="MSBuild:Compile" />

<Page Update="UI\Controls\Window\AppTitleBarControl.xaml" Generator="MSBuild:Compile" />

<Page Update="UI\Dialogs\About\AppInformationDialog.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Dialogs\About\ConsoleStartupArgsDialog.xaml" Generator="MSBuild:Compile" />
<Page Update="UI\Dialogs\About\DesktopAppsDialog.xaml" Generator="MSBuild:Compile" />
Expand Down
6 changes: 3 additions & 3 deletions GetStoreApp/Helpers/Controls/Download/Aria2ProcessHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static unsafe bool RunAria2Process(string fileName, string arguments = ""
}
catch (Exception e)
{
LogService.WriteLog(LogType.ERROR, "Aria2 Process create failed.", e);
LogService.WriteLog(LogLevel.ERROR, "Aria2 Process create failed.", e);
return false;
}
}
Expand All @@ -69,7 +69,7 @@ public static void KillAria2Process()
}
catch (Exception e)
{
LogService.WriteLog(LogType.ERROR, "Aria2 Process kill failed.", e);
LogService.WriteLog(LogLevel.ERROR, "Aria2 Process kill failed.", e);
return;
}
}
Expand Down Expand Up @@ -103,7 +103,7 @@ public static bool IsAria2ProcessExisted()
}
catch (Exception e)
{
LogService.WriteLog(LogType.ERROR, "Aria2 Process search failed.", e);
LogService.WriteLog(LogLevel.ERROR, "Aria2 Process search failed.", e);
SearchResult = false;
}
return SearchResult;
Expand Down
8 changes: 4 additions & 4 deletions GetStoreApp/Helpers/Controls/Store/HtmlRequestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static async Task<RequestModel> HttpRequestAsync(string content)
responseSuccessBuilder.Append(response.RequestMessage is null ? "" : LogService.WhiteSpaceRegex.Replace(response.RequestMessage.ToString(), ""));
responseSuccessBuilder.Append('\n');

LogService.WriteLog(LogType.INFO, "Requested successfully.", responseSuccessBuilder);
LogService.WriteLog(LogLevel.INFO, "Requested successfully.", responseSuccessBuilder);
}

// 请求失败
Expand All @@ -86,7 +86,7 @@ public static async Task<RequestModel> HttpRequestAsync(string content)
RequestStatusCode = string.Empty;
RequestExceptionContent = e.Message;
RequestContent = string.Empty;
LogService.WriteLog(LogType.WARNING, "Network disconnected.", e);
LogService.WriteLog(LogLevel.WARNING, "Network disconnected.", e);
}

// 捕捉因访问超时引发的异常
Expand All @@ -96,7 +96,7 @@ public static async Task<RequestModel> HttpRequestAsync(string content)
RequestStatusCode = string.Empty;
RequestExceptionContent = e.Message;
RequestContent = string.Empty;
LogService.WriteLog(LogType.WARNING, "Network access timeout.", e);
LogService.WriteLog(LogLevel.WARNING, "Network access timeout.", e);
}

// 其他异常
Expand All @@ -106,7 +106,7 @@ public static async Task<RequestModel> HttpRequestAsync(string content)
RequestStatusCode = string.Empty;
RequestExceptionContent = e.Message;
RequestContent = string.Empty;
LogService.WriteLog(LogType.WARNING, "Network state unknown.", e);
LogService.WriteLog(LogLevel.WARNING, "Network state unknown.", e);
}
finally
{
Expand Down
2 changes: 1 addition & 1 deletion GetStoreApp/Helpers/Converters/StringConverterHelper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GetStoreApp.Helpers.Root;
using GetStoreApp.Services.Controls.Settings.Common;
using GetStoreApp.Services.Controls.Settings;
using GetStoreApp.Services.Root;
using System;
using System.Collections.Generic;
Expand Down
4 changes: 2 additions & 2 deletions GetStoreApp/Helpers/Root/IOHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static bool CleanFolder(StorageFolder folder)
}
catch (Exception e)
{
LogService.WriteLog(LogType.ERROR, "Folder delete failed.", e);
LogService.WriteLog(LogLevel.ERROR, "Folder delete failed.", e);
return false;
}
}
Expand Down Expand Up @@ -85,7 +85,7 @@ public static async Task<string> GetFileSHA1Async(string filePath)
}
catch (Exception e)
{
LogService.WriteLog(LogType.WARNING, "File SHA1 verify failed.", e);
LogService.WriteLog(LogLevel.WARNING, "File SHA1 verify failed.", e);
return string.Empty;
}
}
Expand Down
2 changes: 1 addition & 1 deletion GetStoreApp/Helpers/Root/ProcessHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static unsafe List<uint> GetProcessPIDByName(string processName)
}
catch (Exception e)
{
LogService.WriteLog(LogType.ERROR, "Get process Pid list failed.", e);
LogService.WriteLog(LogLevel.ERROR, "Get process Pid list failed.", e);
return ProcessEntry32PIDList;
}
}
Expand Down
2 changes: 1 addition & 1 deletion GetStoreApp/Models/Dialogs/Settings/TraceCleanupModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public bool IsCleanFailed
/// <summary>
/// 清理选项内部的名称
/// </summary>
public CleanArgs InternalName { get; set; }
public CleaKind InternalName { get; set; }

/// <summary>
/// 清理失败时详细的错误文字信息
Expand Down
5 changes: 1 addition & 4 deletions GetStoreApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using GetStoreApp.Helpers.Root;
using GetStoreApp.Properties;
using GetStoreApp.Services.Controls.Download;
using GetStoreApp.Services.Controls.Settings.Advanced;
using GetStoreApp.Services.Controls.Settings.Appearance;
using GetStoreApp.Services.Controls.Settings.Common;
using GetStoreApp.Services.Controls.Settings.Experiment;
using GetStoreApp.Services.Controls.Settings;
using GetStoreApp.Services.Root;
using GetStoreApp.WindowsAPI.PInvoke.Kernel32;
using Microsoft.UI.Dispatching;
Expand Down
Loading

0 comments on commit 94a6a60

Please sign in to comment.