Skip to content

Commit

Permalink
Finish task and publish 2.6.627.0 version
Browse files Browse the repository at this point in the history
1.Finish task and publish 2.6.627.0 version
2.Add loopback manager page
3.Simplify the code: Use conditional expressions for some if else
4.Fix some bugs
  • Loading branch information
Gaoyifei1011 committed Jun 27, 2024
1 parent 91c41ab commit d394e1b
Show file tree
Hide file tree
Showing 79 changed files with 810 additions and 293 deletions.
1 change: 1 addition & 0 deletions Description/README_EN-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ A toolbox that integrates multiple gadgets.
| System information | Unfinished |
| Driver manager | Unfinished |
| Update manager | Unfinished |
| Loopback manager | Finished |
| Windows system assessment tool | Finished |

------
Expand Down
1 change: 1 addition & 0 deletions Description/README_ZH-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
| 系统信息 | 未完成 |
| 驱动管理 | 未完成 |
| 更新管理 | 未完成 |
| 网络回环管理 | 已完成 |
| Windows 系统评估 | 已完成 |

------
Expand Down
3 changes: 2 additions & 1 deletion Description/StudyReferenceCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
> * [ExplorerExtensions.Sample](https://github.com/cnbluefire/ExplorerExtensions.Sample) 
> * [Generating valid tokens to access Limited Access Features in Windows 10](https://www.withinrafael.com/2021/01/04/generating-valid-tokens-to-access-limited-access-features-in-windows-10) 
> * [Loaf](https://github.com/DinoChan/Loaf) 
> * [Mile.Xaml.Samples](https://github.com/ProjectMile/Mile.Xaml.Samples) 
> * [Mile.Xaml.Samples](https://github.com/ProjectMile/Mile.Xaml.Samples) 
> * [UWP-Loopback-Exemption-Manager](https://github.com/themerror/UWP-Loopback-Exemption-Manager) 
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
| 系统信息 | 未完成 |
| 驱动管理 | 未完成 |
| 更新管理 | 未完成 |
| 网络回环管理 | 已完成 |
| Windows 系统评估 | 已完成 |

------
Expand Down
2 changes: 2 additions & 0 deletions WindowsTools/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ protected virtual void Dispose(bool disposing)
if (disposing)
{
this.ThreadUninitialize();

if (MainWindow.Current is not null && !MainWindow.Current.IsDisposed)
{
MainWindow.Current?.Close();
}

GlobalNotificationService.SendNotification();
DownloadSchedulerService.TerminateDownload();
DownloadSchedulerService.CloseDownloadScheduler();
SystemTrayService.CloseSystemTray();
Expand Down
9 changes: 1 addition & 8 deletions WindowsTools/Helpers/Converters/ValueConverterHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,7 @@ public static Visibility IntToVisibilityReverseConvert(int value)
/// </summary>
public static Visibility StringToVisibilityConvert(string value)
{
if (string.IsNullOrEmpty(value))
{
return Visibility.Collapsed;
}
else
{
return Visibility.Visible;
}
return string.IsNullOrEmpty(value) ? Visibility.Collapsed : Visibility.Visible;
}

/// <summary>
Expand Down
18 changes: 2 additions & 16 deletions WindowsTools/Helpers/Root/CopyPasteHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,7 @@ public static Image ReadClipboardImage()
else if (iData.GetDataPresent(DataFormats.FileDrop))
{
StringCollection files = Clipboard.GetFileDropList();
if (files.Count is 0)
{
return null;
}
else
{
return Image.FromFile(files[0]);
}
return files.Count is 0 ? null : Image.FromFile(files[0]);
}
else if (iData.GetDataPresent(DataFormats.Text))
{
Expand All @@ -62,14 +55,7 @@ public static Image ReadClipboardImage()
{
return null;
}
if (File.Exists(path))
{
return Image.FromFile(path);
}
else
{
return null;
}
return File.Exists(path) ? Image.FromFile(path) : null;
}
else
{
Expand Down
16 changes: 8 additions & 8 deletions WindowsTools/Models/LoopbackModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ public Visibility IsVisible
}
}

private bool _isChecked;
private bool _isSelected;

public bool IsChecked
public bool IsSelected
{
get { return _isChecked; }
get { return _isSelected; }

set
{
if (!Equals(_isChecked, value))
if (!Equals(_isSelected, value))
{
_isChecked = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsChecked)));
_isSelected = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsSelected)));
}
}
}
Expand All @@ -46,7 +46,7 @@ public bool IsChecked
/// <summary>
/// 应用程序运行的二进制路径
/// </summary>
public string[] StringBinaries { get; set; }
public string[] AppBinariesPath { get; set; }

