Skip to content

Commit

Permalink
Finish task and publish 2.4.920.0 version
Browse files Browse the repository at this point in the history
Finish task and publish 2.4.920.0 version
  • Loading branch information
Gaoyifei1011 committed Sep 20, 2023
1 parent 999d802 commit 0477ff7
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion GetStoreApp/GetStoreApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<None Update="Mile.Aria2.conf" CopyToOutputDirectory="Never" />

<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.3" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.230822000" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.230913002" />
<PackageReference Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.5.1572">
<GeneratePathProperty>true</GeneratePathProperty>
<IncludeAssets>none</IncludeAssets>
Expand Down
6 changes: 3 additions & 3 deletions GetStoreApp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// 程序集信息设置
[assembly: AssemblyCopyright("Copyright ©2022-2023 高怡飞, All Rights Reserved.")]
[assembly: AssemblyDescription("获取商店应用")]
[assembly: AssemblyFileVersion("2.3.916.0")]
[assembly: AssemblyInformationalVersion("2.3.916.0")]
[assembly: AssemblyFileVersion("2.4.920.0")]
[assembly: AssemblyInformationalVersion("2.4.920.0")]
[assembly: AssemblyProduct("获取商店应用")]
[assembly: AssemblyTitle("获取商店应用")]
[assembly: AssemblyVersion("2.3.916.0")]
[assembly: AssemblyVersion("2.4.920.0")]

