├── PackageEasy
├── PackageEasyTest
│ ├── GlobalUsings.cs
│ ├── UnitTest1.cs
│ ├── ThemeTest.cs
│ ├── PackageEasyTest.csproj
│ └── LanguageTest.cs
├── 更新说明
│ ├── V1.0.4.md
│ ├── V1.0.5.md
│ └── V1.0.6.md
├── PackageEasy
│ ├── PackageEasyNew.pge
│ ├── Resources
│ │ ├── icon.ico
│ │ ├── Images
│ │ │ ├── wx.jpg
│ │ │ ├── tools.png
│ │ │ ├── NewProject.png
│ │ │ └── Triangle.png
│ │ └── Icons
│ │ │ └── iconfont.ttf
│ ├── Plugin
│ │ └── nsProcess.zip
│ ├── Files
│ │ └── Language
│ │ │ └── language.json
│ ├── Properties
│ │ ├── Settings.settings
│ │ ├── Settings.Designer.cs
│ │ └── app.manifest
│ ├── Themes
│ │ └── ThemeConfig.json
│ ├── Enums
│ │ ├── TMessageBoxResult.cs
│ │ └── MessageLevel.cs
│ ├── ViewModels
│ │ ├── SecurityViewModel.cs
│ │ ├── BaseViewModel.cs
│ │ ├── ViewModelLocator.cs
│ │ ├── Dialogs
│ │ │ ├── AssemblyFilesViewModel.cs
│ │ │ └── ShowWindowViewModel.cs
│ │ └── HomeViewModel.cs
│ ├── Views
│ │ ├── SecurityView.xaml
│ │ ├── LanguageView.xaml.cs
│ │ ├── SecurityView.xaml.cs
│ │ ├── OtherViews
│ │ │ ├── LanguageEditView.xaml.cs
│ │ │ ├── LanguageFileView.xaml.cs
│ │ │ └── LanguageEditView.xaml
│ │ ├── EndView.xaml.cs
│ │ ├── BaseInfoView.xaml.cs
│ │ ├── RegistryView.xaml.cs
│ │ ├── AppIconInfoView.xaml.cs
│ │ ├── AssemblyView1.xaml.cs
│ │ ├── ProjectView.xaml.cs
│ │ ├── Tools
│ │ │ ├── ScriptControl.xaml
│ │ │ ├── ScriptControl.xaml.cs
│ │ │ ├── AboutControl.xaml.cs
│ │ │ ├── AboutControl.xaml
│ │ │ └── PlugInManagerControl.xaml.cs
│ │ ├── HomeView.xaml.cs
│ │ ├── Dialogs
│ │ │ ├── AssemblyFilesDialog.xaml.cs
│ │ │ ├── ShowWindow.xaml.cs
│ │ │ ├── Wating.xaml.cs
│ │ │ ├── Wating.xaml
│ │ │ ├── PasswordDialog.xaml.cs
│ │ │ └── MessageBox.xaml.cs
│ │ ├── AssemblyView.xaml.cs
│ │ ├── LanguageView.xaml
│ │ └── ProjectView.xaml
│ ├── AssemblyInfo.cs
│ ├── Models
│ │ ├── NaviteModel.cs
│ │ ├── ViewCaheModel.cs
│ │ └── TableModel.cs
│ ├── Styles
│ │ ├── Converters.xaml
│ │ ├── TextBlock.xaml
│ │ ├── PasswordBoxStyle.xaml
│ │ └── Button.xaml
│ ├── Converters
│ │ ├── KeyToLangDescConverter.cs
│ │ ├── BoolToVisibilityConverter.cs
│ │ ├── BoolRevolveConverter.cs
│ │ ├── ButtonTypeToBoolConverter.cs
│ │ └── Base64ToImageConverter.cs
│ ├── Helpers
│ │ ├── NSISHelper.cs
│ │ ├── ServiceHelper.cs
│ │ ├── TViewsHelper.cs
│ │ ├── PlugInHelper.cs
│ │ ├── ThemeHelper.cs
│ │ ├── LanguageHelper.cs
│ │ └── NavigationHelper.cs
│ ├── Attributes
│ │ └── TViewAttribute.cs
│ ├── Services
│ │ └── DataService.cs
│ ├── App.xaml.cs
│ ├── App.xaml
│ ├── Common
│ │ └── TMessageBox.cs
│ ├── Program.cs
│ └── PackageEasy.csproj
├── .editorconfig
├── PackageEasy.Common
│ ├── Class1.cs
│ ├── Helpers
│ │ ├── DataGridHelper.cs
│ │ ├── WinMessageHelper.cs
│ │ ├── ConfigHelper.cs
│ │ ├── JsonHelpers.cs
│ │ ├── ImageHelper.cs
│ │ ├── DataHelper.cs
│ │ └── StoreHelper.cs
│ ├── PackageEasy.Common.csproj
│ ├── Controls
│ │ └── IconRadioButton.cs
│ ├── WinAPIs
│ │ └── WinApi.cs
│ └── Config
│ │ └── log4net.config
├── PackageEasy.Domain
│ ├── Class1.cs
│ ├── Properties
│ │ ├── Settings.settings
│ │ └── Settings.Designer.cs
│ ├── Models
│ │ ├── ControlModel
│ │ │ └── DataColumnModel.cs
│ │ ├── LanguageTypeModel.cs
│ │ ├── BasePlugInModel.cs
│ │ ├── ExtensionMenuModel.cs
│ │ ├── ThemeModel.cs
│ │ ├── IconInfoModel.cs
│ │ ├── SaveModel
│ │ │ ├── AssemblyInfoModel.cs
│ │ │ └── AppIconModel.cs
│ │ ├── BaseModel.cs
│ │ ├── DescModel.cs
│ │ ├── ConfigModel.cs
│ │ ├── LanguageModel.cs
│ │ ├── ExtraInfo.cs
│ │ ├── TargetPathModel.cs
│ │ ├── RegistryModel.cs
│ │ ├── LanguageSourceArgs.cs
│ │ ├── InstallLanguageModel.cs
│ │ ├── PlugInModel.cs
│ │ ├── RecentlyModel.cs
│ │ ├── BaseBulidScript.cs
│ │ ├── FinishModel.cs
│ │ ├── AppIconInfoModel.cs
│ │ ├── MultiFileModel.cs
│ │ └── AssemblyModel.cs
│ ├── Attributes
│ │ ├── SaveIgnoreAttribute.cs
│ │ ├── DescriptionAttribute.cs
│ │ └── PlugInAttribute.cs
│ ├── Enums
│ │ ├── PlugInState.cs
│ │ ├── LogLevelType.cs
│ │ ├── FileMenuOperateType.cs
│ │ ├── IconType.cs
│ │ ├── ButtonType.cs
│ │ ├── LanguageType.cs
│ │ ├── UserFaceType.cs
│ │ ├── CompressionAlgoType.cs
│ │ ├── TargetDirType.cs
│ │ └── ViewType.cs
│ ├── Helpers
│ │ └── StaticStringHelper.cs
│ ├── Interfaces
│ │ ├── ITPlugIn.cs
│ │ ├── INavigation.cs
│ │ ├── IScript.cs
│ │ └── IDataService.cs
│ ├── PackageEasy.Domain.csproj
│ └── ProjectInfoModel.cs
├── PackageEasy.Controls
│ ├── PackageEasy.Controls.csproj
│ ├── Interfaces
│ │ └── IUserControl.cs
│ ├── AssemblyInfo.cs
│ └── Controls
│ │ ├── PlugInButton.cs
│ │ ├── BaseControl.cs
│ │ └── TProgressRing.cs
├── PackageEasy.NSIS
│ └── PackageEasy.NSIS.csproj
└── PackageEasy.PlugIns
│ ├── PackageEasy.PlugIns.csproj
│ ├── UserControl1.xaml
│ ├── AssemblyInfo.cs
│ ├── UserControl1.xaml.cs
│ └── PlugIn
│ └── NProcess.cs
├── .gitignore
├── SECURITY.md
├── .github
└── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
├── LICENSE
└── Readmes
└── README.zh_CN.md
/PackageEasy/PackageEasyTest/GlobalUsings.cs:
--------------------------------------------------------------------------------
1 | global using Microsoft.VisualStudio.TestTools.UnitTesting;
--------------------------------------------------------------------------------
/PackageEasy/更新说明/V1.0.4.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/更新说明/V1.0.4.md
--------------------------------------------------------------------------------
/PackageEasy/更新说明/V1.0.5.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/更新说明/V1.0.5.md
--------------------------------------------------------------------------------
/PackageEasy/更新说明/V1.0.6.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/更新说明/V1.0.6.md
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/PackageEasyNew.pge:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/PackageEasy/PackageEasyNew.pge
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Resources/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/PackageEasy/Resources/icon.ico
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Plugin/nsProcess.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/PackageEasy/Plugin/nsProcess.zip
--------------------------------------------------------------------------------
/PackageEasy/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # CS8618: 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑声明为可以为 null。
4 | dotnet_diagnostic.CS8618.severity = silent
5 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Resources/Images/wx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/PackageEasy/Resources/Images/wx.jpg
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Common/Class1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace PackageEasy.Common
4 | {
5 | public class Class1
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Class1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace PackageEasy.Domain
4 | {
5 | public class Class1
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Resources/Images/tools.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/PackageEasy/Resources/Images/tools.png
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Resources/Icons/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/PackageEasy/Resources/Icons/iconfont.ttf
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Resources/Images/NewProject.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/PackageEasy/Resources/Images/NewProject.png
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Resources/Images/Triangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tangmanger/PackageEasy/HEAD/PackageEasy/PackageEasy/Resources/Images/Triangle.png
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Files/Language/language.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "Id": 0,
4 | "DisPlayName": "SampleChinese",
5 | "FilePath": "Zh-CN.xaml"
6 | },
7 | {
8 | "Id": 1,
9 | "DisPlayName": "English",
10 | "FilePath": "En-US.xaml"
11 | }
12 | ]
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasyTest/UnitTest1.cs:
--------------------------------------------------------------------------------
1 | namespace PackageEasyTest
2 | {
3 | [TestClass]
4 | public class UnitTest1
5 | {
6 | [TestMethod]
7 | public void TestMethod1()
8 | {
9 | Console.WriteLine(Guid.NewGuid().ToString());
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Themes/ThemeConfig.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "ThemeName": "DefaultColor.xaml",
4 | "ThemeDescription": "ThemeDefault",
5 | "ThemeId": "default"
6 | },
7 | {
8 | "ThemeName": "Black.xaml",
9 | "ThemeDescription": "ThemeBlack",
10 | "ThemeId": "black"
11 | }
12 | ]
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Common/Helpers/DataGridHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Common.Helpers
8 | {
9 | public class DataGridHelper
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/ControlModel/DataColumnModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Models.ControlModel
8 | {
9 | public class DataColumnModel
10 | {
11 | ///
12 | ///
13 | ///
14 | public string ColName { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Controls/PackageEasy.Controls.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows
5 | enable
6 | true
7 | AnyCPU;x64
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | #Ignore thumbnails created by Windows
3 | Thumbs.db
4 | #Ignore files built by Visual Studio
5 | *.obj
6 | *.exe
7 | *.pdb
8 | *.user
9 | *.aps
10 | *.pch
11 | *.vspscc
12 | *_i.c
13 | *_p.c
14 | *.ncb
15 | *.suo
16 | *.tlb
17 | *.tlh
18 | *.bak
19 | *.cache
20 | *.ilk
21 | *.log
22 | [Bb]in
23 | [Dd]ebug*/
24 | *.lib
25 | *.sbr
26 | obj/
27 | [Rr]elease*/
28 | _ReSharper*/
29 | [Tt]est[Rr]esult*
30 | .vs/
31 | #Nuget packages folder
32 | packages/
33 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.NSIS/PackageEasy.NSIS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows
5 | enable
6 | enable
7 | AnyCPU;x64
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Attributes/SaveIgnoreAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Attributes
8 | {
9 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
10 | public class SaveIgnoreAttribute : Attribute
11 | {
12 | public SaveIgnoreAttribute() { }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Enums/PlugInState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Enums
8 | {
9 | public enum PlugInState
10 | {
11 | ///
12 | /// 未安装
13 | ///
14 | UnInstalled,
15 | ///
16 | /// 已安装
17 | ///
18 | Installed
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/LanguageTypeModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Models
9 | {
10 | public class LanguageTypeModel
11 | {
12 |
13 | public int Id { get; set; }
14 | public string DisplayName { get; set; }
15 | public string FilePath { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/BasePlugInModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Interfaces;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Models
9 | {
10 | public abstract class BasePlugInModel : ITPlugIn
11 | {
12 |
13 | public abstract Tuple Execute();
14 | public abstract void Loaded();
15 | public abstract void Unloaded();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Enums/TMessageBoxResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Enums
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-26 16:34:17
12 | /// desc:TMessageBoxResult
13 | ///
14 | public enum TMessageBoxResult
15 | {
16 | None = 0,
17 | OK = 1,
18 | Cancel = 2,
19 | Close= 3,
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/ViewModels/SecurityViewModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.ViewModels
9 | {
10 | public class SecurityViewModel : BaseProjectViewModel
11 | {
12 | public SecurityViewModel() { }
13 | public SecurityViewModel(ViewType viewType, string key) : base(viewType, key)
14 | {
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Enums/LogLevelType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Enums
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-10 23:48:17
12 | /// desc:LogLevelType
13 | ///
14 | public enum LogLevelType
15 | {
16 | Info = 0,
17 | Error = 1,
18 | Debug = 2,
19 | Fatal = 3,
20 | Waring = 4
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Enums/FileMenuOperateType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Enums
8 | {
9 | public enum FileMenuOperateType
10 | {
11 | Install,
12 | QuietInstall,
13 | IsExistNoNeedCopy,
14 | IsNoNeedCopy,
15 | IsNoNeedDelete,
16 | Ignore,
17 | IgnoreDir,
18 | IgnoreFormat,
19 | UseCustomPath,
20 | Refresh
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Helpers/StaticStringHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Helpers
8 | {
9 | public class StaticStringHelper
10 | {
11 | ///
12 | /// 普通文件格式
13 | ///
14 | public const string PGE = ".pge";
15 | ///
16 | /// 加密文件格式
17 | ///
18 | public const string PKY = ".pky";
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Enums/IconType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Enums
8 | {
9 | public enum IconType
10 | {
11 | None,
12 | ///
13 | /// app
14 | ///
15 | App,
16 | ///
17 | /// 安装
18 | ///
19 | Install,
20 | ///
21 | /// 卸载
22 | ///
23 | UnInstall
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.PlugIns/PackageEasy.PlugIns.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows
5 | enable
6 | true
7 | enable
8 | AnyCPU;x64
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/ExtensionMenuModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Input;
7 |
8 | namespace PackageEasy.Domain.Models
9 | {
10 | public class ExtensionMenuModel
11 | {
12 | ///
13 | /// 显示名称
14 | ///
15 | public string? ExtensionName { get; set; }
16 | ///
17 | /// 命令
18 | ///
19 | public ICommand? MenuCommand { get; set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | Use this section to tell people about which versions of your project are
6 | currently being supported with security updates.
7 |
8 | | Version | Supported |
9 | | ------- | ------------------ |
10 | |.net 6.0< | :white_check_mark: |
11 |
12 |
13 | ## Reporting a Vulnerability
14 |
15 | Use this section to tell people how to report a vulnerability.
16 |
17 | Tell them where to go, how often they can expect to get an update on a
18 | reported vulnerability, what to expect if the vulnerability is accepted or
19 | declined, etc.
20 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/SecurityView.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.PlugIns/UserControl1.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/ThemeModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Models
8 | {
9 | public class ThemeModel
10 | {
11 | ///
12 | /// 主题文件名称
13 | ///
14 | public string ThemeName { get; set; }
15 | ///
16 | /// 主题描述
17 | ///
18 | public string ThemeDescription { get; set; }
19 | ///
20 | /// 主题id
21 | ///
22 | public string ThemeId { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/IconInfoModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Models
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-26 17:33:45
12 | /// desc:IconInfoModel
13 | ///
14 | public class IconInfoModel
15 | {
16 | ///
17 | /// 路径
18 | ///
19 | public string IconName { get; set; }
20 | ///
21 | /// 程序名
22 | ///
23 | public string AppPath { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Interfaces/ITPlugIn.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Interfaces
8 | {
9 | ///
10 | /// T插件
11 | ///
12 | public interface ITPlugIn
13 | {
14 | ///
15 | /// 载入
16 | ///
17 | void Loaded();
18 | ///
19 | /// 卸载
20 | ///
21 | void Unloaded();
22 | ///
23 | /// 执行
24 | ///
25 | Tuple Execute();
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Windows;
3 |
4 | [assembly: ThemeInfo(
5 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
6 | //(used if a resource is not found in the page,
7 | // or application resource dictionaries)
8 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
9 | //(used if a resource is not found in the page,
10 | // app, or any theme specific resource dictionaries)
11 | )]
12 |
13 |
14 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.PlugIns/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.PlugIns/UserControl1.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Windows;
3 | using System.Windows.Controls;
4 | using System.Windows.Data;
5 | using System.Windows.Documents;
6 | using System.Windows.Input;
7 | using System.Windows.Media;
8 | using System.Windows.Media.Imaging;
9 | using System.Windows.Navigation;
10 | using System.Windows.Shapes;
11 |
12 | namespace PackageEasy.PlugIns
13 | {
14 | ///
15 | /// Interaction logic for UserControl1.xaml
16 | ///
17 | public partial class UserControl1 : UserControl
18 | {
19 | public UserControl1()
20 | {
21 | InitializeComponent();
22 | }
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Attributes/DescriptionAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Attributes
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-10 23:41:11
12 | /// desc:DescriptionAttribute
13 | ///
14 | [AttributeUsage(AttributeTargets.Field, AllowMultiple = true, Inherited = true)]
15 | public class DescriptionAttribute : Attribute
16 | {
17 | public string Key { get; }
18 |
19 | public DescriptionAttribute(string key)
20 | {
21 | Key = key;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Controls/Interfaces/IUserControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Controls.Interfaces
8 | {
9 | public interface IUserControl
10 | {
11 | ///
12 | /// 加载和
13 | ///
14 | void Load();
15 | ///
16 | /// 卸载
17 | ///
18 | void Unload();
19 | ///
20 | /// 保存
21 | ///
22 | void Save();
23 | ///
24 | /// 描述
25 | ///
26 | string Description { get; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Enums/ButtonType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Enums
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-21 0:10:29
12 | /// desc:ButtonType
13 | ///
14 | public enum ButtonType
15 | {
16 | None = 0,
17 | ///
18 | /// 古典
19 | ///
20 | Classical = 1,
21 | ///
22 | /// 选择
23 | ///
24 | Choose = 2,
25 | ///
26 | /// 圆形
27 | ///
28 | Circle = 3
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/SaveModel/AssemblyInfoModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Models.SaveModel
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-25 23:49:40
12 | /// desc:AssemblyInfoModel
13 | ///
14 | public class AssemblyInfoModel
15 | {
16 | ///
17 | /// 组件信息
18 | ///
19 | public List AssemblyList { get; set; }
20 | ///
21 | /// 是否允许用户选择
22 | ///
23 | public bool IsAllowChoose { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/BaseModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Runtime.CompilerServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Domain.Models
10 | {
11 | ///
12 | /// author:TT
13 | /// time:2023-03-23 23:39:01
14 | /// desc:BaseModel
15 | ///
16 | public class BaseModel : INotifyPropertyChanged
17 | {
18 | public event PropertyChangedEventHandler? PropertyChanged;
19 | public void RaisePropertyChanged([CallerMemberName] string name = "")
20 | {
21 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/DescModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Models
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-16 22:56:02
12 | /// desc:DescModel
13 | ///
14 | public class DescModel
15 | {
16 | ///
17 | /// 类型
18 | ///
19 | public T Data { get; set; }
20 | ///
21 | ///名称
22 | ///
23 | public string DisplayName { get; set; }
24 | ///
25 | /// 描述
26 | ///
27 | public string Description { get; set; }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/LanguageView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PackageEasy.Views
17 | {
18 | ///
19 | /// LanguageView.xaml 的交互逻辑
20 | ///
21 | public partial class LanguageView : UserControl
22 | {
23 | public LanguageView()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/SecurityView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PackageEasy.Views
17 | {
18 | ///
19 | /// SecurityView.xaml 的交互逻辑
20 | ///
21 | public partial class SecurityView : UserControl
22 | {
23 | public SecurityView()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Controls/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Markup;
3 |
4 | [assembly: ThemeInfo(
5 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
6 | //(used if a resource is not found in the page,
7 | // or application resource dictionaries)
8 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
9 | //(used if a resource is not found in the page,
10 | // app, or any theme specific resource dictionaries)
11 |
12 | )]
13 | [assembly: XmlnsDefinition("https://dicgo.com/controls", "PackageEasy.Controls.Controls")]
14 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/ConfigModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Models
9 | {
10 | public class ConfigModel
11 | {
12 | public string NSISMakePath { get; set; }
13 | public string NSISHelperPath { get; set; }
14 | ///
15 | /// 工作目录
16 | ///
17 | public string WorkSpace { get; set; }
18 | ///
19 | /// 主题id
20 | ///
21 | public string ThemeId { get; set; }
22 | ///
23 | /// 多语言
24 | ///
25 | public int Lang { get; set; } =0;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasyTest/ThemeTest.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Common.Helpers;
2 | using PackageEasy.Domain.Models;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasyTest
10 | {
11 | [TestClass]
12 | public class ThemeTest
13 | {
14 | [TestMethod]
15 | public void SaveTheme()
16 | {
17 | List Themes = new List();
18 | Themes.Add(new ThemeModel { ThemeId = "default", ThemeDescription = "默认主题", ThemeName = "DefaultColor.xaml" });
19 | var themeFile = Path.Combine(DataHelper.Themes, "ThemeConfig.json");
20 | File.WriteAllText("ThemeConfig.json", Themes.SerializeObject());
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/OtherViews/LanguageEditView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PackageEasy.Views.OtherViews
17 | {
18 | ///
19 | /// LanguageEditView.xaml 的交互逻辑
20 | ///
21 | public partial class LanguageEditView : UserControl
22 | {
23 | public LanguageEditView()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/OtherViews/LanguageFileView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PackageEasy.Views.OtherViews
17 | {
18 | ///
19 | /// LanguageFileView.xaml 的交互逻辑
20 | ///
21 | public partial class LanguageFileView : UserControl
22 | {
23 | public LanguageFileView()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Models/NaviteModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using PackageEasy.Enums;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Models
10 | {
11 | ///
12 | /// author:TT
13 | /// time:2023-03-11 16:59:22
14 | /// desc:NaviteModel
15 | ///
16 | public class NaviteModel
17 | {
18 | ///
19 | /// 界面
20 | ///
21 | public ViewType ViewType { get; set; }
22 | ///
23 | /// 实例类型
24 | ///
25 | public Type Type { get; set; }
26 | ///
27 | /// vm类型
28 | ///
29 | public Type VmType { get; set; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/LanguageModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Models
9 | {
10 | ///
11 | /// author:TT
12 | /// time:2023-03-10 23:39:21
13 | /// desc:LanguageModel
14 | ///
15 | public class LanguageModel
16 | {
17 | ///
18 | /// Id
19 | ///
20 | public int Id { get; set; }
21 | ///
22 | /// 语言文本
23 | ///
24 | public string LanguageText { get; set; }
25 | ///
26 | /// 语言类型
27 | ///
28 | public LanguageType LanguageType { get; set; }
29 |
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Styles/Converters.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/EndView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PackageEasy.Views
17 | {
18 | ///
19 | /// 作者:TT
20 | /// 时间:2023-03-14 23:27:58
21 | /// 描述: EndView.xaml 的交互逻辑、
22 | /// TANGMANGER
23 | ///
24 | public partial class EndView : UserControl
25 | {
26 | public EndView()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Styles/TextBlock.xaml:
--------------------------------------------------------------------------------
1 |
3 |
11 |
14 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Enums/LanguageType.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Attributes;
2 | using PackageEasy.Domain.Common;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Domain.Enums
10 | {
11 | ///
12 | /// author:TT
13 | /// time:2023-03-10 23:39:55
14 | /// desc:LanguageType
15 | ///
16 | public enum LanguageType
17 | {
18 | [Description(CommonSettings.Null)]
19 | None = 0,
20 | ///
21 | /// 简体中文
22 | ///
23 | [Description(CommonSettings.SampleChinese)]
24 | Zh_CN = 1,
25 | ///
26 | /// 英文
27 | ///
28 | [Description(CommonSettings.English)]
29 | En_SH = 2,
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Converters/KeyToLangDescConverter.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Common.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Globalization;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows.Data;
9 |
10 | namespace PackageEasy.Converters
11 | {
12 | internal class KeyToLangDescConverter : IValueConverter
13 | {
14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | if (value == null) return null;
17 | var key = (string)value;
18 | return key.GetLangText();
19 | }
20 |
21 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22 | {
23 | throw new NotImplementedException();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/BaseInfoView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PackageEasy.Views
17 | {
18 | ///
19 | /// 作者:TT
20 | /// 时间:2023-03-12 16:28:15
21 | /// 描述: BaseInfoView.xaml 的交互逻辑、
22 | /// TANGMANGER
23 | ///
24 | public partial class BaseInfoView : UserControl
25 | {
26 | public BaseInfoView()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/RegistryView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PackageEasy.Views
17 | {
18 | ///
19 | /// 作者:TT
20 | /// 时间:2023-03-15 22:20:45
21 | /// 描述: RegistryView.xaml 的交互逻辑、
22 | /// TANGMANGER
23 | ///
24 | public partial class RegistryView : UserControl
25 | {
26 | public RegistryView()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/AppIconInfoView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PackageEasy.Views
17 | {
18 | ///
19 | /// 作者:TT
20 | /// 时间:2023-03-13 22:56:00
21 | /// 描述: AppIconInfoView.xaml 的交互逻辑、
22 | /// TANGMANGER
23 | ///
24 | public partial class AppIconInfoView : UserControl
25 | {
26 | public AppIconInfoView()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Enums/MessageLevel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Enums
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-26 16:34:55
12 | /// desc:MessageLevel
13 | ///
14 | public enum MessageLevel
15 | {
16 | ///
17 | /// 信息
18 | ///
19 | Information = 0,
20 | ///
21 | /// 询问
22 | ///
23 | Question = 1,
24 | ///
25 | /// 警告
26 | ///
27 | Warning = 2,
28 | ///
29 | /// 错误
30 | ///
31 | Error = 3,
32 | ///
33 | /// 是否取消
34 | ///
35 | YesNoCancel = 4
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Converters/BoolToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Data;
9 |
10 | namespace PackageEasy.Converters
11 | {
12 | public class BoolToVisibilityConverter : IValueConverter
13 | {
14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | if (value == null) return Visibility.Collapsed;
17 | bool flage = (bool)value;
18 | return flage ? Visibility.Visible : Visibility.Collapsed;
19 | }
20 |
21 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22 | {
23 | throw new NotImplementedException();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/AssemblyView1.xaml.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.ViewModels;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace PackageEasy.Views
18 | {
19 | ///
20 | /// 作者:TT
21 | /// 时间:2023-03-12 22:49:08
22 | /// 描述: AssemblyView.xaml 的交互逻辑、
23 | /// TANGMANGER
24 | ///
25 | public partial class AssemblyView1 : UserControl
26 | {
27 | public AssemblyView1()
28 | {
29 | InitializeComponent();
30 | }
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/ProjectView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PackageEasy.Views
17 | {
18 | ///
19 | /// 作者:TT
20 | /// 时间:2023-03-11 22:22:36
21 | /// 描述: ProjectView.xaml 的交互逻辑、
22 | /// TANGMANGER
23 | ///
24 | public partial class ProjectView : UserControl
25 | {
26 | public ProjectView()
27 | {
28 | InitializeComponent();
29 | //Content = DateTime.Now.ToString("G");
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasyTest/PackageEasyTest.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows
5 | enable
6 | enable
7 |
8 | false
9 | true
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/PackageEasy.Domain.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows
5 | enable
6 | true
7 | AnyCPU;x64
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | True
17 | True
18 | Settings.settings
19 |
20 |
21 |
22 |
23 |
24 | SettingsSingleFileGenerator
25 | Settings.Designer.cs
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Controls/Controls/PlugInButton.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 |
10 | namespace PackageEasy.Controls.Controls
11 | {
12 | public class PlugInButton:Button
13 | {
14 |
15 |
16 |
17 |
18 | public PlugInState PlugInState
19 | {
20 | get { return (PlugInState)GetValue(PlugInStateProperty); }
21 | set { SetValue(PlugInStateProperty, value); }
22 | }
23 |
24 | // Using a DependencyProperty as the backing store for PlugInState. This enables animation, styling, binding, etc...
25 | public static readonly DependencyProperty PlugInStateProperty =
26 | DependencyProperty.Register("PlugInState", typeof(PlugInState), typeof(PlugInButton));
27 |
28 |
29 |
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Enums/UserFaceType.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Attributes;
2 | using PackageEasy.Domain.Common;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Domain.Enums
10 | {
11 | ///
12 | /// author:TT
13 | /// time:2023-03-16 22:53:21
14 | /// desc:UserFaceType
15 | ///
16 | public enum UserFaceType
17 | {
18 | ///
19 | /// 无
20 | ///
21 | [Description(CommonSettings.BaseInfoFaceTypeNo)]
22 | None = 0,
23 | ///
24 | /// 现代
25 | ///
26 | [Description(CommonSettings.BaseInfoFaceTypeMorden)]
27 | Morden = 1,
28 | ///
29 | /// 古典
30 | ///
31 | [Description(CommonSettings.BaseInfoFaceTypeClassic)]
32 | Classic = 2
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/ExtraInfo.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Attributes;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Models
9 | {
10 | ///
11 | /// author:TT
12 | /// time:2023-03-17 0:02:46
13 | /// desc:ExtraInfo
14 | ///
15 | public class ExtraInfo
16 | {
17 | ///
18 | /// 文件路径
19 | ///
20 | [SaveIgnore]
21 | public string FilePath { get; set; }
22 | ///
23 | /// 创建时间
24 | ///
25 | public DateTime CreateTime { get; set; }
26 | ///
27 | /// 内部版本
28 | ///
29 | public string InternalVersion { get; set; }
30 | ///
31 | /// 版本
32 | ///
33 | public string Version { get; set; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Enums/CompressionAlgoType.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Attributes;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Enums
9 | {
10 | ///
11 | /// author:TT
12 | /// time:2023-03-16 23:23:29
13 | /// desc:CompressionAlgoType
14 | ///
15 | public enum CompressionAlgoType
16 | {
17 | ///
18 | /// 无
19 | ///
20 | [Description("无")]
21 | None = 0,
22 | ///
23 | /// zLib
24 | ///
25 | [Description("zLib")]
26 | Zlib = 1,
27 | ///
28 | /// bzip2
29 | ///
30 | [Description("bzip2")]
31 | BZip2 = 2,
32 | ///
33 | /// LZMA
34 | ///
35 | [Description("LZMA")]
36 | LZMA = 3,
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Models/ViewCaheModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.ViewModels;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Controls;
8 |
9 | namespace PackageEasy.Models
10 | {
11 | ///
12 | /// author:TT
13 | /// time:2023-03-11 22:35:09
14 | /// desc:ViewCaheModel
15 | ///
16 | public class ViewCaheModel
17 | {
18 | ///
19 | /// 项目
20 | ///
21 | public string ProjectKey { get; set; }
22 | ///
23 | /// View
24 | ///
25 | public UserControl ProjectView { get; set; }
26 | ///
27 | /// model
28 | ///
29 | public BaseProjectViewModel BaseProjectViewModel { get; set; }
30 | ///
31 | /// 项目名称
32 | ///
33 | public string ProjectName { get; set; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Interfaces/INavigation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Interfaces
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-11 16:45:52
12 | /// desc:INavigateOut
13 | ///
14 | public interface INavigateIn
15 | {
16 | ///
17 | /// 进入
18 | ///
19 | void NavigateIn(T param);
20 |
21 |
22 | }
23 |
24 | ///
25 | /// 无参数导航接口
26 | ///
27 | public interface INavigateIn
28 | {
29 | ///
30 | /// 进入
31 | ///
32 | void NavigateIn();
33 |
34 |
35 | }
36 | ///
37 | /// 无参数导出
38 | ///
39 | public interface INavigateOut
40 | {
41 | ///
42 | /// 离开
43 | ///
44 | void NavigateOut();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Converters/BoolRevolveConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 |
9 | namespace PackageEasy.Converters
10 | {
11 | public class BoolRevolveConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | if (value == null) return true;
16 | bool flage = (bool)value;
17 | if (parameter == null)
18 | return flage;
19 | else
20 | return !flage;
21 | }
22 |
23 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
24 | {
25 | bool flage = (bool)value;
26 | if (parameter == null)
27 | return flage;
28 | else
29 | return !flage;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/Tools/ScriptControl.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Common/PackageEasy.Common.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows
5 | enable
6 | true
7 | AnyCPU;x64
8 | Library
9 | True
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | PreserveNewest
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Helpers/NSISHelper.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Common.Helpers;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Helpers
10 | {
11 | public class NSISHelper
12 | {
13 | public static void Init()
14 | {
15 | string nisiPath = @"C:\Program Files (x86)\NSIS\makensis.exe";
16 | string helper = @"C:\Program Files (x86)\NSIS\NSIS.chm";
17 |
18 | if (File.Exists(nisiPath) && string.IsNullOrWhiteSpace(ConfigHelper.Config.NSISMakePath))
19 | {
20 | ConfigHelper.Config.NSISMakePath = nisiPath;
21 | ConfigHelper.Save(true);
22 | }
23 | if (File.Exists(helper) && string.IsNullOrWhiteSpace(ConfigHelper.Config.NSISHelperPath))
24 | {
25 | ConfigHelper.Config.NSISHelperPath = helper;
26 | ConfigHelper.Save(true);
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/HomeView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xaml.Behaviors;
2 | using PackageEasy.Attributes;
3 | using PackageEasy.Domain.Enums;
4 | using PackageEasy.ViewModels;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows;
11 | using System.Windows.Controls;
12 | using System.Windows.Data;
13 | using System.Windows.Documents;
14 | using System.Windows.Input;
15 | using System.Windows.Media;
16 | using System.Windows.Media.Imaging;
17 | using System.Windows.Navigation;
18 | using System.Windows.Shapes;
19 |
20 | namespace PackageEasy.Views
21 | {
22 | ///
23 | /// 作者:TT
24 | /// 时间:2023-03-11 15:54:14
25 | /// 描述: HomeView.xaml 的交互逻辑、
26 | /// TANGMANGER
27 | ///
28 | [TView(ViewType.Home,typeof(HomeView),typeof(HomeViewModel))]
29 | public partial class HomeView : UserControl
30 | {
31 | public HomeView()
32 | {
33 | InitializeComponent();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/TargetPathModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Models
8 | {
9 | public class TargetPathModel : BaseModel
10 | {
11 | ///
12 | /// 显示名称
13 | ///
14 | public string DisplayName { get; set; }
15 | ///
16 | /// 目标名称
17 | ///
18 | public string TargetPath { get; set; }
19 | ///
20 | /// 是否用户
21 | ///
22 | public bool IsUserCreated { get; set; }
23 | ///
24 | /// 创建问题
25 | ///
26 | public DateTime CreateTime { get; set; }
27 | ///
28 | /// 更新时间
29 | ///
30 | public DateTime UpdateTime { get; set; }
31 | ///
32 | /// 是否是默认
33 | ///
34 | public bool IsDefault { get; set; }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/RegistryModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Models
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023/12/19 13:32:59
12 | /// desc:RegistryModel
13 | ///
14 | public class RegistryModel
15 | {
16 | ///
17 | /// 注册文件格式
18 | ///
19 | public string RegistryFormat { get; set; }
20 | ///
21 | /// 作为可选zujian
22 | ///
23 | public bool IsAsSelected { get; set; } = true;
24 | ///
25 | /// 注册进程名
26 | ///
27 | public string ProcessName { get; set; }
28 | ///
29 | /// 是否启用密码
30 | ///
31 | public bool IsUsePassword { get; set; }
32 | ///
33 | /// 密码
34 | ///
35 | public string Password { get; set; }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Controls/Controls/BaseControl.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Controls.Interfaces;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Linq;
6 | using System.Runtime.CompilerServices;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 | using System.Windows.Controls;
11 |
12 | namespace PackageEasy.Controls.Controls
13 | {
14 | public abstract class BaseControl : UserControl, IUserControl, INotifyPropertyChanged
15 | {
16 | public BaseControl() { }
17 | public abstract string Description { get; }
18 | public virtual bool ShowSureButton { get; } = true;
19 |
20 | public event PropertyChangedEventHandler? PropertyChanged;
21 |
22 | public abstract void Load();
23 | public abstract void Save();
24 | public abstract void Unload();
25 | public void RaisePropertyChanged([CallerMemberName] string str = "")
26 | {
27 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(str));
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/LanguageSourceArgs.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Models
9 | {
10 | ///
11 | /// author:TT
12 | /// time:2023-03-10 23:50:25
13 | /// desc:LanguageSourceArgs
14 | ///
15 | public class LanguageSourceArgs : EventArgs
16 | {
17 | public LanguageSourceArgs(LanguageType oldValue, LanguageType newValue)
18 | {
19 | OldValue = oldValue;
20 | NewValue = newValue;
21 | }
22 | public LanguageSourceArgs(string projectKey, LanguageType oldValue, LanguageType newValue)
23 | {
24 | ProjectKey = projectKey;
25 | OldValue = oldValue;
26 | NewValue = newValue;
27 | }
28 |
29 | public string ProjectKey { get; set; }
30 |
31 | public LanguageType OldValue { get; set; }
32 | public LanguageType NewValue { get; set; }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace PackageEasy.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Attributes/TViewAttribute.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using PackageEasy.Enums;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Attributes
10 | {
11 | ///
12 | /// author:TT
13 | /// time:2023-03-11 16:09:56
14 | /// desc:TViewAttribute
15 | ///
16 | [AttributeUsage(AttributeTargets.Class)]
17 | public class TViewAttribute : Attribute
18 | {
19 | public TViewAttribute(ViewType viewType, Type type, Type vmType)
20 | {
21 | ViewType = viewType;
22 | Type = type;
23 | VMType = vmType;
24 | }
25 |
26 | ///
27 | /// vm
28 | ///
29 | public Type VMType { get; set; }
30 | ///
31 | /// view
32 | ///
33 | public Type Type { get; set; }
34 | ///
35 | /// 界面
36 | ///
37 | public ViewType ViewType { get; set; }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/OtherViews/LanguageEditView.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Attributes/PlugInAttribute.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Interfaces;
2 | using PackageEasy.Domain.Models;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows.Markup;
9 |
10 |
11 | namespace PackageEasy.Domain.Attributes
12 | {
13 | [AttributeUsage(AttributeTargets.Class)]
14 | public class PlugInAttribute : Attribute
15 | {
16 |
17 | ///
18 | /// 插件
19 | ///
20 | public PlugInModel PlugIn { get; set; }
21 |
22 | ///
23 | /// 插件
24 | ///
25 | ///
26 | ///
27 | ///
28 | public PlugInAttribute(string name, string icon, Type type,string uid)
29 | {
30 | PlugIn = new PlugInModel();
31 | PlugIn.Name = name;
32 | PlugIn.Icon = icon;
33 | PlugIn.PlugInType = type;
34 | PlugIn.Uid = uid;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace PackageEasy.Domain.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 tangmanger
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/InstallLanguageModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Models
9 | {
10 | public class InstallLanguageModel : BaseModel
11 | {
12 | private bool isSelected;
13 |
14 | public bool IsSelected
15 | {
16 | get => isSelected;
17 | set
18 | {
19 | isSelected = value;
20 | RaisePropertyChanged();
21 | }
22 | }
23 | ///
24 | /// 语言代码
25 | ///
26 | public string Code { get; set; }
27 | ///
28 | /// 语言名称
29 | ///
30 | public string LanguageName { get; set; }
31 | ///
32 | /// 语言栏
33 | ///
34 | public LanguageType LanguageType { get; set; }
35 | ///
36 | /// 标志key 用来实现用户自定义多语言
37 | ///
38 | public string LanguageDisplayKey { get; set; }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Enums/TargetDirType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Enums
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-25 23:27:46
12 | /// desc:TargetDirType
13 | ///
14 | public enum TargetDirType
15 | {
16 | INSTDIR=0,
17 | PROGRAMFILES=1,
18 | TEMP=2,
19 | DESKTOP=3,
20 | SYSDIR=4,
21 | EXEDIR=5,
22 | WINDIR=6,
23 | STARTMENU=7,
24 | SMPROGRAMS,
25 | QUICKLAUNCH,
26 | COMMONFILES,
27 | DOCUMENTS,
28 | SENDTO,
29 | RECENT,
30 | FAVORITES,
31 | MUSIC,
32 | PICTURES,
33 | VIDEOS,
34 | NETHOOD,
35 | FONTS,
36 | TEMPLATES,
37 | APPDATA,
38 | PRINTHOOD,
39 | INTERNET_CACHE,
40 | COOKIES,
41 | HISTORY,
42 | PROFILE,
43 | ADMINTOOLS,
44 | RESOURCES,
45 | RESOURCES_LOCALIZED,
46 | CDBURN_AREA,
47 | ICONS_GROUP,
48 | LOCALAPPDATA
49 |
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Services/DataService.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Interfaces;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Services
9 | {
10 | ///
11 | /// author:TT
12 | /// time:2023-03-11 23:19:30
13 | /// desc:DataService
14 | ///
15 | public class DataService : IDataService
16 | {
17 | public string ProjectKey { get; set; }
18 |
19 | public event Action CreateProject;
20 | public event Action PreCompile;
21 | public event Action LanguageChanged;
22 | public event Action TargetPathChanged;
23 |
24 | public void OnCreateProject(string name, string key)
25 | {
26 | CreateProject?.Invoke(name, key);
27 | }
28 |
29 | public void OnLanguageChanged()
30 | {
31 | LanguageChanged?.Invoke();
32 | }
33 |
34 | public void OnPreCompile()
35 | {
36 | PreCompile?.Invoke();
37 | }
38 |
39 | public void OnTargetPathChanged()
40 | {
41 | TargetPathChanged?.Invoke();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Converters/ButtonTypeToBoolConverter.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Globalization;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows.Data;
9 |
10 | namespace PackageEasy.Converters
11 | {
12 | ///
13 | /// author:TT
14 | /// time:2023-03-22 23:25:32
15 | /// desc:ButtonTypeToBoolConverter
16 | ///
17 | public class ButtonTypeToBoolConverter : IValueConverter
18 | {
19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
20 | {
21 | if (value == null) return false;
22 | if (parameter == null) return false;
23 | ButtonType buttonType = (ButtonType)value;
24 | int d = 0;
25 | int.TryParse(parameter.ToString(), out d);
26 | ButtonType buttonType1 = (ButtonType)d;
27 | return buttonType1 == buttonType;
28 | }
29 |
30 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
31 | {
32 | throw new NotImplementedException();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Enums/ViewType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Enums
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-11 16:13:38
12 | /// desc:ViewType
13 | ///
14 | public enum ViewType
15 | {
16 | None = 0,
17 | ///
18 | /// 主页
19 | ///
20 | Home = 1,
21 | ///
22 | /// 基础信息页
23 | ///
24 | BaseInfoView = 2,
25 | ///
26 | /// 组件界面
27 | ///
28 | AssemblyView = 3,
29 | ///
30 | /// 应用程序图标信息
31 | ///
32 | AppIconInfoView = 4,
33 | ///
34 | /// 结束界面
35 | ///
36 | EndView = 5,
37 | ///
38 | /// 注册表界面
39 | ///
40 | RegistryView = 6,
41 | ///
42 | /// 多语言处理界面
43 | ///
44 | LanguageView = 7,
45 | ///
46 | /// 安全界面
47 | ///
48 | SecurityView = 8
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/Dialogs/AssemblyFilesDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace PackageEasy.Views.Dialogs
16 | {
17 | ///
18 | /// AssemblyFilesDialog.xaml 的交互逻辑
19 | ///
20 | public partial class AssemblyFilesDialog : Window
21 | {
22 | public AssemblyFilesDialog()
23 | {
24 | InitializeComponent();
25 | CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, CloseExecute));
26 | this.Owner = App.Current.MainWindow;
27 | }
28 |
29 | private void Window_Loaded(object sender, RoutedEventArgs e)
30 | {
31 |
32 | }
33 | private void CloseExecute(object sender, ExecutedRoutedEventArgs e)
34 | {
35 | this.Close();
36 | }
37 |
38 | private void Button_Click(object sender, RoutedEventArgs e)
39 | {
40 | this.Close();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Models/TableModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Models
9 | {
10 | ///
11 | /// author:TT
12 | /// time:2023-03-11 22:54:42
13 | /// desc:TableModel
14 | ///
15 | public class TableModel : ObservableObject
16 | {
17 | private string projectName;
18 |
19 | ///
20 | /// 实验key
21 | ///
22 | public string ProjectKey { get; set; }
23 | ///
24 | /// 实验名称
25 | ///
26 | public string ProjectName
27 | {
28 | get => projectName;
29 | set
30 | {
31 | projectName = value;
32 | OnPropertyChanged(nameof(ProjectName));
33 |
34 | }
35 | }
36 | private bool _isActive;
37 |
38 | ///
39 | /// 是否是激活
40 | ///
41 | public bool IsActive
42 | {
43 | get
44 | {
45 | return _isActive;
46 | }
47 | set
48 | {
49 | _isActive = value;
50 | OnPropertyChanged();
51 | }
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/PlugInModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Models
9 | {
10 | public class PlugInModel : BaseModel
11 | {
12 | private PlugInState installState;
13 |
14 | ///
15 | /// 插件id
16 | ///
17 | public string Uid { get; set; }
18 | ///
19 | /// 插件类型
20 | ///
21 | public Type PlugInType { get; set; }
22 | ///
23 | /// 描述
24 | ///
25 | public string Description { get; set; }
26 | ///
27 | /// Icon
28 | ///
29 | public string Icon { get; set; }
30 | ///
31 | /// 名称
32 | ///
33 | public string Name { get; set; }
34 | ///
35 | /// 展示名称
36 | ///
37 | public string DisplayName { get; set; }
38 | ///
39 | ///插件安装状态
40 | ///
41 | public PlugInState InstallState
42 | {
43 | get => installState;
44 | set
45 | {
46 | installState = value;
47 | RaisePropertyChanged();
48 | }
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasyTest/LanguageTest.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Common.Helpers;
2 | using PackageEasy.Domain.Common;
3 | using PackageEasy.Domain.Models;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Security.Cryptography.X509Certificates;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace PackageEasyTest
12 | {
13 | [TestClass]
14 | public class LanguageTest
15 | {
16 | [TestMethod]
17 | public void BuildLanguage()
18 | {
19 | //List languages = new List();
20 | //languages.Add(new LanguageModel { LanguageText = "主程序", Id = 0, LanguageType = PackageEasy.Domain.Enums.LanguageType.Zh_CN });
21 | //languages.Add(new LanguageModel { LanguageText = "Main Program", Id = 0, LanguageType = PackageEasy.Domain.Enums.LanguageType.En_SH });
22 | //File.WriteAllText("a.json", languages.SerializeObject());
23 |
24 | List languageTypeModels = new List();
25 | languageTypeModels.Add(new LanguageTypeModel { Id = 0, DisplayName = CommonSettings.SampleChinese, FilePath = "Zh-CN.xaml" });
26 | languageTypeModels.Add(new LanguageTypeModel { Id = 1, DisplayName = CommonSettings.English, FilePath = "En-US.xaml" });
27 | File.WriteAllText("language.json", languageTypeModels.SerializeObject());
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Helpers/ServiceHelper.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Interfaces;
2 | using PackageEasy.Services;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Helpers
10 | {
11 | public class ServiceHelper
12 | {
13 | static Dictionary Services = new Dictionary();
14 | ///
15 | /// 获取当前的处理
16 | ///
17 | ///
18 | ///
19 | public static IDataService GetService(string key)
20 | {
21 | if (Services.ContainsKey(key)) return Services[key];
22 | IDataService service = new DataService();
23 | service.ProjectKey = key;
24 | Services.Add(key, service);
25 | return service;
26 | }
27 | ///
28 | /// 获取所有服务
29 | ///
30 | ///
31 | public static List GetDataServices()
32 | {
33 | return Services.Values.ToList();
34 | }
35 | ///
36 | ///移除
37 | ///
38 | ///
39 | public static void RemoveService(string key)
40 | {
41 | if (Services.ContainsKey(key))
42 | Services.Remove(key);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/Dialogs/ShowWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Controls.Controls;
2 | using PackageEasy.ViewModels.Dialogs;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Data;
11 | using System.Windows.Documents;
12 | using System.Windows.Input;
13 | using System.Windows.Media;
14 | using System.Windows.Media.Imaging;
15 | using System.Windows.Shapes;
16 |
17 | namespace PackageEasy.Views.Dialogs
18 | {
19 | ///
20 | /// ShowWindow.xaml 的交互逻辑
21 | ///
22 | public partial class ShowWindow : Window
23 | {
24 | public ShowWindow(BaseControl baseControl)
25 | {
26 | InitializeComponent();
27 | CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, CloseExecute));
28 | this.Owner = App.Current.MainWindow;
29 | this.DataContext = new ShowWindowViewModel(baseControl);
30 | }
31 |
32 | private void Window_Loaded(object sender, RoutedEventArgs e)
33 | {
34 |
35 | }
36 | private void CloseExecute(object sender, ExecutedRoutedEventArgs e)
37 | {
38 | this.Close();
39 | }
40 |
41 | private void Button_Click(object sender, RoutedEventArgs e)
42 | {
43 | this.Close();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/ViewModels/BaseViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using PackageEasy.Common.Data;
3 | using PackageEasy.Domain.Common;
4 | using PackageEasy.Helpers;
5 | using PackageEasy.Models;
6 | using PackageEasy.Views;
7 | using System;
8 | using System.Collections.Generic;
9 | using System.Linq;
10 | using System.Text;
11 | using System.Threading.Tasks;
12 |
13 | namespace PackageEasy.ViewModels
14 | {
15 | ///
16 | /// author:TT
17 | /// time:2023-03-15 23:12:29
18 | /// desc:BaseViewModel
19 | ///
20 | public class BaseViewModel: ObservableObject
21 | {
22 | ///
23 | /// 创建对象
24 | ///
25 | public ProjectViewModel CreateProject()
26 | {
27 | ProjectViewModel projectViewModel = new ProjectViewModel();
28 | ProjectView projectView = new ProjectView();
29 | projectView.DataContext = projectViewModel;
30 | projectViewModel.ProjectName = CommonSettings.BaseViewNewProject.GetLangText();
31 | ViewCaheModel viewCaheModel = new ViewCaheModel();
32 | viewCaheModel.ProjectKey = projectViewModel.Key;
33 | viewCaheModel.BaseProjectViewModel = projectViewModel;
34 | viewCaheModel.ProjectView = projectView;
35 |
36 | CacheDataHelper.ProjectCaches.Add(projectViewModel.Key, viewCaheModel);
37 | return projectViewModel;
38 |
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/RecentlyModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Helpers;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Models
9 | {
10 | public class RecentlyModel : BaseModel
11 | {
12 | public string Key { get; set; }
13 | private bool isLock;
14 | private string filePath;
15 |
16 | ///
17 | /// 名称
18 | ///
19 | public string RecentlyName { get; set; }
20 | ///
21 | /// 创建时间
22 | ///
23 | public DateTime CreateTime { get; set; }
24 | ///
25 | /// 更新时间
26 | ///
27 | public DateTime UpdateTime { get; set; }
28 | ///
29 | /// Icon
30 | ///
31 | public string Icon { get; set; }
32 | ///
33 | /// 文件路径
34 | ///
35 | public string FilePath
36 | {
37 | get => filePath;
38 | set
39 | {
40 | filePath = value;
41 | IsLock = value.EndsWith(StaticStringHelper.PKY);
42 | }
43 | }
44 |
45 | public bool IsLock
46 | {
47 | get => isLock;
48 | set
49 | {
50 | isLock = value;
51 | RaisePropertyChanged();
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/ViewModels/ViewModelLocator.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.DependencyInjection;
2 | using log4net;
3 | using Microsoft.Extensions.DependencyInjection;
4 | using PackageEasy.Common.Logs;
5 | using PackageEasy.Domain.Interfaces;
6 | using PackageEasy.Services;
7 | using PackageEasy.Views;
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 | using System.Threading.Tasks;
13 |
14 | namespace PackageEasy.ViewModels
15 | {
16 | ///
17 | /// author:TT
18 | /// time:2023-03-11 15:28:05
19 | /// desc:ViewModelLocator
20 | ///
21 | public class ViewModelLocator
22 | {
23 | public ViewModelLocator()
24 | {
25 | Ioc.Default.ConfigureServices(
26 | new ServiceCollection()
27 | .AddSingleton()
28 | .AddSingleton()
29 | .AddSingleton()
30 | .AddSingleton()
31 | .BuildServiceProvider()
32 | ) ;
33 | }
34 | public MainViewModel Main
35 | {
36 | get
37 | {
38 | return Ioc.Default.GetService() ?? new MainViewModel(null);
39 | }
40 | }
41 | public HomeViewModel Home
42 | {
43 | get
44 | {
45 | return Ioc.Default.GetService() ?? new HomeViewModel(null);
46 | }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Interfaces/IScript.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Interfaces
9 | {
10 | public interface IScript
11 | {
12 | ///
13 | /// 编译脚本
14 | ///
15 | ///
16 | ///
17 | List Build(ProjectInfoModel projectInfoModel, ViewType viewType);
18 | ///
19 | ///
20 | ///
21 | ///
22 | ///
23 | Task> BuildAsync(ProjectInfoModel projectInfoModel, ViewType viewType);
24 | ///
25 | /// 编译脚本
26 | ///
27 | ///
28 | ///
29 | List Build(ProjectInfoModel projectInfoModel);
30 | ///
31 | ///
32 | ///
33 | ///
34 | ///
35 | Task> BuildAsync(ProjectInfoModel projectInfoModel);
36 | ///
37 | /// 获取参数
38 | ///
39 | ///
40 | string GetParams(T t);
41 | ///
42 | /// 编译
43 | ///
44 | string CompilerName { get; }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/ViewModels/Dialogs/AssemblyFilesViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using PackageEasy.Domain.Enums;
3 | using PackageEasy.Domain.Models;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace PackageEasy.ViewModels.Dialogs
11 | {
12 | public class AssemblyFilesViewModel : ObservableObject
13 | {
14 | private List fileList;
15 | private List> targetDirList;
16 |
17 | public AssemblyFilesViewModel(List assemblyFiles, List> targetDirList)
18 | {
19 | FileList = assemblyFiles;
20 | this.TargetDirList = targetDirList;
21 | }
22 |
23 |
24 | #region 属性
25 |
26 | ///
27 | /// 文件列表
28 | ///
29 | public List FileList
30 | {
31 | get => fileList;
32 | set
33 | {
34 | fileList = value;
35 |
36 | OnPropertyChanged();
37 | }
38 | }
39 |
40 | ///
41 | /// 目标目录
42 | ///
43 | public List> TargetDirList
44 | {
45 | get => targetDirList;
46 | set
47 | {
48 | targetDirList = value;
49 | OnPropertyChanged();
50 | }
51 | }
52 |
53 |
54 | #endregion
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/Dialogs/Wating.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace PackageEasy.Views.Dialogs
16 | {
17 | ///
18 | /// Wating.xaml 的交互逻辑
19 | ///
20 | public partial class Wating : Window
21 | {
22 |
23 | public bool IsRunning { get; set; }
24 | public Wating(bool setOwner = true)
25 | {
26 | InitializeComponent();
27 |
28 | if (setOwner)
29 | {
30 |
31 |
32 | Window owner = App.Current.MainWindow;// WinHelper.GetActiveWindowEx();
33 | if (owner != this)
34 | {
35 | this.Width = owner.ActualWidth;
36 | this.Height = owner.ActualHeight;
37 | this.WindowState = owner.WindowState;
38 |
39 | this.Top = owner.Top;
40 | this.Left = owner.Left;
41 | this.Owner = owner;
42 |
43 | }
44 | }
45 |
46 | IsRunning = true;
47 | }
48 |
49 | private void Grid_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
50 | {
51 | e.Handled = true;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Interfaces/IDataService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Interfaces
8 | {
9 | ///
10 | /// author:TT
11 | /// time:2023-03-11 23:16:48
12 | /// desc:IDataService
13 | ///
14 | public interface IDataService
15 | {
16 | ///
17 | /// 项目key
18 | ///
19 | string ProjectKey { get; set; }
20 | ///
21 | /// 语言变化
22 | ///
23 | event Action LanguageChanged;
24 | ///
25 | /// 编译前事件
26 | ///
27 | event Action PreCompile;
28 | ///
29 | /// 创建对象
30 | ///
31 | event Action CreateProject;
32 | ///
33 | /// 目标路径变化
34 | ///
35 | event Action TargetPathChanged;
36 | ///
37 | /// 创建实验
38 | ///
39 | ///
40 | ///
41 | void OnCreateProject(string name, string key);
42 | ///
43 | /// 编译前事件
44 | ///
45 | void OnPreCompile();
46 |
47 | ///
48 | /// 多语言变化
49 | ///
50 | void OnLanguageChanged();
51 |
52 | ///
53 | /// 目标路径变化
54 | ///
55 | void OnTargetPathChanged();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/Dialogs/Wating.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Common/Helpers/WinMessageHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Common.Helpers
9 | {
10 | public class WinMessageHelper
11 | {
12 | public const int WM_COPYDATA = 0x004A;
13 | public const int HWND_BROADCAST = 0xffff;
14 | public const int WM_SYSCOMMAND = 0x0112;
15 | public const int SC_MAXIMIZE = 0xF030;//窗体最大化消息
16 | public const int SC_NOMAL = 0xF120;//窗体还原消息
17 | public static readonly int WM_OPENFile = RegisterWindowMessage("WM_OPENFile");
18 | [DllImport("user32")]
19 | public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, COPYDATASTRUCT lparam);
20 | [DllImport("user32")]
21 | public static extern int RegisterWindowMessage(string message);
22 | [DllImport("User32.dll", EntryPoint = "SendMessage")]
23 | public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, ref COPYDATASTRUCT lParam);
24 | [DllImportAttribute("user32.dll")]
25 | public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
26 | [DllImport("USER32.DLL")]
27 | public static extern bool SetForegroundWindow(IntPtr hWnd);
28 | }
29 | public struct COPYDATASTRUCT
30 | {
31 | public IntPtr dwData; //可以是任意值
32 | public int cbData; //指定lpData内存区域的字节数
33 | [MarshalAs(UnmanagedType.LPStr)]
34 | public string lpData; //发送给目录窗口所在进程的数据
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Common/Helpers/ConfigHelper.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Common.Helpers
10 | {
11 | public class ConfigHelper
12 | {
13 | static ConfigModel _config;
14 | ///
15 | /// 配置文件
16 | ///
17 | public static ConfigModel Config
18 | {
19 | get
20 | {
21 | if (_config == null)
22 | {
23 | var filePath = Path.Combine(DataHelper.Config, "general.json");
24 | if (File.Exists(filePath))
25 | _config = File.ReadAllText(filePath).DeserializeObject();
26 | if (_config == null)
27 | _config = new ConfigModel();
28 | }
29 | return _config;
30 | }
31 | }
32 | ///
33 | /// 保存
34 | ///
35 | ///
36 | public static void Save(bool isRefresh)
37 | {
38 | var data = Config.SerializeObject();
39 | var filePath = Path.Combine(DataHelper.Config, "general.json");
40 | File.WriteAllText(filePath, data);
41 | if (isRefresh)
42 | {
43 | if (File.Exists(filePath))
44 | _config = File.ReadAllText(filePath).DeserializeObject();
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Common/Helpers/JsonHelpers.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Common.Helpers
9 | {
10 | ///
11 | /// author:TT
12 | /// time:2023-03-10 23:53:01
13 | /// desc:JsonHelpers
14 | ///
15 | public static class JsonHelpers
16 | {
17 | ///
18 | /// 序列化
19 | ///
20 | ///
21 | ///
22 | public static string SerializeObject(this object obj, Formatting formatting=Formatting.Indented)
23 | {
24 | return JsonConvert.SerializeObject(obj, formatting);
25 | }
26 | ///
27 | /// 反序列化
28 | ///
29 | ///
30 | ///
31 | public static T DeserializeObject(this string str)
32 | {
33 | return JsonConvert.DeserializeObject(str);
34 | }
35 | ///
36 | /// 克隆
37 | ///
38 | ///
39 | ///
40 | ///
41 | public static T Clone(this object obj)
42 | {
43 | try
44 | {
45 |
46 | return obj.SerializeObject().DeserializeObject();
47 |
48 | }
49 | catch (Exception ex)
50 | {
51 |
52 | return default(T);
53 | }
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/AssemblyView.xaml.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.ViewModels;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace PackageEasy.Views
18 | {
19 | ///
20 | /// 作者:TT
21 | /// 时间:2023-03-12 22:49:08
22 | /// 描述: AssemblyView.xaml 的交互逻辑、
23 | /// TANGMANGER
24 | ///
25 | public partial class AssemblyView : UserControl
26 | {
27 | public AssemblyView()
28 | {
29 | InitializeComponent();
30 | }
31 |
32 | private void DataGridRow_PreviewMouseDown(object sender, MouseButtonEventArgs e)
33 | {
34 | if(Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
35 | {
36 | return;
37 | }
38 | fileDataGrid.SelectedItems.Clear();
39 | DataGridRow? dataGridRow = sender as DataGridRow;
40 | if (dataGridRow != null)
41 | {
42 | dataGridRow.IsSelected = true;
43 | fileDataGrid.SelectedItems.Add(dataGridRow.DataContext);
44 | }
45 | e.Handled = false;
46 | }
47 |
48 | private void datagrid_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
49 | {
50 | e.Handled = true;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/ProjectInfoModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Models.SaveModel;
2 | using PackageEasy.Domain.Models;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Domain
10 | {
11 | ///
12 | /// author:TT
13 | /// time:2023-03-16 0:09:48
14 | /// desc:ProjectInfoModel
15 | ///
16 | public class ProjectInfoModel
17 | {
18 | public string ProjectKey { get; set; }
19 | ///
20 | /// 额外信息
21 | ///
22 | public ExtraInfo ExtraInfo { get; set; }
23 | ///
24 | /// 基础信息
25 | ///
26 | public BaseInfoModel BaseInfo { get; set; }
27 | ///
28 | /// 组件信息
29 | ///
30 | public AssemblyInfoModel AssemblyInfo { get; set; }
31 | ///
32 | /// 快捷方式信息
33 | ///
34 | public AppIconModel AppIcon { get; set; }
35 | ///
36 | /// 脚本
37 | ///
38 | public List Scripts { get; set; }
39 | ///
40 | /// 注册信息
41 | ///
42 | public RegistryModel Registry { get; set; }
43 | ///
44 | /// 多文件信息
45 | ///
46 | public List MultiFiles { get; set; }
47 | ///
48 | /// 结束页
49 | ///
50 | public FinishModel FinishInfo { get; set; }
51 | ///
52 | /// 目标目录
53 | ///
54 | public List TargetPaths { get; set; }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Converters/Base64ToImageConverter.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Common.Logs;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Globalization;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Data;
10 | using System.Windows.Media.Imaging;
11 |
12 | namespace PackageEasy.Converters
13 | {
14 | internal class Base64ToImageConverter : IValueConverter
15 | {
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | if (value == null) return null;
19 | try
20 | {
21 |
22 |
23 | var base64String = value.ToString().Replace("data:image/jpeg;base64,", "");
24 | var bytes = System.Convert.FromBase64String(base64String);
25 | using (MemoryStream memoryStream = new MemoryStream(bytes))
26 | {
27 | BitmapImage bitmapImage = new BitmapImage();
28 | bitmapImage.BeginInit();
29 | bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
30 | bitmapImage.StreamSource = memoryStream;
31 | bitmapImage.EndInit();
32 | bitmapImage.Freeze();
33 | return bitmapImage;
34 | }
35 | }
36 | catch (Exception ex)
37 | {
38 | Log.Write($"转换图片出错{(value == null ? null : value.ToString())}", ex);
39 | return null;
40 | }
41 | }
42 |
43 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
44 | {
45 | throw new NotImplementedException();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Common.Logs;
2 | using PackageEasy.Helpers;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Configuration;
6 | using System.Data;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 |
11 | namespace PackageEasy
12 | {
13 | ///
14 | /// Interaction logic for App.xaml
15 | ///
16 | public partial class App : Application
17 | {
18 | public App()
19 | {
20 | #if !DEBUG
21 |
22 | this.DispatcherUnhandledException += App_DispatcherUnhandledException;
23 | AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
24 | TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
25 |
26 | #endif
27 | }
28 | protected override void OnStartup(StartupEventArgs e)
29 | {
30 |
31 | base.OnStartup(e);
32 | }
33 | private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
34 | {
35 | const string msg = "异步异常";
36 | try
37 | {
38 | e.SetObserved();
39 | Log.Write(msg, e.Exception);
40 | }
41 | catch (Exception ex)
42 | {
43 | Log.Write(msg, ex);
44 | }
45 |
46 | }
47 |
48 | private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
49 | {
50 | Exception ex = e.ExceptionObject as Exception;
51 | Log.Write("发生CurrentDomain异常:", ex);
52 | }
53 |
54 | private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
55 | {
56 | Log.Write("发生异常:", e.Exception);
57 | e.Handled = true;
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/BaseBulidScript.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using PackageEasy.Domain.Interfaces;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Domain.Models
10 | {
11 | public abstract class BaseBuildScript : IScript
12 | {
13 | ///
14 | /// 编译器名称
15 | ///
16 | public abstract string CompilerName { get; }
17 |
18 | ///
19 | /// 编译
20 | ///
21 | ///
22 | ///
23 | ///
24 | public abstract List Build(ProjectInfoModel projectInfoModel, ViewType viewType);
25 | ///
26 | /// 编译
27 | ///
28 | ///
29 | ///
30 | public abstract List Build(ProjectInfoModel projectInfoModel);
31 | ///
32 | /// 编译
33 | ///
34 | ///
35 | ///
36 | ///
37 | public abstract Task> BuildAsync(ProjectInfoModel projectInfoModel, ViewType viewType);
38 | ///
39 | /// 编译异步
40 | ///
41 | ///
42 | ///
43 | public abstract Task> BuildAsync(ProjectInfoModel projectInfoModel);
44 | ///
45 | /// 获取参数
46 | ///
47 | ///
48 | ///
49 | ///
50 | public abstract string GetParams(T t);
51 | ///
52 | /// 输出路径
53 | ///
54 | public string OutPutFilePath { get; set; }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Helpers/TViewsHelper.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Attributes;
2 | using PackageEasy.Models;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Helpers
10 | {
11 | ///
12 | /// author:TT
13 | /// time:2023-03-11 16:51:14
14 | /// desc:TViewsHelper
15 | ///
16 | public class TViewsHelper
17 | {
18 | ///
19 | /// 导航界面
20 | ///
21 | public static List NaviteViewList = new List();
22 |
23 |
24 | ///
25 | /// 初始化
26 | ///
27 | public static void Init()
28 | {
29 | InitView();
30 | }
31 | private static void InitView()
32 | {
33 | var types = GetAlTypes();
34 | foreach (var item in types)
35 | {
36 | var toolAttribute =
37 | (TViewAttribute)Attribute.GetCustomAttribute(item, typeof(TViewAttribute));
38 |
39 | NaviteViewList.Add(new NaviteModel()
40 | {
41 | Type = toolAttribute.Type,
42 | ViewType = toolAttribute.ViewType,
43 | VmType = toolAttribute.VMType
44 | });
45 | //if (!toolAttribute.IsViewModel)
46 | // CaheDataHelper.SoundsDirectory.Add(toolAttribute.ViewType, toolAttribute.ViewType.GetDescription());
47 |
48 |
49 | }
50 | }
51 |
52 | ///
53 | ///
54 | ///
55 | ///
56 | private static Type[] GetAlTypes()
57 | {
58 | var allTypes = AppDomain.CurrentDomain.GetAssemblies()
59 | .SelectMany(a => a.GetTypes().Where(t => t.GetCustomAttributes(false).ToList().Exists(m => m is TViewAttribute)))
60 | .ToArray();
61 | return allTypes;
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/Dialogs/PasswordDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Controls.Controls;
2 | using PackageEasy.ViewModels.Dialogs;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Data;
11 | using System.Windows.Documents;
12 | using System.Windows.Input;
13 | using System.Windows.Media;
14 | using System.Windows.Media.Imaging;
15 | using System.Windows.Shapes;
16 |
17 | namespace PackageEasy.Views.Dialogs
18 | {
19 | ///
20 | /// PasswordDialog.xaml 的交互逻辑
21 | ///
22 | public partial class PasswordDialog : Window
23 | {
24 | public PasswordDialog()
25 | {
26 | InitializeComponent();
27 | CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, CloseExecute));
28 | this.Owner = App.Current.MainWindow;
29 | }
30 |
31 | private void Window_Loaded(object sender, RoutedEventArgs e)
32 | {
33 |
34 | }
35 | private void CloseExecute(object sender, ExecutedRoutedEventArgs e)
36 | {
37 | this.Close();
38 | }
39 |
40 | private void Button_Click(object sender, RoutedEventArgs e)
41 | {
42 | this.Close();
43 | }
44 | public string Password { get; set; }
45 | public bool IsSuccess = false;
46 | private void Button_Click_1(object sender, RoutedEventArgs e)
47 | {
48 | if (string.IsNullOrWhiteSpace(password.Password))
49 | {
50 | this.Close();
51 | return;
52 | }
53 | Password = password.Password;
54 | IsSuccess = true;
55 | this.Close();
56 | }
57 |
58 | private void Window_KeyDown(object sender, KeyEventArgs e)
59 | {
60 | if(e.Key==Key.Enter)
61 | {
62 | Button_Click_1(null, null);
63 | }
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Helpers/PlugInHelper.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Attributes;
2 | using PackageEasy.Domain.Attributes;
3 | using PackageEasy.Models;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using PackageEasy.Domain.Models;
10 | using PackageEasy.Common.Data;
11 | using System.Reflection;
12 | using System.IO;
13 |
14 | namespace PackageEasy.Helpers
15 | {
16 | public class PlugInHelper
17 | {
18 | public static List PlugInList = new List();
19 | ///
20 | /// 初始化插件
21 | ///
22 | public static void InitPlugIns()
23 | {
24 | PlugInList.Clear();
25 | var types = GetAlTypes();
26 | foreach (var item in types)
27 | {
28 | var toolAttribute =
29 | (PlugInAttribute)Attribute.GetCustomAttribute(item, typeof(PlugInAttribute));
30 | if (toolAttribute != null)
31 | PlugInList.Add(toolAttribute.PlugIn);
32 | //if (!toolAttribute.IsViewModel)
33 | // CaheDataHelper.SoundsDirectory.Add(toolAttribute.ViewType, toolAttribute.ViewType.GetDescription());
34 |
35 |
36 | }
37 | foreach (var item in PlugInList)
38 | {
39 | item.DisplayName = item.Name.GetLangText();
40 | }
41 | }
42 |
43 | private static Type[] GetAlTypes()
44 | {
45 | string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "PackageEasy.PlugIns.dll");
46 | if (File.Exists(path))
47 | {
48 | Assembly assembly = Assembly.LoadFile(path);
49 | var allTypes = assembly.GetTypes().Where(t => t.GetCustomAttributes(false).ToList().Exists(m => m is PlugInAttribute))
50 | .ToArray();
51 | return allTypes;
52 | }
53 | return new Type[0];
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/FinishModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PackageEasy.Domain.Models
8 | {
9 | public class FinishModel
10 | {
11 | ///
12 | /// 安装完自动运行
13 | ///
14 | public bool IsAutoRun { get; set; }
15 | ///
16 | /// 要运行的名称
17 | ///
18 | public string ApplicationName { get; set; }
19 | ///
20 | /// 自述文件名称
21 | ///
22 | public string ReadMeFileName { get; set; }
23 | ///
24 | /// 启动参数
25 | ///
26 | public string RunParam { get; set; }
27 | ///
28 | /// 解除信息
29 | ///
30 | public string UninstallMsg { get; set; }
31 | ///
32 | /// 解除提示
33 | ///
34 | public string UninstallTip { get; set; }
35 | ///
36 | /// 启用进程检测
37 | ///
38 | public bool IsEnableProcess { get; set; }
39 | ///
40 | /// 进程检测提示
41 | ///
42 | public string UninstallProcessTips { get; set; }
43 | ///
44 | /// 安装提示
45 | ///
46 | public string InstallProcessTips { get; set; }
47 | ///
48 | /// 进程名
49 | ///
50 | public string ProcessName { get; set; }
51 | ///
52 | /// 展示自述
53 | ///
54 | public bool IsShowReadme { get; set; }
55 | ///
56 | /// 卸载前执行脚本
57 | ///
58 | public string UnInstallApplication { get; set; }
59 | ///
60 | /// 启用卸载前事件
61 | ///
62 | public bool IsBeforeUnInstall { get; set; }
63 | ///
64 | /// 静默安装
65 | ///
66 | public bool IsQuietInstall { get; set; }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Common/Controls/IconRadioButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Input;
9 |
10 | namespace PackageEasy.Common.Controls
11 | {
12 | ///
13 | /// author:TT
14 | /// time:2023-03-10 23:24:58
15 | /// desc:IconRadioButton
16 | ///
17 | public class IconRadioButton : RadioButton
18 | {
19 |
20 |
21 | public string Icon
22 | {
23 | get { return (string)GetValue(IconProperty); }
24 | set { SetValue(IconProperty, value); }
25 | }
26 |
27 | // Using a DependencyProperty as the backing store for Icon. This enables animation, styling, binding, etc...
28 | public static readonly DependencyProperty IconProperty =
29 | DependencyProperty.Register("Icon", typeof(string), typeof(IconRadioButton));
30 |
31 |
32 | public bool IsShowClose
33 | {
34 | get { return (bool)GetValue(IsShowCloseProperty); }
35 | set { SetValue(IsShowCloseProperty, value); }
36 | }
37 |
38 | // Using a DependencyProperty as the backing store for IsShowClose. This enables animation, styling, binding, etc...
39 | public static readonly DependencyProperty IsShowCloseProperty =
40 | DependencyProperty.Register("IsShowClose", typeof(bool), typeof(IconRadioButton), new PropertyMetadata(true));
41 |
42 |
43 |
44 |
45 |
46 |
47 | public ICommand CloseCommand
48 | {
49 | get { return (ICommand)GetValue(CloseCommandProperty); }
50 | set { SetValue(CloseCommandProperty, value); }
51 | }
52 |
53 | // Using a DependencyProperty as the backing store for CloseCommand. This enables animation, styling, binding, etc...
54 | public static readonly DependencyProperty CloseCommandProperty =
55 | DependencyProperty.Register("CloseCommand", typeof(ICommand), typeof(IconRadioButton));
56 |
57 |
58 |
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/SaveModel/AppIconModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Domain.Models.SaveModel
9 | {
10 | ///
11 | /// author:TT
12 | /// time:2023-04-05 17:33:11
13 | /// desc:AppIconModel
14 | ///
15 | public class AppIconModel
16 | {
17 | private string startMenuName;
18 | private bool isCanChangeStartMenuName;
19 | private bool isCreateWebUrl;
20 | private bool isCreateUnInstall;
21 | private ObservableCollection appIconInfoList;
22 |
23 | ///
24 | /// 启动目录名称
25 | ///
26 | public string StartMenuName
27 | {
28 | get => startMenuName;
29 | set
30 | {
31 | startMenuName = value;
32 | }
33 | }
34 | ///
35 | /// /允许用户改变开始菜单
36 | ///
37 | public bool IsCanChangeStartMenuName
38 | {
39 | get => isCanChangeStartMenuName;
40 | set
41 | {
42 | isCanChangeStartMenuName = value;
43 | }
44 | }
45 |
46 | ///
47 | /// 创建互联网快捷方式
48 | ///
49 | public bool IsCreateWebUrl
50 | {
51 | get => isCreateWebUrl;
52 | set
53 | {
54 | isCreateWebUrl = value;
55 | }
56 | }
57 | ///
58 | /// 创建卸载快捷键
59 | ///
60 | public bool IsCreateUnInstall
61 | {
62 | get => isCreateUnInstall;
63 | set
64 | {
65 | isCreateUnInstall = value;
66 | }
67 | }
68 |
69 | ///
70 | /// 快捷方式列表
71 | ///
72 | public ObservableCollection AppIconInfoList
73 | {
74 | get => appIconInfoList;
75 | set
76 | {
77 | appIconInfoList = value;
78 | }
79 | }
80 |
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Common/TMessageBox.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Enums;
2 | using PackageEasy.Views.Dialogs;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Common
10 | {
11 | ///
12 | /// author:TT
13 | /// time:2023-03-26 16:33:48
14 | /// desc:TMessageBox
15 | ///
16 | public class TMessageBox
17 | {
18 | ///
19 | /// 弹窗
20 | ///
21 | /// 标题
22 | /// 信息
23 | /// 级别
24 | ///
25 | public static TMessageBoxResult ShowMsg(string caption, string msg, MessageLevel level = MessageLevel.Information)
26 | {
27 | MessageBox messageBox = new MessageBox(caption, msg, level);
28 | messageBox.ShowDialog();
29 | return messageBox.MessageBoxResult;
30 | }
31 |
32 | ///
33 | ///弹窗
34 | ///
35 | /// 信息级别
36 | ///
37 | ///
38 | public static TMessageBoxResult ShowMsg(string msg, MessageLevel level = MessageLevel.Information)
39 | {
40 | MessageBox messageBox = new MessageBox("", msg, level);
41 | messageBox.ShowDialog();
42 | return messageBox.MessageBoxResult;
43 | }
44 | ///
45 | /// 弹窗
46 | ///
47 | /// 标题
48 | /// 信息
49 | /// 级别
50 | ///
51 | public static TMessageBoxResult MainShowMsg(string caption, string msg, MessageLevel level)
52 | {
53 | TMessageBoxResult data = TMessageBoxResult.None;
54 | App.Current.Dispatcher.Invoke(() =>
55 | {
56 | MessageBox messageBox = new MessageBox(caption, msg, level);
57 | messageBox.ShowDialog();
58 | data = messageBox.MessageBoxResult;
59 | });
60 | return data;
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/Tools/ScriptControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Common.Data;
2 | using PackageEasy.Controls.Controls;
3 | using PackageEasy.Domain.Common;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.IO;
7 | using System.Linq;
8 | using System.Reflection.Metadata;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows;
12 | using System.Windows.Controls;
13 | using System.Windows.Data;
14 | using System.Windows.Documents;
15 | using System.Windows.Input;
16 | using System.Windows.Media;
17 | using System.Windows.Media.Imaging;
18 | using System.Windows.Navigation;
19 | using System.Windows.Shapes;
20 | using System.Windows.Xps.Packaging;
21 |
22 | namespace PackageEasy.Views.Tools
23 | {
24 | ///
25 | /// ScriptControl.xaml 的交互逻辑
26 | ///
27 | public partial class ScriptControl : BaseControl
28 | {
29 | public ScriptControl(string path)
30 | {
31 | InitializeComponent();
32 | doc.Text = File.ReadAllText(path);// TxtToFlowDocument(File.ReadAllText(path));
33 | }
34 | public static FlowDocument TxtToFlowDocument(string text)
35 | {
36 | var document = new FlowDocument();
37 | using (var stream = new MemoryStream((new UTF8Encoding()).GetBytes(text)))
38 | {
39 | var txt = new TextRange(document.ContentStart, document.ContentEnd);
40 | txt.Load(stream, DataFormats.Text);
41 | }
42 | return document;
43 | }
44 | public override string Description => CommonSettings.ToolScriptControl.GetLangText();
45 |
46 | public override void Load()
47 | {
48 | }
49 |
50 | public override void Save()
51 | {
52 | }
53 |
54 | public override void Unload()
55 | {
56 | }
57 |
58 | private void doc_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
59 | {
60 | if (Keyboard.Modifiers == ModifierKeys.Control)
61 | {
62 | doc.ScrollToHorizontalOffset(doc.HorizontalOffset - e.Delta);
63 | }
64 | else
65 | {
66 | doc.ScrollToVerticalOffset(doc.VerticalOffset - e.Delta);
67 | }
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/Tools/AboutControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.Input;
2 | using PackageEasy.Common.Data;
3 | using PackageEasy.Controls.Controls;
4 | using PackageEasy.Domain.Common;
5 | using PackageEasy.Helpers;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Diagnostics;
9 | using System.Linq;
10 | using System.Text;
11 | using System.Threading.Tasks;
12 | using System.Windows;
13 | using System.Windows.Controls;
14 | using System.Windows.Data;
15 | using System.Windows.Documents;
16 | using System.Windows.Input;
17 | using System.Windows.Media;
18 | using System.Windows.Media.Imaging;
19 | using System.Windows.Navigation;
20 | using System.Windows.Shapes;
21 | using static System.Windows.Forms.LinkLabel;
22 |
23 | namespace PackageEasy.Views.Tools
24 | {
25 | ///
26 | /// AboutControl.xaml 的交互逻辑
27 | ///
28 | public partial class AboutControl : BaseControl
29 | {
30 | private string version;
31 |
32 | public AboutControl()
33 | {
34 | InitializeComponent();
35 | DataContext = this;
36 | Version = CacheDataHelper.Version;
37 | }
38 |
39 | public override string Description => CommonSettings.ToolAbout.GetLangText();
40 |
41 | public override bool ShowSureButton => false;
42 | public override void Load()
43 | {
44 | }
45 |
46 | public override void Save()
47 | {
48 | }
49 |
50 | public override void Unload()
51 | {
52 | }
53 |
54 | #region 属性
55 |
56 | ///
57 | /// 版本
58 | ///
59 | public string Version
60 | {
61 | get => version;
62 | set
63 | {
64 | version = value;
65 | RaisePropertyChanged();
66 | }
67 | }
68 |
69 | #endregion
70 |
71 | #region 命令
72 |
73 |
74 | ///
75 | /// 导航
76 | ///
77 | public RelayCommand NavigateCommand => new RelayCommand((uri) =>
78 | {
79 | if (uri == null) return;
80 | Process.Start(new ProcessStartInfo(uri.AbsoluteUri) { UseShellExecute = true });
81 | //Process.Start(uri.OriginalString);
82 | });
83 |
84 | #endregion
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/Readmes/README.zh_CN.md:
--------------------------------------------------------------------------------
1 | # 基于NSIS打包可视化工具
2 | ## 开发的初衷
3 | * 原有HM NIS Edit 创建安装程序很简单,但是不便于修改,新增。
4 | * 原有nsi脚本直接新增组件,或者删除组件 删除文件等操作不简洁
5 | * 最重要一点 想做点什么玩玩~ 哈哈
6 | ## 软件架构
7 | 采用WPF+MVVM 来进行开发,仿Visual Studio 风格(虽然仿的不是那么彻底 -_-!),基于.net 6开发,支持多工程同时编辑,绑定文件格式为 __.pge__ 文件格式。目前还有较多业务场景没有覆盖,还有些小bug,后期会慢慢维护完善。
8 | ## 版本说明
9 | ### V1.0.7更新(1024程序节特别版本)
10 | * 卸载执行脚本
11 | * 快捷方式参数
12 | * 按文件夹忽略
13 | * 右键选择bug
14 | * 按照文件格式忽略
15 | * 右键刷新可以扫描工作目录文件并自动添加
16 |
17 | ### V1.0.6更新
18 | * 支持用户自定义目标路径,且支持本机保存可以跨项目使用
19 | * 支持安装到所有用户(解决管理员下安装非管理员下运行问题)
20 | * 修复了虚拟化问题导致文件列表展示不正确
21 | * 修复保存校验个别字段不准确
22 | * 修复工作目录和源目录拷贝文件错误
23 | * 补充黑色主题部分颜色值
24 | * 修复切换语言时导致主题列表显示错误
25 | * [更新说明](https://mp.weixin.qq.com/s/g71bUtea4KC0t3PnA4Qtsw)
26 |
27 | ### V1.0.5
28 | * 解决多语言切换问题
29 | * 解决安装可以选择复制文件到指定目录
30 | * 解决无法配置NSIS路径问题
31 | * 解决在结束页面不设置监视进程时无法编译通过的问题
32 | * 新增批量删除,批量选择,批量变更目录
33 | * 新增忽略列表,解决反复添加不需要文件问题
34 | * [更新说明](https://mp.weixin.qq.com/s/8c4ONmWgJ8Uw-Q9E6EYt-A)
35 |
36 | ### V1.0.4
37 | * 生成脚本名有空格时候编译有问题
38 | * 新增pky加密格式,支持文件密码保护,支持pge->pky->pge无缝切换。
39 | * 新增相对路径模式
40 | * 新增另存为
41 | * 新增编译快捷键Ctrl+B
42 | * 新增选择性复制策略
43 | * 完善关于界面信息
44 | * 修改导入文件夹策略,工作区整体导入
45 | * 修改详情行来展示额外策略
46 | * 新增NSIS组件,可以一键安装,切记如果使用了检测检测进程,请记得在扩展中安装进程检测插件
47 | * [更新说明](https://mp.weixin.qq.com/s/1kKiUmz7wdZkE0rTVOCSiA)
48 | ### V1.0.3
49 | **以后版本改为3位数,之前版本设计失误 - -惭愧**
50 | * 生成脚本名有空格时候编译有问题
51 | * 注册格式可以作为可选组件出现
52 | * 控制面板可以选择是否显示版本
53 | * 可以添加文件夹
54 | * 剥离基础设置程序名称格式注册
55 | * 当拷贝后打开文件时保存需要从选路径
56 | * 修复卸载取消后进程依旧进行
57 | * 多语言下 选择不同的文件 或者dll eg:英文下可以选择英文配置文件 中文下可以选择中文配置文件
58 | * 修复静默安装脚本,以及安装不正确
59 | * 新增导出脚本,打开脚本
60 | * 新增内部版本记录到文件,可以溯源
61 | * [使用介绍方法](https://mp.weixin.qq.com/s?__biz=MzA5ODY4MDkzOA==&mid=2447903959&idx=1&sn=7ecb538442d049d320706601ece30371&chksm=849145d2b3e6ccc4d256d83a95f6b350858affd0e5cb29c26a8066588b4d1f66c0fc91d1d7a9&token=886432174&lang=zh_CN#rd)
62 | ### V1.2
63 | * 日志格式设置成utf8
64 | * 新增编译进度动画
65 | * 新增文件版本
66 | * 新增主题切换
67 | * 新增控制面板展示安装包大小
68 | * 其他bug修复&UI调整
69 | ### V1.1
70 | * 新增数据验证
71 | * 新增关闭table页验证
72 | * 新增属性值变化检测
73 | * 新增出品公司名称
74 | * 新增安装包出版人展示
75 | * 优化插件安装
76 | * 其他小UI问题调整
77 | ### V1.0
78 | * 支持自定义工程创建安装
79 | * 支持文件格式自定义
80 | * 支持进程检测,进行安装提示
81 | * 支持组件可视化编辑
82 | * 支持打包插件安装
83 | * 支持最近打开文件快捷访问
84 | * 支持编译前校验
85 | * 还有好多~
86 | ## 使用方法
87 | 晚些时候出个教程 感谢观看~
88 | [使用办法](https://mp.weixin.qq.com/s?__biz=MzA5ODY4MDkzOA==&mid=2447903933&idx=1&sn=5f6107ae0bea22ad1f7c0eb7d81fe70d&chksm=849145b8b3e6ccaef109b2a387560e4ef9e69b22f44e138b6645aeb958a1384c03449413b362#rd)
89 |
90 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/AppIconInfoModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Attributes;
2 | using PackageEasy.Domain.Enums;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Text.Json.Serialization;
8 | using System.Threading.Tasks;
9 |
10 | namespace PackageEasy.Domain.Models
11 | {
12 | ///
13 | /// author:TT
14 | /// time:2023-04-05 17:02:15
15 | /// desc:AppIconInfoModel
16 | ///
17 | public class AppIconInfoModel : BaseModel
18 | {
19 | private bool isSelected;
20 | private string shortcutPath;
21 | private string filePath;
22 | private DescModel iconDir;
23 | private string appIconCutShotParam;
24 |
25 | ///
26 | /// 快捷方式
27 | ///
28 | public string ShortcutPath
29 | {
30 | get => shortcutPath;
31 | set
32 | {
33 | shortcutPath = value;
34 | RaisePropertyChanged();
35 | }
36 | }
37 | ///
38 | /// 目录
39 | ///
40 | public DescModel IconDir
41 | {
42 | get => iconDir;
43 | set
44 | {
45 | iconDir = value;
46 | RaisePropertyChanged();
47 | }
48 |
49 | }
50 | ///
51 | /// 文件路径
52 | ///
53 | public string FilePath
54 | {
55 |
56 | get => filePath;
57 | set
58 | {
59 | filePath = value;
60 | RaisePropertyChanged();
61 | }
62 | }
63 |
64 | ///
65 | /// 选择
66 | ///
67 | [JsonIgnore]
68 | [SaveIgnore]
69 | public bool IsSelected
70 | {
71 | get => isSelected;
72 | set
73 | {
74 | isSelected = value;
75 | RaisePropertyChanged();
76 | }
77 | }
78 |
79 | ///
80 | /// 快捷方式启动参数
81 | ///
82 | public string AppIconCutShotParam
83 | {
84 | get => appIconCutShotParam;
85 | set
86 | {
87 | appIconCutShotParam = value;
88 | RaisePropertyChanged();
89 | }
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Helpers/ThemeHelper.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Common.Helpers;
2 | using PackageEasy.Domain.Models;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 |
11 | namespace PackageEasy.Helpers
12 | {
13 | public class ThemeHelper
14 | {
15 | public static List Themes = new List();
16 | ///
17 | /// 初始化主题
18 | ///
19 | public static void InitTheme()
20 | {
21 | Themes = new List();
22 | var themeFile = Path.Combine(DataHelper.Themes, "ThemeConfig.json");
23 |
24 | if (!string.IsNullOrWhiteSpace(themeFile) && File.Exists(themeFile))
25 | {
26 | var themes = File.ReadAllText(themeFile).DeserializeObject>();
27 | if (themes != null)
28 | {
29 | foreach (var theme in themes)
30 | {
31 | var filePath = Path.Combine(DataHelper.Themes, theme.ThemeName);
32 | if (!string.IsNullOrWhiteSpace(filePath) && File.Exists(filePath))
33 | Themes.Add(theme);
34 | }
35 | }
36 | }
37 |
38 | }
39 | ///
40 | /// 更新主题
41 | ///
42 | ///
43 | public static void UpdateTheme(ThemeModel themeModel)
44 | {
45 | var currentTheme = Themes.Find(p => p.ThemeId == ConfigHelper.Config.ThemeId);
46 | if (currentTheme != null)
47 | {
48 | for (int i = 0; i < App.Current.Resources.MergedDictionaries.Count; i++)
49 | {
50 | var d = App.Current.Resources.MergedDictionaries[i];
51 | if (d.Source != null && d.Source.ToString().Contains(currentTheme.ThemeName))
52 | {
53 | App.Current.Resources.MergedDictionaries.RemoveAt(i);
54 | break;
55 | }
56 | }
57 | }
58 | var path = Path.Combine(DataHelper.Themes, themeModel.ThemeName);
59 | App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(path) });
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Controls/Controls/TProgressRing.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 |
9 | namespace PackageEasy.Controls.Controls
10 | {
11 | [TemplateVisualState(GroupName = GroupActiveStates, Name = StateInactive)]
12 | [TemplateVisualState(GroupName = GroupActiveStates, Name = StateActive)]
13 | public class TProgressRing
14 | : Control
15 | {
16 | private const string GroupActiveStates = "ActiveStates";
17 | private const string StateInactive = "Inactive";
18 | private const string StateActive = "Active";
19 |
20 | ///
21 | /// Identifies the IsActive property.
22 | ///
23 | public static readonly DependencyProperty IsActiveProperty = DependencyProperty.Register("IsActive", typeof(bool), typeof(TProgressRing), new PropertyMetadata(false, OnIsActiveChanged));
24 |
25 | ///
26 | /// Initializes a new instance of the class.
27 | ///
28 | public TProgressRing()
29 | {
30 | this.DefaultStyleKey = typeof(TProgressRing);
31 | }
32 |
33 | private void GotoCurrentState(bool animate)
34 | {
35 | var state = this.IsActive ? StateActive : StateInactive;
36 |
37 | VisualStateManager.GoToState(this, state, animate);
38 | }
39 |
40 | ///
41 | /// When overridden in a derived class, is invoked whenever application code or internal processes call .
42 | ///
43 | public override void OnApplyTemplate()
44 | {
45 | base.OnApplyTemplate();
46 |
47 | GotoCurrentState(false);
48 | }
49 |
50 | private static void OnIsActiveChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
51 | {
52 | ((TProgressRing)o).GotoCurrentState(true);
53 | }
54 |
55 | ///
56 | /// Gets or sets a value that indicates whether the is showing progress.
57 | ///
58 | public bool IsActive
59 | {
60 | get { return (bool)GetValue(IsActiveProperty); }
61 | set { SetValue(IsActiveProperty, value); }
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/ViewModels/Dialogs/ShowWindowViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using CommunityToolkit.Mvvm.Input;
3 | using PackageEasy.Controls.Controls;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 |
11 | namespace PackageEasy.ViewModels.Dialogs
12 | {
13 | internal class ShowWindowViewModel : ObservableObject
14 | {
15 | public ShowWindowViewModel(BaseControl baseControl)
16 | {
17 | if (baseControl != null)
18 | {
19 | WorkView = baseControl;
20 | ShowSureVisibility = baseControl.ShowSureButton ? Visibility.Visible : Visibility.Collapsed;
21 | Title = baseControl.Description;
22 | baseControl?.Load();
23 | }
24 | }
25 |
26 | #region 属性
27 |
28 | private string title;
29 | private BaseControl workView;
30 | private Visibility showSureVisibility;
31 |
32 | ///
33 | /// 标题
34 | ///
35 | public string Title
36 | {
37 | get => title;
38 | set
39 | {
40 | title = value;
41 | OnPropertyChanged();
42 | }
43 | }
44 |
45 | public BaseControl WorkView
46 | {
47 | get => workView;
48 | set
49 | {
50 | workView = value;
51 | OnPropertyChanged();
52 | }
53 | }
54 |
55 | ///
56 | /// 展示确定按钮
57 | ///
58 | public Visibility ShowSureVisibility
59 | {
60 | get => showSureVisibility;
61 | set
62 | {
63 | showSureVisibility = value;
64 | OnPropertyChanged();
65 | }
66 | }
67 |
68 |
69 | #endregion
70 |
71 |
72 | #region 命令
73 |
74 | ///
75 | /// 保存
76 | ///
77 | public RelayCommand SaveCommand => new RelayCommand(() =>
78 | {
79 | WorkView?.Save();
80 |
81 | });
82 |
83 | ///
84 | /// 卸载
85 | ///
86 |
87 | public RelayCommand UnloadCommand => new RelayCommand(() =>
88 | {
89 | WorkView?.Unload();
90 | });
91 |
92 | #endregion
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Common/Helpers/ImageHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Net.Http;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace PackageEasy.Common.Helpers
11 | {
12 | public class ImageHelper
13 | {
14 | ///
15 | /// 转图片
16 | ///
17 | ///
18 | ///
19 | public static string? IcoToPng(string path)
20 | {
21 | if (!File.Exists(path)) return null;
22 | var filePath = Path.Combine(DataHelper.Temp, Guid.NewGuid().ToString() + ".png");
23 | // 加载ICO文件
24 | using (Image icoImage = Image.FromFile(path))
25 | {
26 | using (Bitmap pngImage = new Bitmap(icoImage.Width, icoImage.Height))
27 | {
28 | using (Graphics graphics = Graphics.FromImage(pngImage))
29 | {
30 | graphics.DrawImage(icoImage, new Rectangle(0, 0, icoImage.Width, icoImage.Height));
31 | pngImage.Save(filePath, System.Drawing.Imaging.ImageFormat.Png);
32 | }
33 | }
34 | }
35 | if (File.Exists(filePath))
36 | {
37 | return filePath;
38 | }
39 | else
40 | {
41 | return null;
42 | }
43 |
44 | }
45 | ///
46 | /// 转换到base64
47 | ///
48 | ///
49 | ///
50 | public static string? ImageToBase64(string path)
51 | {
52 | if (!File.Exists(path)) return null;
53 | using (Image image = Image.FromFile(path))
54 | {
55 |
56 |
57 |
58 | // 创建MemoryStream
59 | using (MemoryStream ms = new MemoryStream())
60 | {
61 | // 将图片保存到MemoryStream中
62 | image.Save(ms, image.RawFormat);
63 |
64 | // 将MemoryStream中的数据转换为字节数组
65 | byte[] imageBytes = ms.ToArray();
66 |
67 | // 将字节数组转换为Base64字符串
68 | string base64String = Convert.ToBase64String(imageBytes);
69 |
70 | return base64String;
71 | }
72 | }
73 | }
74 |
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.PlugIns/PlugIn/NProcess.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Attributes;
2 | using PackageEasy.Domain.Models;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using PackageEasy.Common.Data;
9 | using System.IO;
10 | using PackageEasy.Common.Helpers;
11 | using PackageEasy.Domain.Common;
12 |
13 | namespace PackageEasy.PlugIns
14 | {
15 | [PlugIn(CommonSettings.ProcessCheck, "\ue675", typeof(NProcess), "b4a3ab4f-9cd3-401d-acd9-8058c4028211")]
16 | public class NProcess : BasePlugInModel
17 | {
18 | public string Description => "NProcess";
19 |
20 | public string Icon => "\ue675";
21 |
22 | string uid = Guid.NewGuid().ToString();
23 | public override Tuple Execute()
24 | {
25 | var filePath = Path.Combine(DataHelper.Plugin, "nsProcess.zip");
26 | if (!File.Exists(filePath))
27 | {
28 | return new Tuple(true, CommonSettings.FileNoExist.GetLangText());
29 | }
30 | var tempDir = DataHelper.Temp;
31 | var result = ZipHelper.UnZipFile(filePath, "", tempDir);
32 | if (!result.Item1)
33 | {
34 | return result;
35 | }
36 | var rootDir = new FileInfo(ConfigHelper.Config.NSISMakePath).Directory;
37 | var files = Directory.GetFiles(tempDir);
38 | if (files != null && files.Length > 0)
39 | {
40 | foreach (var file in files)
41 | {
42 | FileInfo fileInfo = new FileInfo(file);
43 |
44 | if (fileInfo.Name == "nsProcess.nsh")
45 | {
46 | var targetFilePath = Path.Combine(rootDir.FullName, "Include", fileInfo.Name);
47 | File.Copy(file, targetFilePath, true);
48 | }
49 | else
50 | {
51 | var targetFilePath = Path.Combine(rootDir.FullName, "Plugins", "x86-unicode", fileInfo.Name);
52 | File.Copy(file, targetFilePath, true);
53 | }
54 | }
55 | }
56 | return new Tuple(true, CommonSettings.InstallSuccess.GetLangText());
57 |
58 | }
59 |
60 | public override void Loaded()
61 | {
62 | }
63 |
64 | public override void Unloaded()
65 | {
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Helpers/LanguageHelper.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Common.Helpers;
2 | using PackageEasy.Common.Logs;
3 | using PackageEasy.Domain.Models;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.IO;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows;
11 |
12 | namespace PackageEasy.Helpers
13 | {
14 | internal class LanguageHelper
15 | {
16 | ///
17 | /// 多语言变化
18 | ///
19 | public static event Action LanguageChanged;
20 | public static List LanguageTypes { get; private set; }
21 | ///
22 | /// 初始化
23 | ///
24 | public static void InitLang()
25 | {
26 | var path = Path.Combine(DataHelper.Language, "language.json");
27 | if (File.Exists(path))
28 | {
29 | LanguageTypes = File.ReadAllText(path).DeserializeObject>();
30 | }
31 | if (LanguageTypes == null)
32 | LanguageTypes = new List();
33 | }
34 | ///
35 | /// 设置lang
36 | ///
37 | ///
38 | public static void SetLangType(LanguageTypeModel model)
39 | {
40 | try
41 | {
42 |
43 |
44 | var currentTheme = LanguageTypes.Find(p => p.Id == ConfigHelper.Config.Lang);
45 | if (currentTheme != null)
46 | {
47 | for (int i = 0; i < App.Current.Resources.MergedDictionaries.Count; i++)
48 | {
49 | var d = App.Current.Resources.MergedDictionaries[i];
50 | if (d.Source != null && d.Source.ToString().Contains(currentTheme.FilePath))
51 | {
52 | App.Current.Resources.MergedDictionaries.RemoveAt(i);
53 | break;
54 | }
55 | }
56 | }
57 | var path = Path.Combine(DataHelper.Language, model.FilePath);
58 | App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(path) });
59 | ConfigHelper.Config.Lang = model.Id;
60 | ConfigHelper.Save(true);
61 | LanguageChanged?.Invoke();
62 | }
63 | catch (Exception ex)
64 | {
65 | Log.Write("设置多语言失败", ex);
66 | }
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Common/WinAPIs/WinApi.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace PackageEasy.Common.WinAPIs
9 | {
10 | public class WinApi
11 | {
12 | ///
13 | /// 左键
14 | ///
15 | public const int VK_LBUTTON = 0x1;
16 | ///
17 | /// 左shift
18 | ///
19 | public const int VK_SHIFT = 0x10;
20 | ///
21 | /// ctrl按键
22 | ///
23 | public const int VK_CONTROL = 0x11;
24 |
25 | [DllImport("user32.dll", EntryPoint = "GetCursorPos")]//获取鼠标坐标
26 | public static extern int GetCursorPos(ref PointApi lpPoint);
27 | ///
28 | /// 获取按键状态
29 | ///
30 | ///
31 | ///
32 | [DllImport("user32.dll", EntryPoint = "GetAsyncKeyState")]
33 | public static extern int GetAsyncKeyState(int vKey);
34 |
35 |
36 | [DllImport("user32.dll")]
37 | public static extern int GetWindowLong(IntPtr hwnd, int index);
38 |
39 | [DllImport("user32.dll")]
40 | public static extern int SetWindowLong(IntPtr hwnd, int index, int newStyle);
41 |
42 | [DllImport("user32.dll")]
43 | public static extern bool SetWindowPos(IntPtr hwnd, IntPtr hwndInsertAfter, int x, int y, int width, int height, uint flags);
44 |
45 | [DllImport("user32.dll")]
46 | public static extern IntPtr SendMessage(IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam);
47 | [System.Runtime.InteropServices.DllImport("user32.dll")]
48 | public static extern int SetForegroundWindow(IntPtr hwnd);
49 | [System.Runtime.InteropServices.DllImport("user32.dll")]
50 | public static extern IntPtr SetActiveWindow(IntPtr hwnd);
51 | [System.Runtime.InteropServices.DllImport("user32.dll")]
52 | private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
53 |
54 | public const int GWL_EXSTYLE = -20;
55 | public const int WS_EX_DLGMODALFRAME = 0x0001;
56 | public const int SWP_NOSIZE = 0x0001;
57 | public const int SWP_NOMOVE = 0x0002;
58 | public const int SWP_NOZORDER = 0x0004;
59 | public const int SWP_FRAMECHANGED = 0x0020;
60 | public const uint WM_SETICON = 0x0080;
61 | }
62 | [StructLayout(LayoutKind.Sequential)]//定义与API相兼容结构体,实际上是一种内存转换
63 | public struct PointApi
64 | {
65 | public int X;
66 | public int Y;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy.Domain/Models/MultiFileModel.cs:
--------------------------------------------------------------------------------
1 | using PackageEasy.Domain.Enums;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Text.Json.Serialization;
7 | using System.Threading.Tasks;
8 |
9 | namespace PackageEasy.Domain.Models
10 | {
11 | ///
12 | /// 多文件操作
13 | ///
14 | public class MultiFileModel : BaseModel
15 | {
16 | private bool isSelected;
17 | private InstallLanguageModel lang;
18 | private AssemblyFileModel assemblyFile;
19 | private AssemblyFileModel targetDir;
20 | private TargetPathModel targetPath;
21 | private string customTargetPath;
22 |
23 | ///
24 | /// 选择
25 | ///
26 | [JsonIgnore]
27 | public bool IsSelected
28 | {
29 | get => isSelected;
30 | set
31 | {
32 | isSelected = value;
33 | RaisePropertyChanged();
34 | }
35 | }
36 | ///
37 | /// 多语言标志
38 | ///
39 | public InstallLanguageModel Lang
40 | {
41 | get => lang;
42 |
43 | set
44 | {
45 | lang = value;
46 | RaisePropertyChanged();
47 | }
48 | }
49 |
50 | ///
51 | /// 程序集文件
52 | ///
53 | public AssemblyFileModel AssemblyFile
54 | {
55 | get => assemblyFile;
56 | set
57 | {
58 | assemblyFile = value;
59 | RaisePropertyChanged();
60 | }
61 | }
62 | ///
63 | /// 目标目录
64 | ///
65 | public AssemblyFileModel TargetDir
66 | {
67 | get => targetDir;
68 | set
69 | {
70 | targetDir = value;
71 | RaisePropertyChanged();
72 | }
73 | }
74 |
75 | ///
76 | /// 目标路径
77 | ///
78 | public TargetPathModel TargetPath
79 | {
80 | get => targetPath;
81 | set
82 | {
83 | targetPath = value;
84 | RaisePropertyChanged();
85 | }
86 | }
87 | ///
88 | /// 用户目标路径
89 | ///
90 | public string CustomTargetPath
91 | {
92 | get => customTargetPath;
93 | set
94 | {
95 | customTargetPath = value;
96 | RaisePropertyChanged();
97 | }
98 | }
99 |
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Views/LanguageView.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Styles/PasswordBoxStyle.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
45 |
--------------------------------------------------------------------------------
/PackageEasy/PackageEasy/Helpers/NavigationHelper.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.DependencyInjection;
2 | using PackageEasy.Common.Logs;
3 | using PackageEasy.Domain.Enums;
4 | using PackageEasy.Domain.Interfaces;
5 | using PackageEasy.Enums;
6 | using PackageEasy.ViewModels;
7 | using System;
8 | using System.Collections.Generic;
9 | using System.Linq;
10 | using System.Text;
11 | using System.Threading.Tasks;
12 | using System.Windows;
13 |
14 | namespace PackageEasy.Helpers
15 | {
16 | ///
17 | /// author:TT
18 | /// time:2023-03-11 16:43:40
19 | /// desc:NavigationHelper
20 | ///
21 | public class NavigationHelper
22 | {
23 | ///
24 | /// 跳转
25 | ///
26 | ///
27 | public static void GoTo(ViewType name, T param)
28 | {
29 | var mainView = Ioc.Default.GetService();
30 | if (mainView != null)
31 | {
32 | if (mainView.WorkView != null)
33 | {
34 | var naviget = mainView.WorkView.DataContext as INavigateOut;
35 | if (naviget != null)
36 | naviget.NavigateOut();
37 | }
38 | mainView.WorkView = GetView(name, param);
39 | }
40 | }
41 | ///
42 | /// 跳转
43 | ///
44 | ///
45 | public static void GoTo(ViewType name)
46 | {
47 | var mainView = Ioc.Default.GetService();
48 | if (mainView != null)
49 | {
50 | if (mainView.WorkView != null)
51 | {
52 | var naviget = mainView.WorkView.DataContext as INavigateOut;
53 | if (naviget != null)
54 | naviget.NavigateOut();
55 | }
56 | mainView.WorkView = GetView