Skip to content

Commit

Permalink
finish task and publish 0.5.6.0 version
Browse files Browse the repository at this point in the history
finish task and publish 0.5.6.0 version
  • Loading branch information
Gaoyifei1011 committed Oct 3, 2022
1 parent 4611e12 commit ab67b3c
Show file tree
Hide file tree
Showing 67 changed files with 652 additions and 197 deletions.
3 changes: 2 additions & 1 deletion GetStoreApp/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using CommunityToolkit.Mvvm.Messaging;
using GetStoreApp.Contracts.Services.Download;
using GetStoreApp.Contracts.Services.Root;
using GetStoreApp.Extensions.Enum;
using GetStoreApp.Helpers;
using GetStoreApp.Messages;
using GetStoreApp.UI.Controls.Custom;
Expand All @@ -27,7 +28,7 @@ public partial class App : Application
public static WindowEx MainWindow { get; } = new MainWindow();

// 导航页面后使用到的参数
public static string NavigationArgs { get; set; } = string.Empty;
public static AppNaviagtionArgs NavigationArgs { get; set; } = AppNaviagtionArgs.None;

public App()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public object Convert(object value, Type targetType, object parameter, string la
}
else
{
if(File.Exists(FilePath))
if (File.Exists(FilePath))
{
return Visibility.Visible;
}
Expand Down
11 changes: 11 additions & 0 deletions GetStoreApp/Extensions/Enum/AppNaviagtionArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace GetStoreApp.Extensions.Enum
{
public enum AppNaviagtionArgs
{
None = 0,
Home = 1,
Instructions = 2,
SettingsHelp = 3,
DownloadOptions = 4,
}
}
9 changes: 9 additions & 0 deletions GetStoreApp/Extensions/Enum/DeletePrompt.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace GetStoreApp.Extensions.Enum
{
public enum DeletePrompt
{
History = 0,
Download = 1,
DownloadWithFile = 2
}
}
12 changes: 12 additions & 0 deletions GetStoreApp/Extensions/Enum/InAppNotificationContent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace GetStoreApp.Extensions.Enum
{
public enum InAppNotificationContent
{
NetWorkError = 0,
HistoryCopy = 1,
ResultLinkCopy = 2,
ResultIDCopy = 3,
ResultContentCopy = 4,
LanguageSettings = 5
}
}
12 changes: 11 additions & 1 deletion GetStoreApp/GetStoreApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<None Remove="Assets\GetStoreApp.png" />
<None Remove="Assets\Images\CloudflareValidation.png" />
<None Remove="Assets\Logo\GetStoreApp.png" />
<None Remove="LICENSE" />
<None Remove="MainWindow.xaml" />
<None Remove="Styles\Button.xaml" />
<None Remove="Styles\Checkbox.xaml" />
Expand Down Expand Up @@ -75,6 +76,7 @@
<None Remove="UI\Dialogs\DesktopAppsDialog.xaml" />
<None Remove="UI\Dialogs\DownloadNotifyDialog.xaml" />
<None Remove="UI\Dialogs\InstallingNotifyDialog.xaml" />
<None Remove="UI\Dialogs\LicenseDialog.xaml" />
<None Remove="UI\Dialogs\RestartAppsDialog.xaml" />
<None Remove="UI\Dialogs\SelectEmptyPromptDialog.xaml" />
<None Remove="UI\Dialogs\TraceCleanupPromptDialog.xaml" />
Expand Down Expand Up @@ -108,7 +110,9 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5">
<TreatAsUsed>true</TreatAsUsed>
</PackageReference>
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="PInvoke.SHCore" Version="0.7.124" />
<PackageReference Include="System.Management" Version="6.0.0" />
Expand Down Expand Up @@ -270,6 +274,9 @@
<Page Update="UI\Dialogs\InstallingNotifyDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="UI\Dialogs\LicenseDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="UI\Dialogs\RestartAppsDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down Expand Up @@ -339,6 +346,9 @@
<Content Include="Aria2\X86\GetStoreAppAria2.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="LICENSE">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="Assets\Images\CloudflareValidation.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
2 changes: 2 additions & 0 deletions GetStoreApp/Helpers/IOCHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public static void InitializeService()
services.AddTransient<UseInstructionViewModel>();

// 对话框(MVVM)
services.AddTransient<LicenseDialog>();
services.AddTransient<LicenseViewModel>();
services.AddTransient<RestartAppsDialog>();
services.AddTransient<RestartAppsViewModel>();
services.AddTransient<TraceCleanupPromptDialog>();
Expand Down
9 changes: 9 additions & 0 deletions GetStoreApp/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2022 高怡飞

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 changes: 6 additions & 6 deletions GetStoreApp/Models/Home/RequestModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ public string RequestContent
/// <summary>
/// 异常网页请求返回的信息
/// </summary>
public string RequestExpectionContent
public string RequestExceptionContent
{
get { return (string)GetValue(RequestExpectionContentProperty); }
set { SetValue(RequestExpectionContentProperty, value); }
get { return (string)GetValue(RequestExceptionContentProperty); }
set { SetValue(RequestExceptionContentProperty, value); }
}

// Using a DependencyProperty as the backing store for RequestExpectionContent. This enables animation, styling, binding, etc...
public static readonly DependencyProperty RequestExpectionContentProperty =
DependencyProperty.Register("RequestExpectionContent", typeof(string), typeof(RequestModel), new PropertyMetadata(string.Empty));
// Using a DependencyProperty as the backing store for RequestExceptionContent. This enables animation, styling, binding, etc...
public static readonly DependencyProperty RequestExceptionContentProperty =
DependencyProperty.Register("RequestExceptionContent", typeof(string), typeof(RequestModel), new PropertyMetadata(string.Empty));
}
}
9 changes: 5 additions & 4 deletions GetStoreApp/Models/Notification/InAppNotificationModel.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
using GetStoreApp.Models.Base;
using GetStoreApp.Extensions.Enum;
using GetStoreApp.Models.Base;
using Microsoft.UI.Xaml;