// 设置程序集对COM组件的访问权限
[assembly: ComVisible(false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ private static bool GetAlwaysShowBackdropValue()

if (!alwaysShowBackdropValue.HasValue)
{
SetAlwaysShowBackdrop(DefaultAlwaysShowBackdropValue);
return DefaultAlwaysShowBackdropValue;
}

Expand Down
1 change: 1 addition & 0 deletions GetStoreApp/Services/Controls/Settings/BackdropService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private static GroupOptionsModel GetBackdrop()

if (string.IsNullOrEmpty(backdrop))
{
SetBackdrop(DefaultAppBackdrop);
return DefaultAppBackdrop;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private static async Task<StorageFolder> GetFolderAsync()
{
if (string.IsNullOrEmpty(folder))
{
SetFolder(AppCacheFolder);
return AppCacheFolder;
}
else
Expand All @@ -89,6 +90,7 @@ private static int GetItem()

if (!downloadItemValue.HasValue)
{
SetItem(DefaultItem);
return DefaultItem;
}

Expand All @@ -104,6 +106,7 @@ private static GroupOptionsModel GetMode()

if (string.IsNullOrEmpty(downloadMode))
{
SetMode(DefaultDownloadMode);
return DownloadModeList.Find(item => item.SelectedValue.Equals(DefaultDownloadMode.SelectedValue, StringComparison.OrdinalIgnoreCase));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ private static GroupOptionsModel GetHistoryLiteNum()

if (string.IsNullOrEmpty(historyLiteNumValue))
{
SetHistoryLiteNum(DefaultHistoryLiteNum);
return HistoryLiteNumList.Find(item => item.SelectedValue == DefaultHistoryLiteNum.SelectedValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ private static GroupOptionsModel GetInstallMode()

if (string.IsNullOrEmpty(installMode))
{
SetInstallMode(DefaultInstallMode);
return InstallModeList.Find(item => item.SelectedValue.Equals(DefaultInstallMode.SelectedValue, StringComparison.OrdinalIgnoreCase));
}

Expand Down
20 changes: 8 additions & 12 deletions GetStoreApp/Services/Controls/Settings/LanguageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,13 @@ public static void InitializeLanguage()

DefaultAppLanguage = LanguageList.Find(item => item.SelectedValue.Equals("en-US", StringComparison.OrdinalIgnoreCase));

(bool, GroupOptionsModel) LanguageValueResult = GetLanguage();

AppLanguage = LanguageValueResult.Item2;

if (LanguageValueResult.Item1)
{
SetLanguage(AppLanguage, false);
}
AppLanguage = GetLanguage();
}

/// <summary>
/// 获取设置存储的语言值,如果设置没有存储,使用默认值
/// </summary>
private static (bool, GroupOptionsModel) GetLanguage()
private static GroupOptionsModel GetLanguage()
{
string language = ConfigService.ReadSetting<string>(SettingsKey);

Expand All @@ -93,17 +86,20 @@ private static (bool, GroupOptionsModel) GetLanguage()
// 如果存在,设置存储值和应用初次设置的语言为当前系统的语言
if (result)
{
return (true, LanguageList.Find(item => item.SelectedValue.Equals(CurrentSystemLanguage, StringComparison.OrdinalIgnoreCase)));
GroupOptionsModel currentSystemLanguage = LanguageList.Find(item => item.SelectedValue.Equals(CurrentSystemLanguage, StringComparison.OrdinalIgnoreCase));
SetLanguage(currentSystemLanguage);
return currentSystemLanguage;
}

// 不存在,设置存储值和应用初次设置的语言为默认语言:English(United States)
else
{
return (true, LanguageList.Find(item => item.SelectedValue.Equals(DefaultAppLanguage.SelectedValue, StringComparison.OrdinalIgnoreCase)));
SetLanguage(DefaultAppLanguage);
return LanguageList.Find(item => item.SelectedValue.Equals(DefaultAppLanguage.SelectedValue, StringComparison.OrdinalIgnoreCase));
}
}

return (false, LanguageList.Find(item => item.SelectedValue.Equals(language, StringComparison.OrdinalIgnoreCase)));
return LanguageList.Find(item => item.SelectedValue.Equals(language, StringComparison.OrdinalIgnoreCase));
}

/// <summary>
Expand Down
12 changes: 7 additions & 5 deletions GetStoreApp/Services/Controls/Settings/LinkFilterService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,25 @@ public static class LinkFilterService
/// </summary>
public static void InitializeLinkFilterValue()
{
EncryptedPackageFilterValue = GetStartWithEFilterValue();
EncryptedPackageFilterValue = GetEncryptedPackageFilterValue();

BlockMapFilterValue = GetBlockMapFilterValue();
}

/// <summary>
/// 获取设置存储的加密包显示设置的过滤值,如果设置没有存储,使用默认值
/// </summary>
private static bool GetStartWithEFilterValue()
private static bool GetEncryptedPackageFilterValue()
{
bool? startWithEFilterValue = ConfigService.ReadSetting<bool?>(EncryptedPackageSettingsKey);
bool? encryptedPackageFilterValue = ConfigService.ReadSetting<bool?>(EncryptedPackageSettingsKey);

if (!startWithEFilterValue.HasValue)
if (!encryptedPackageFilterValue.HasValue)
{
SetEncryptedPackageFilterValue(DefaultLinkFilterValue);
return DefaultLinkFilterValue;
}

return Convert.ToBoolean(startWithEFilterValue);
return Convert.ToBoolean(encryptedPackageFilterValue);
}

/// <summary>
Expand All @@ -53,6 +54,7 @@ private static bool GetBlockMapFilterValue()

if (!blockMapFilterValue.HasValue)
{
SetBlockMapFilterValue(DefaultLinkFilterValue);
return DefaultLinkFilterValue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ private static bool GetNetWorkMonitorValue()

if (!netWorkMonitorValue.HasValue)
{
SetNetWorkMonitorValue(DefaultNetWorkMonitorValue);
return DefaultNetWorkMonitorValue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ private static bool GetNotification()

if (!appNotification.HasValue)
{
SetNotification(DefaultAppNotification);
return DefaultAppNotification;
}

Expand Down
23 changes: 6 additions & 17 deletions GetStoreApp/Services/Controls/Settings/ThemeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,43 +29,32 @@ public static void InitializeTheme()

DefaultAppTheme = ThemeList.Find(item => item.SelectedValue == nameof(ElementTheme.Default));

(bool, GroupOptionsModel) ThemeResult = GetTheme();

AppTheme = ThemeResult.Item2;

if (ThemeResult.Item1)
{
SetTheme(AppTheme, false);
}
AppTheme = GetTheme();
}

/// <summary>
/// 获取设置存储的主题值,如果设置没有存储,使用默认值
/// </summary>
private static (bool, GroupOptionsModel) GetTheme()
private static GroupOptionsModel GetTheme()
{
string theme = ConfigService.ReadSetting<string>(ThemeSettingsKey);

if (string.IsNullOrEmpty(theme))
{
return (true, DefaultAppTheme);
SetTheme(DefaultAppTheme);
return DefaultAppTheme;
}

GroupOptionsModel selectedTheme = ThemeList.Find(item => item.SelectedValue.Equals(theme, StringComparison.OrdinalIgnoreCase));

return selectedTheme is null ? (true, DefaultAppTheme) : (false, ThemeList.Find(item => item.SelectedValue.Equals(theme, StringComparison.OrdinalIgnoreCase)));
return selectedTheme is null ? DefaultAppTheme : ThemeList.Find(item => item.SelectedValue.Equals(theme, StringComparison.OrdinalIgnoreCase));
}

/// <summary>
/// 应用主题发生修改时修改设置存储的主题值
/// </summary>
public static void SetTheme(GroupOptionsModel theme, bool isNotFirstSet = true)
public static void SetTheme(GroupOptionsModel theme)
{
if (isNotFirstSet)
{
AppTheme = theme;
}

ConfigService.SaveSetting(ThemeSettingsKey, theme.SelectedValue);
}

Expand Down
1 change: 1 addition & 0 deletions GetStoreApp/Services/Controls/Settings/TopMostService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ private static bool GetTopMostValue()

if (!topMostValue.HasValue)
{
SetTopMostValue(DefaultTopMostValue);
return DefaultTopMostValue;
}

Expand Down
2 changes: 2 additions & 0 deletions GetStoreApp/Services/Controls/Settings/WinGetConfigService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private static bool GetUseDevVersion()

if (!useDevVersion.HasValue)
{
SetUseDevVersion(DefaultUseDevVersion);
return DefaultUseDevVersion;
}

Expand All @@ -74,6 +75,7 @@ private static GroupOptionsModel GetWinGetInstallMode()

if (string.IsNullOrEmpty(winGetInstallMode))
{
SetWinGetInstallMode(DefaultWinGetInstallMode);
return WinGetInstallModeList.Find(item => item.SelectedValue.Equals(DefaultWinGetInstallMode.SelectedValue, StringComparison.OrdinalIgnoreCase));
}

Expand Down
2 changes: 1 addition & 1 deletion GetStoreApp/Views/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
IsOn="{x:Bind EncryptedPackageFilterValue, Mode=OneWay}"
OffContent="{x:Bind root:ResourceService.GetLocalized('Settings/EncryptedPackageOffContent')}"
OnContent="{x:Bind root:ResourceService.GetLocalized('Settings/EncryptedPackageOnContent')}"
Toggled="{x:Bind OnStartWithEToggled}" />
Toggled="{x:Bind OnEncryptedPackageToggled}" />
</Grid>
</StackPanel>

Expand Down
2 changes: 1 addition & 1 deletion GetStoreApp/Views/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ public void OnNotificationToggled(object sender, RoutedEventArgs args)
/// <summary>
/// 设置是否过滤加密包文件
/// </summary>
public void OnStartWithEToggled(object sender, RoutedEventArgs args)
public void OnEncryptedPackageToggled(object sender, RoutedEventArgs args)
{
ToggleSwitch toggleSwitch = sender as ToggleSwitch;
if (toggleSwitch is not null)
Expand Down
4 changes: 2 additions & 2 deletions GetStoreApp/WindowsAPI/PInvoke/Kernel32/Kernel32Library.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public static partial bool CreateProcess(
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ReadConsole(
IntPtr hConsoleInput,
byte[] lpBuffer,
[In][Out] byte[] lpBuffer,
int nNumberOfCharsToRead,
out int lpNumberOfCharsRead,
IntPtr pInputControl);
Expand Down Expand Up @@ -279,7 +279,7 @@ public static partial bool ReadConsole(
/// <returns>如果函数成功,则返回值为非零 (TRUE) 。如果函数失败或异步完成,则返回值为零,(FALSE) </returns>
[LibraryImport(Kernel32, EntryPoint = "ReadFile", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ReadFile(IntPtr hFile, byte[] lpBuffer, uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead, IntPtr lpOverlapped);
public static partial bool ReadFile(IntPtr hFile, [In][Out] byte[] lpBuffer, uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead, IntPtr lpOverlapped);

/// <summary>
/// 设置由 WriteFile 或 WriteConsole 函数写入控制台屏幕缓冲区或由 ReadFile 或 ReadConsole 函数回显的字符的属性。 此函数会影响函数调用后写入的文本。
Expand Down
2 changes: 1 addition & 1 deletion GetStoreAppPackage/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Identity
Name="Gaoyifei1011.GetStoreApp"
Publisher="CN=高怡飞"
Version="2.3.916.0" />
Version="2.4.920.0" />

<Properties>
<DisplayName>ms-resource:PackageDisplayName</DisplayName>
Expand Down

0 comments on commit 0477ff7

Please sign in to comment.