diff --git a/WindowsTools/Properties/AssemblyInfo.cs b/WindowsTools/Properties/AssemblyInfo.cs index ea13ed8..74f3c60 100644 --- a/WindowsTools/Properties/AssemblyInfo.cs +++ b/WindowsTools/Properties/AssemblyInfo.cs @@ -4,8 +4,8 @@ [assembly: AssemblyCompany("高怡飞")] [assembly: AssemblyCopyright("Copyright ©2024 高怡飞, All Rights Reserved.")] [assembly: AssemblyDescription("Windows 工具箱")] -[assembly: AssemblyFileVersion("2.5.528.0")] -[assembly: AssemblyInformationalVersion("2.5.528.0")] +[assembly: AssemblyFileVersion("2.5.602.0")] +[assembly: AssemblyInformationalVersion("2.5.602.0")] [assembly: AssemblyProduct("Windows 工具箱")] [assembly: AssemblyTitle("Windows 工具箱")] -[assembly: AssemblyVersion("2.5.528.0")] +[assembly: AssemblyVersion("2.5.602.0")] diff --git a/WindowsTools/Services/Controls/Download/BitsService.cs b/WindowsTools/Services/Controls/Download/BitsService.cs index c0f1281..9b79b88 100644 --- a/WindowsTools/Services/Controls/Download/BitsService.cs +++ b/WindowsTools/Services/Controls/Download/BitsService.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Diagnostics.Tracing; using System.IO; -using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using WindowsTools.Services.Root; @@ -129,7 +128,7 @@ public static unsafe void CreateDownload(string url, string saveFilePath) DownloadID = downloadID }; backgroundCopyCallback.StatusChanged += OnStatusChanged; - downloadJob.SetNotifyInterface(new UnknownWrapper(backgroundCopyCallback).WrappedObject); + downloadJob.SetNotifyInterface(backgroundCopyCallback); downloadJob.GetProgress(out BG_JOB_PROGRESS progress); DownloadCreated?.Invoke(backgroundCopyCallback.DownloadID, Path.GetFileName(saveFilePath), saveFilePath, url, progress.BytesTotal is ulong.MaxValue ? 0 : progress.BytesTotal); diff --git a/WindowsTools/Services/Controls/Download/DeliveryOptimizationService.cs b/WindowsTools/Services/Controls/Download/DeliveryOptimizationService.cs index 532aaf5..042eb14 100644 --- a/WindowsTools/Services/Controls/Download/DeliveryOptimizationService.cs +++ b/WindowsTools/Services/Controls/Download/DeliveryOptimizationService.cs @@ -80,7 +80,7 @@ public static void CreateDownload(string url, string saveFilePath) DODownloadStatusCallback doDownloadStatusCallback = new(); doDownloadStatusCallback.StatusChanged += OnStatusChanged; - doDownload.SetProperty(DODownloadProperty.DODownloadProperty_CallbackInterface, new UnknownWrapper(doDownloadStatusCallback).WrappedObject); + doDownload.SetProperty(DODownloadProperty.DODownloadProperty_CallbackInterface, new UnknownWrapper(doDownloadStatusCallback)); doDownload.SetProperty(DODownloadProperty.DODownloadProperty_ForegroundPriority, true); doDownload.GetProperty(DODownloadProperty.DODownloadProperty_Id, out object id); @@ -96,7 +96,7 @@ public static void CreateDownload(string url, string saveFilePath) } } - doDownload.Start(IntPtr.Zero); + int Result = doDownload.Start(IntPtr.Zero); } } catch (Exception e) diff --git a/WindowsTools/Strings/AddDownloadTask.Designer.cs b/WindowsTools/Strings/AddDownloadTask.Designer.cs deleted file mode 100644 index 188d4cc..0000000 --- a/WindowsTools/Strings/AddDownloadTask.Designer.cs +++ /dev/null @@ -1,117 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -namespace WindowsTools.Strings { - using System; - - - /// - /// 一个强类型的资源类,用于查找本地化的字符串等。 - /// - // 此类是由 StronglyTypedResourceBuilder - // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 - // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen - // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class AddDownloadTask { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal AddDownloadTask() { - } - - /// - /// 返回此类使用的缓存的 ResourceManager 实例。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsTools.Strings.AddDownloadTask", typeof(AddDownloadTask).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// 重写当前线程的 CurrentUICulture 属性,对 - /// 使用此强类型资源类的所有资源查找执行重写。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// 查找类似 Add download task 的本地化字符串。 - /// - public static string AddTask { - get { - return ResourceManager.GetString("AddTask", resourceCulture); - } - } - - /// - /// 查找类似 Please input the download file name 的本地化字符串。 - /// - public static string DownloadFileNamePHText { - get { - return ResourceManager.GetString("DownloadFileNamePHText", resourceCulture); - } - } - - /// - /// 查找类似 Select the folder to save 的本地化字符串。 - /// - public static string DownloadFolderPHText { - get { - return ResourceManager.GetString("DownloadFolderPHText", resourceCulture); - } - } - - /// - /// 查找类似 Please input the download link 的本地化字符串。 - /// - public static string DownloadLinkPHText { - get { - return ResourceManager.GetString("DownloadLinkPHText", resourceCulture); - } - } - - /// - /// 查找类似 The file path you entered is invalid. Please try again 的本地化字符串。 - /// - public static string FileNameInvalid { - get { - return ResourceManager.GetString("FileNameInvalid", resourceCulture); - } - } - - /// - /// 查找类似 Select folder 的本地化字符串。 - /// - public static string SelectFolderToolTip { - get { - return ResourceManager.GetString("SelectFolderToolTip", resourceCulture); - } - } - } -} diff --git a/WindowsTools/Strings/AddDownloadTask.en-us.resx b/WindowsTools/Strings/AddDownloadTask.en-us.resx deleted file mode 100644 index d81755c..0000000 --- a/WindowsTools/Strings/AddDownloadTask.en-us.resx +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Add download task - - - Please input the download file name - - - Select the folder to save - - - Please input the download link - - - The file path you entered is invalid. Please try again - - - Select folder - - \ No newline at end of file diff --git a/WindowsTools/Strings/AddDownloadTask.resx b/WindowsTools/Strings/AddDownloadTask.resx deleted file mode 100644 index d81755c..0000000 --- a/WindowsTools/Strings/AddDownloadTask.resx +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Add download task - - - Please input the download file name - - - Select the folder to save - - - Please input the download link - - - The file path you entered is invalid. Please try again - - - Select folder - - \ No newline at end of file diff --git a/WindowsTools/Strings/AddDownloadTask.zh-hans.resx b/WindowsTools/Strings/AddDownloadTask.zh-hans.resx deleted file mode 100644 index 93267f5..0000000 --- a/WindowsTools/Strings/AddDownloadTask.zh-hans.resx +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 添加下载任务 - - - 请输入下载文件名称 - - - 选择保存的文件夹 - - - 请输入下载链接 - - - 您输入的文件路径不合法,请重新输入 - - - 选择文件夹 - - \ No newline at end of file diff --git a/WindowsTools/Strings/DownloadManager.Designer.cs b/WindowsTools/Strings/DownloadManager.Designer.cs index 280a8ac..2b1760b 100644 --- a/WindowsTools/Strings/DownloadManager.Designer.cs +++ b/WindowsTools/Strings/DownloadManager.Designer.cs @@ -60,6 +60,15 @@ internal DownloadManager() { } } + /// + /// 查找类似 Add download task 的本地化字符串。 + /// + public static string AddTask { + get { + return ResourceManager.GetString("AddTask", resourceCulture); + } + } + /// /// 查找类似 Add download task 的本地化字符串。 /// @@ -69,6 +78,15 @@ public static string AddTaskToolTip { } } + /// + /// 查找类似 Cancel 的本地化字符串。 + /// + public static string Cancel { + get { + return ResourceManager.GetString("Cancel", resourceCulture); + } + } + /// /// 查找类似 Downloaded completed 的本地化字符串。 /// @@ -150,6 +168,42 @@ public static string DeleteWithFileToolTip { } } + /// + /// 查找类似 Download 的本地化字符串。 + /// + public static string Download { + get { + return ResourceManager.GetString("Download", resourceCulture); + } + } + + /// + /// 查找类似 Please input the download file name 的本地化字符串。 + /// + public static string DownloadFileNamePHText { + get { + return ResourceManager.GetString("DownloadFileNamePHText", resourceCulture); + } + } + + /// + /// 查找类似 Select the folder to save 的本地化字符串。 + /// + public static string DownloadFolderPHText { + get { + return ResourceManager.GetString("DownloadFolderPHText", resourceCulture); + } + } + + /// + /// 查找类似 Please input the download link 的本地化字符串。 + /// + public static string DownloadLinkPHText { + get { + return ResourceManager.GetString("DownloadLinkPHText", resourceCulture); + } + } + /// /// 查找类似 Download settings 的本地化字符串。 /// @@ -177,6 +231,15 @@ public static string FileInformation { } } + /// + /// 查找类似 The file path you entered is invalid. Please try again 的本地化字符串。 + /// + public static string FileNameInvalid { + get { + return ResourceManager.GetString("FileNameInvalid", resourceCulture); + } + } + /// /// 查找类似 Download completed: 的本地化字符串。 /// @@ -258,6 +321,15 @@ public static string SearchEmptyDescription { } } + /// + /// 查找类似 Select folder 的本地化字符串。 + /// + public static string SelectFolderToolTip { + get { + return ResourceManager.GetString("SelectFolderToolTip", resourceCulture); + } + } + /// /// 查找类似 Share file 的本地化字符串。 /// diff --git a/WindowsTools/Strings/DownloadManager.en-us.resx b/WindowsTools/Strings/DownloadManager.en-us.resx index 70aeeeb..2b82eb8 100644 --- a/WindowsTools/Strings/DownloadManager.en-us.resx +++ b/WindowsTools/Strings/DownloadManager.en-us.resx @@ -117,9 +117,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Add download task + Add download task + + Cancel + Downloaded completed @@ -147,6 +153,18 @@ Local files are deleted when records are deleted + + Download + + + Please input the download file name + + + Select the folder to save + + + Please input the download link + Download settings @@ -156,6 +174,9 @@ View file information + + The file path you entered is invalid. Please try again + Download completed: @@ -183,6 +204,9 @@ No matching download records were found + + Select folder + Share file diff --git a/WindowsTools/Strings/DownloadManager.resx b/WindowsTools/Strings/DownloadManager.resx index 70aeeeb..2b82eb8 100644 --- a/WindowsTools/Strings/DownloadManager.resx +++ b/WindowsTools/Strings/DownloadManager.resx @@ -117,9 +117,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Add download task + Add download task + + Cancel + Downloaded completed @@ -147,6 +153,18 @@ Local files are deleted when records are deleted + + Download + + + Please input the download file name + + + Select the folder to save + + + Please input the download link + Download settings @@ -156,6 +174,9 @@ View file information + + The file path you entered is invalid. Please try again + Download completed: @@ -183,6 +204,9 @@ No matching download records were found + + Select folder + Share file diff --git a/WindowsTools/Strings/DownloadManager.zh-hans.resx b/WindowsTools/Strings/DownloadManager.zh-hans.resx index 3ddcb7b..cba64b2 100644 --- a/WindowsTools/Strings/DownloadManager.zh-hans.resx +++ b/WindowsTools/Strings/DownloadManager.zh-hans.resx @@ -117,9 +117,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 添加下载任务 + 添加下载任务 + + 取消 + 已下载完成 @@ -147,6 +153,18 @@ 删除记录的同时删除本地文件 + + 下载 + + + 请输入下载文件名称 + + + 选择保存的文件夹 + + + 请输入下载链接 + 下载设置 @@ -156,6 +174,9 @@ 查看文件信息 + + 您输入的文件路径不合法,请重新输入 + 已下载完成: @@ -183,6 +204,9 @@ 没有搜索到符合的下载记录 + + 选择文件夹 + 分享文件 diff --git a/WindowsTools/Views/Pages/AddDownloadTaskPage.xaml b/WindowsTools/Views/Pages/AddDownloadTaskPage.xaml deleted file mode 100644 index 1d2470b..0000000 --- a/WindowsTools/Views/Pages/AddDownloadTaskPage.xaml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + +