ColorVision.Solution
1.3.8.7
dotnet add package ColorVision.Solution --version 1.3.8.7
NuGet\Install-Package ColorVision.Solution -Version 1.3.8.7
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ColorVision.Solution" Version="1.3.8.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ColorVision.Solution" Version="1.3.8.7" />
<PackageReference Include="ColorVision.Solution" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ColorVision.Solution --version 1.3.8.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ColorVision.Solution, 1.3.8.7"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ColorVision.Solution@1.3.8.7
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ColorVision.Solution&version=1.3.8.7
#tool nuget:?package=ColorVision.Solution&version=1.3.8.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ColorVision.Solution
🎯 功能定位
解决方案和工程文件管理模块,提供项目文件的组织、管理和预览功能。类似于 Visual Studio 的解决方案资源管理器,为 ColorVision 系统提供强大的工程管理能力。
作用范围
工程管理层,为用户提供类似IDE的工程文件管理能力,支持文件的浏览、编辑、搜索和批量操作。
主要功能点
核心功能
- 解决方案管理 - 创建、打开、保存解决方案文件(.cvsln格式)
- 文件树视图 - 树形结构展示工程文件组织,支持文件夹和文件的可视化管理
- 多编辑器支持 - 集成文本、图像、Hex、Web等多种编辑器
- 文件搜索 - 快速定位工程中的文件和内容
- 工程配置 - 管理工程相关的配置信息
扩展功能
- 权限控制(RBAC) - 基于角色的访问控制,支持用户、角色、权限管理
- 插件系统 - 支持插件动态加载和管理
- 最近文件 - 记录和管理最近打开的解决方案
- 文件监控 - 实时监控文件系统变化并自动更新视图
- 终端集成 - 内置终端管理窗口
架构设计
核心组件
ColorVision.Solution/
├── V/ # 可视化对象模型
│ ├── VObject.cs # 基础可视化对象
│ ├── VFile.cs # 文件对象
│ ├── VFolder.cs # 文件夹对象
│ ├── SolutionExplorer.cs # 解决方案资源管理器
│ └── VObjectFactory.cs # 对象工厂
├── Editor/ # 编辑器系统
│ ├── EditorManager.cs # 编辑器管理器
│ ├── IEditor.cs # 编辑器接口
│ ├── TextEditor.cs # 文本编辑器
│ ├── ImageEditor.cs # 图像编辑器
│ └── AvalonEditor/ # AvalonEdit 集成
├── FileMeta/ # 文件元数据
│ ├── IFileMeta.cs # 文件元数据接口
│ └── FileMetaRegistry.cs # 文件元数据注册表
├── FolderMeta/ # 文件夹元数据
│ ├── IFolderMeta.cs # 文件夹元数据接口
│ └── FolderMetaRegistry.cs # 文件夹元数据注册表
├── Rbac/ # 权限控制系统
│ ├── RbacManager.cs # RBAC管理器
│ ├── Entity/ # 实体模型
│ └── Services/ # 服务层
├── Searches/ # 搜索功能
│ └── SolutionView.xaml # 解决方案视图
└── RecentFile/ # 最近文件管理
└── RecentFileList.cs # 最近文件列表
与主程序的依赖关系
被引用方式:
- ColorVision 主程序通过
SolutionManager集成解决方案管理 - 通过菜单或快捷键打开解决方案窗口
- 支持命令行参数启动时自动打开解决方案
引用的程序集:
ColorVision.UI- 基础UI组件和扩展ColorVision.Database- 数据库支持ColorVision.ImageEditor- 图像编辑功能AvalonEdit- 代码编辑器控件WPFHexaEditor- Hex编辑器控件Microsoft.Web.WebView2- Web视图支持
使用方式
引用方式
<ProjectReference Include="..\ColorVision.Solution\ColorVision.Solution.csproj" />
基础使用
创建和打开解决方案
// 获取解决方案管理器实例
var solutionManager = SolutionManager.GetInstance();
// 创建新解决方案
string solutionPath = @"C:\Projects\MySolution";
solutionManager.CreateSolution(solutionPath);
// 打开现有解决方案
string existingSolution = @"C:\Projects\MySolution\MySolution.cvsln";
bool success = solutionManager.OpenSolution(existingSolution);
// 访问当前解决方案
var currentSolution = solutionManager.CurrentSolutionExplorer;
使用文件树控件
// 在XAML中使用
<solution:TreeViewControl x:Name="TreeView" />
// 在代码中访问
var treeView = new TreeViewControl();
// 树视图自动绑定到 SolutionManager.SolutionExplorers
注册自定义编辑器
// 使用特性注册编辑器
[EditorForExtension(".txt", ".log", ".md")]
public class MyCustomEditor : EditorBase
{
public override void Open(string filePath)
{
// 编辑器打开逻辑
}
}
// 获取文件的编辑器
var editor = EditorManager.Instance.GetDefaultEditor(".txt");
处理解决方案事件
var solutionManager = SolutionManager.GetInstance();
// 监听解决方案创建事件
solutionManager.SolutionCreated += (sender, args) =>
{
Console.WriteLine("解决方案已创建");
};
// 监听解决方案加载事件
solutionManager.SolutionLoaded += (sender, args) =>
{
Console.WriteLine("解决方案已加载");
};
开发调试
构建项目
# 构建解决方案模块
dotnet build UI/ColorVision.Solution/ColorVision.Solution.csproj
# 构建整个解决方案
dotnet build scgd_general_wpf.sln
运行测试
# 如果有测试项目
dotnet test
目录说明
V/- 可视化对象模型(VObject, VFile, VFolder等)Editor/- 编辑器系统及各类编辑器实现FileMeta/- 文件元数据定义和注册FolderMeta/- 文件夹元数据定义和注册Rbac/- 基于角色的访问控制系统Searches/- 搜索和解决方案视图RecentFile/- 最近文件历史管理Plugins/- 插件管理系统Properties/- 资源文件
配置文件
解决方案配置文件(.cvsln)采用 JSON 格式:
{
"FilePath": "",
"VirtualPath": "",
"IsSetting": false,
"IsSetting1": false,
"Paths": []
}
相关文档链接
技术特性
- ✅ MVVM 架构模式
- ✅ 依赖注入和服务定位
- ✅ 文件系统监控(FileSystemWatcher)
- ✅ 工厂模式和注册表模式
- ✅ 命令模式(RelayCommand)
- ✅ 事件驱动架构
- ✅ 可扩展的插件系统
维护者
ColorVision UI团队
版本历史
当前版本:1.3.8.5
License
参见项目根目录的 LICENSE 文件
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0-windows7.0
- AvalonEdit (>= 6.3.1.120)
- ColorVision.Database (>= 1.3.8.5)
- ColorVision.ImageEditor (>= 1.3.8.9)
- ColorVision.UI (>= 1.3.8.11)
- Dirkster.AvalonDock.Themes.VS2013 (>= 4.72.1)
- Markdig.Signed (>= 0.42.0)
- Microsoft.Web.WebView2 (>= 1.0.3485.44)
- WPFHexaEditor (>= 2.1.7)
-
net8.0-windows7.0
- AvalonEdit (>= 6.3.1.120)
- ColorVision.Database (>= 1.3.8.5)
- ColorVision.ImageEditor (>= 1.3.8.9)
- ColorVision.UI (>= 1.3.8.11)
- Dirkster.AvalonDock.Themes.VS2013 (>= 4.72.1)
- Markdig.Signed (>= 0.42.0)
- Microsoft.Web.WebView2 (>= 1.0.3485.44)
- WPFHexaEditor (>= 2.1.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.3.8.7 | 163 | 10/27/2025 |
| 1.3.8.6 | 106 | 10/11/2025 |
| 1.3.8.5 | 168 | 9/30/2025 |
| 1.3.8.4 | 156 | 9/29/2025 |
| 1.3.8.2 | 161 | 9/29/2025 |
| 1.3.8.1 | 166 | 9/25/2025 |
| 1.3.6.2 | 304 | 9/16/2025 |
| 1.3.6.1 | 160 | 9/5/2025 |
| 1.3.5.2 | 199 | 8/30/2025 |
| 1.3.5.1 | 248 | 8/24/2025 |
| 1.3.3.3 | 193 | 8/24/2025 |
| 1.3.3.2 | 195 | 8/24/2025 |
| 1.3.3.1 | 193 | 6/25/2025 |
| 1.3.2.8 | 170 | 6/24/2025 |
| 1.3.2.6 | 173 | 6/23/2025 |
| 1.3.2.5 | 291 | 6/13/2025 |
| 1.3.2.4 | 286 | 6/13/2025 |
| 1.3.2.3 | 320 | 6/11/2025 |
| 1.3.2.2 | 177 | 6/4/2025 |
| 1.3.2.1 | 172 | 6/2/2025 |
| 1.3.1.1 | 182 | 5/29/2025 |
| 1.2.4.1 | 193 | 5/26/2025 |
| 1.2.3.2 | 184 | 5/25/2025 |
| 1.2.3.1 | 178 | 5/19/2025 |
| 1.1.12.1 | 198 | 3/31/2025 |
| 1.1.11.1 | 181 | 3/3/2025 |
| 1.1.10.6 | 152 | 2/20/2025 |
| 1.1.10.5 | 149 | 2/14/2025 |
| 1.1.10.4 | 144 | 2/12/2025 |
| 1.1.10.3 | 148 | 2/12/2025 |
| 1.1.10.2 | 177 | 2/11/2025 |
| 1.1.10.1 | 150 | 2/11/2025 |
| 1.1.9.32 | 148 | 2/8/2025 |
| 1.1.9.30 | 135 | 2/7/2025 |
| 1.1.9.28 | 144 | 2/6/2025 |
| 1.1.9.27 | 145 | 2/6/2025 |
| 1.1.9.26 | 144 | 2/5/2025 |
| 1.1.9.25 | 138 | 1/24/2025 |
| 1.1.9.24 | 174 | 1/22/2025 |
| 1.1.9.23 | 136 | 1/21/2025 |
| 1.1.9.22 | 149 | 1/21/2025 |
| 1.1.9.21 | 151 | 1/21/2025 |
| 1.1.9.20 | 147 | 1/20/2025 |
| 1.1.9.19 | 138 | 1/17/2025 |
| 1.1.9.18 | 138 | 1/15/2025 |
| 1.1.9.17 | 123 | 1/14/2025 |
| 1.1.9.16 | 122 | 1/14/2025 |
| 1.1.9.15 | 164 | 1/13/2025 |
| 1.1.9.14 | 153 | 1/13/2025 |
| 1.1.9.13 | 142 | 1/13/2025 |
| 1.1.9.12 | 139 | 1/13/2025 |
| 1.1.9.11 | 138 | 1/13/2025 |
| 1.1.9.10 | 141 | 1/13/2025 |
| 1.1.9.8 | 135 | 1/13/2025 |
| 1.1.9.7 | 169 | 1/10/2025 |
| 1.1.9.6 | 133 | 1/8/2025 |
| 1.1.9.5 | 141 | 1/8/2025 |
| 1.1.9.4 | 174 | 1/6/2025 |
| 1.1.9.3 | 160 | 1/6/2025 |