/// <summary>
/// 应用容器的全局唯一名称
Expand All @@ -73,7 +73,7 @@ public bool IsChecked
/// <summary>
/// 应用容器所属用户的名称
/// </summary>
public string UserAccountSIDName { get; set; }
public string AppContainerUserName { get; set; }

/// <summary>
/// 应用容器的包标识符
Expand Down
6 changes: 3 additions & 3 deletions WindowsTools/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[assembly: AssemblyCompany("高怡飞")]
[assembly: AssemblyCopyright("Copyright ©2024 高怡飞, All Rights Reserved.")]
[assembly: AssemblyDescription("Windows 工具箱")]
[assembly: AssemblyFileVersion("2.6.626.0")]
[assembly: AssemblyInformationalVersion("2.6.626.0")]
[assembly: AssemblyFileVersion("2.6.627.0")]
[assembly: AssemblyInformationalVersion("2.6.627.0")]
[assembly: AssemblyProduct("Windows 工具箱")]
[assembly: AssemblyTitle("Windows 工具箱")]
[assembly: AssemblyVersion("2.6.626.0")]
[assembly: AssemblyVersion("2.6.627.0")]
2 changes: 1 addition & 1 deletion WindowsTools/Services/Controls/Download/BitsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static unsafe void CreateDownload(string url, string saveFilePath)
DownloadID = downloadID
};
backgroundCopyCallback.StatusChanged += OnStatusChanged;
downloadJob.SetNotifyInterface(new UnknownWrapper (backgroundCopyCallback).WrappedObject);
downloadJob.SetNotifyInterface(new UnknownWrapper(backgroundCopyCallback).WrappedObject);

downloadJob.GetProgress(out BG_JOB_PROGRESS progress);
DownloadCreated?.Invoke(backgroundCopyCallback.DownloadID, Path.GetFileName(saveFilePath), saveFilePath, url, progress.BytesTotal is ulong.MaxValue ? 0 : progress.BytesTotal);
Expand Down
23 changes: 23 additions & 0 deletions WindowsTools/Services/Root/GlobalNotificationService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;

namespace WindowsTools.Services.Root
{
/// <summary>
/// 应用进程内全局通知
/// </summary>
public static class GlobalNotificationService
{
/// <summary>
/// 应用程序退出时发生的事件
/// </summary>
public static event EventHandler ApplicationExit;

/// <summary>
/// 发送消息通知
/// </summary>
public static void SendNotification()
{
ApplicationExit?.Invoke(null, EventArgs.Empty);
}
}
}
108 changes: 108 additions & 0 deletions WindowsTools/Strings/LoopbackManager.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions WindowsTools/Strings/LoopbackManager.en-us.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,33 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AppBinariesPath" xml:space="preserve">
<value>App binaries path</value>
</data>
<data name="AppContainerName" xml:space="preserve">
<value>App container name</value>
</data>
<data name="AppContainerSID" xml:space="preserve">
<value>App container SID</value>
</data>
<data name="AppContainerUser" xml:space="preserve">
<value>App container user</value>
</data>
<data name="Description" xml:space="preserve">
<value>Description</value>
</data>
<data name="EmptyDescription" xml:space="preserve">
<value>The device has no application</value>
</data>
<data name="LearnLoopback" xml:space="preserve">
<value>Learn loopback</value>
</data>
<data name="LoadingLoopback" xml:space="preserve">
<value>Loading network loopback information, please wait...</value>
</data>
<data name="OpenWorkingDirectoryToolTip" xml:space="preserve">
<value>Open working directory</value>
</data>
<data name="Refresh" xml:space="preserve">
<value>Refresh</value>
</data>
Expand All @@ -138,10 +162,22 @@
<data name="SelectAll" xml:space="preserve">
<value>Select all</value>
</data>
<data name="SelectedToolTip" xml:space="preserve">
<value>Selected</value>
</data>
<data name="SelectNone" xml:space="preserve">
<value>Select none</value>
</data>
<data name="Title" xml:space="preserve">
<value>Loop back manager</value>
</data>
<data name="Unknown" xml:space="preserve">
<value>[Unknown]</value>
</data>
<data name="UnSelectedToolTip" xml:space="preserve">
<value>Unselected</value>
</data>
<data name="WorkingDirectory" xml:space="preserve">
<value>Working directory</value>
</data>
</root>
Loading

0 comments on commit d394e1b

Please sign in to comment.