namespace GetStoreApp.Models.Notification
{
public class InAppNotificationModel : ModelBase
{
public string NotificationContent
public InAppNotificationContent NotificationContent
{
get { return (string)GetValue(NotificationContentProperty); }
get { return (InAppNotificationContent)GetValue(NotificationContentProperty); }
set { SetValue(NotificationContentProperty, value); }
}

// Using a DependencyProperty as the backing store for NotificationContent. This enables animation, styling, binding, etc...
public static readonly DependencyProperty NotificationContentProperty =
DependencyProperty.Register("NotificationContent", typeof(string), typeof(InAppNotificationModel), new PropertyMetadata(string.Empty));
DependencyProperty.Register("NotificationContent", typeof(InAppNotificationContent), typeof(InAppNotificationModel), new PropertyMetadata(null));

public object[] NotificationValue
{
Expand Down
16 changes: 8 additions & 8 deletions GetStoreApp/Services/Home/HtmlRequestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public class HtmlRequestService

private RequestModel HttpRequestResult;

// 数据的请求状态,0是正常状态,1是网络异常(WebExpection),2是超时异常(TimeOutExpection),3是其他异常(默认值)
// 数据的请求状态,0是正常状态,1是网络异常(WebException),2是超时异常(TimeOutException),3是其他异常(默认值)
private int RequestId = 3;

private string RequestStatusCode = string.Empty;

private string RequestContent = string.Empty;

private string RequestExpectionContent = string.Empty;
private string RequestExceptionContent = string.Empty;

public async Task<RequestModel> HttpRequestAsync(string content)
{
Expand Down Expand Up @@ -65,20 +65,20 @@ public async Task<RequestModel> HttpRequestAsync(string content)
{
RequestId = 1;
RequestStatusCode = Convert.ToString(httpRequestException.StatusCode);
RequestExpectionContent = httpRequestException.Message;
RequestExceptionContent = httpRequestException.Message;
}

// 捕捉因访问超时引发的异常
catch (TaskCanceledException taskCanceledExpection)
catch (TaskCanceledException taskCanceledException)
{
RequestId = 2;
RequestExpectionContent = taskCanceledExpection.Message;
RequestExceptionContent = taskCanceledException.Message;
}

// 其他未知异常
catch (Exception expection)
catch (Exception e)
{
RequestExpectionContent = expection.Message;
RequestExceptionContent = e.Message;
}
finally
{
Expand All @@ -87,7 +87,7 @@ public async Task<RequestModel> HttpRequestAsync(string content)
RequestId = RequestId,
RequestStatusCode = RequestStatusCode,
RequestContent = RequestContent,
RequestExpectionContent = RequestExpectionContent
RequestExceptionContent = RequestExceptionContent
};
}

Expand Down
4 changes: 2 additions & 2 deletions GetStoreApp/Services/Root/AppNotificationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async void OnNotificationInvoked(AppNotificationManager sender, AppNotifi
// 根据点击通知获取到的参数来选择相应的操作
if (ParseArguments(args.Argument)["AppNotifications"] == "DownloadingNow" && NavigationService.Frame.CurrentSourcePageType != typeof(DownloadPage))
{
NavigationService.NavigateTo(typeof(DownloadViewModel).FullName, null, new DrillInNavigationTransitionInfo(),false);
NavigationService.NavigateTo(typeof(DownloadViewModel).FullName, null, new DrillInNavigationTransitionInfo(), false);
}

if (ParseArguments(args.Argument)["AppNotifications"] == "NotDownload" && NavigationService.Frame.CurrentSourcePageType != typeof(DownloadPage))
Expand All @@ -74,7 +74,7 @@ public async void OnNotificationInvoked(AppNotificationManager sender, AppNotifi
{
if (NavigationService.Frame.CurrentSourcePageType != typeof(DownloadPage))
{
NavigationService.NavigateTo(typeof(DownloadViewModel).FullName, null, new DrillInNavigationTransitionInfo(),false);
NavigationService.NavigateTo(typeof(DownloadViewModel).FullName, null, new DrillInNavigationTransitionInfo(), false);
}

//App.NavigationArgs = "DownloadCompleted";
Expand Down
2 changes: 1 addition & 1 deletion GetStoreApp/Services/Shell/NavigationViewService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private void OnItemInvoked(NavigationView sender, NavigationViewItemInvokedEvent

if (selectedItem.GetValue(NavigationHelper.NavigateToProperty) is string pageKey)
{
NavigationService.NavigateTo(pageKey, null, new DrillInNavigationTransitionInfo(),false);
NavigationService.NavigateTo(pageKey, null, new DrillInNavigationTransitionInfo(), false);
}
}
}
Expand Down
24 changes: 24 additions & 0 deletions GetStoreApp/Strings/en-us/About.resw
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AcknowledgeIcon" xml:space="preserve">
<value>Learn about font icon libraries</value>
</data>
<data name="AppInformation" xml:space="preserve">
<value>View app information</value>
</data>
Expand Down Expand Up @@ -216,6 +219,18 @@
<data name="HeaderDescription" xml:space="preserve">
<value>Welcome to download the GetStoreApp.Wish you a pleasant experience</value>
</data>
<data name="IconDisplay" xml:space="preserve">
<value>Abnormal icon display</value>
</data>
<data name="IconDisplayDescription1" xml:space="preserve">
<value>The application uses Segoe Fluent Icons font icon library of Windows system. The font icon library is only pre-installed on Windows 11 or later, not on Windows 10. Therefore, the icon is displayed abnormally on Windows 10.</value>
</data>
<data name="IconDisplayDescription2" xml:space="preserve">
<value>If the font icon is displayed abnormally, you need to download the font icon library separately and right-click the menu to install the font icon library. After the installation is complete, restart the application and the font icon will display properly</value>
</data>
<data name="InstallIcon" xml:space="preserve">
<value>Install the font icon library</value>
</data>
<data name="InstallMode" xml:space="preserve">
<value>Insall mode instructions</value>
</data>
Expand Down Expand Up @@ -243,6 +258,9 @@
<data name="MaintenanceDescription" xml:space="preserve">
<value>At present, the basic functions of the application have been implemented, and the download and offline installation of the application are also included in the future development plan. Subsequent updates are scheduled for an indefinite period of time.</value>
</data>
<data name="Others" xml:space="preserve">
<value>Others</value>
</data>
<data name="PaidApps" xml:space="preserve">
<value>Please download the paid app from the official channel</value>
</data>
Expand Down Expand Up @@ -276,6 +294,12 @@
<data name="SettingsHelp" xml:space="preserve">
<value>Setting options instructions</value>
</data>
<data name="ShowLicense" xml:space="preserve">
<value>Show License</value>
</data>
<data name="ShowReleaseNotes" xml:space="preserve">
<value>Show release notes</value>
</data>
<data name="StartsWithEButton" xml:space="preserve">
<value>Learn about files that begin with ".e"</value>
</data>
Expand Down
23 changes: 16 additions & 7 deletions GetStoreApp/Strings/en-us/Dialog.resw
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,21 @@
<data name="DeleteCancel" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="DeleteContent" xml:space="preserve">
<value>The selected record will be permanently deleted, the operation is irrevocable, please proceed with caution.</value>
</data>
<data name="DeleteContinue" xml:space="preserve">
<value>Continue</value>
</data>
<data name="DeleteDownload" xml:space="preserve">
<value>The selected download records will be permanently deleted, the operation is irrevocable, please proceed with caution.</value>
</data>
<data name="DeleteDownloadWithFile" xml:space="preserve">
<value>The selected download records (including files) will be permanently deleted. This operation cannot be undone. Please exercise caution.</value>
</data>
<data name="DeleteHistory" xml:space="preserve">
<value>The selected history records will be permanently deleted, the operation is irrevocable, please proceed with caution.</value>
</data>
<data name="DeleteTitle" xml:space="preserve">
<value>Delete record</value>
</data>
<data name="DeleteWithFileContent" xml:space="preserve">
<value>Selected records (including files) are permanently deleted, this is irrevocable, so use caution.</value>
</data>
<data name="DesktopAppsContent1" xml:space="preserve">
<value>Microsoft divides the app into two categories of apps in the latest Microsoft Store, one is the Store app, installing and updating the services that depend on the Store; The other type is the classical desktop application, the installation of this type of application is installed independently, when updating, it is updated inside the application, and the store only provides the download service of the application installation package.</value>
</data>
Expand Down Expand Up @@ -210,6 +213,12 @@
<data name="InstallingNotifyTitle" xml:space="preserve">
<value>App installation prompts</value>
</data>
<data name="License" xml:space="preserve">
<value>GetStoreApp License</value>
</data>
<data name="LicenseCloseWindow" xml:space="preserve">
<value>Close window</value>
</data>
<data name="LocalFile" xml:space="preserve">
<value>Locally created files</value>
</data>
Expand Down Expand Up @@ -244,7 +253,7 @@
<value>Item selection prompts</value>
</data>
<data name="TraceCleanupCancel" xml:space="preserve">
<value>Close the window</value>
<value>Close window</value>
</data>
<data name="TraceCleanupContent" xml:space="preserve">
<value>Trace clearing includes history records, download records, and files created locally when an application is downloaded. Select the items you want to clean.</value>
Expand Down
Loading

0 comments on commit ab67b3c

Please sign in to comment.