NodeStudio 0.4.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package NodeStudio --version 0.4.2
                    
NuGet\Install-Package NodeStudio -Version 0.4.2
                    
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="NodeStudio" Version="0.4.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NodeStudio" Version="0.4.2" />
                    
Directory.Packages.props
<PackageReference Include="NodeStudio" />
                    
Project file
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 NodeStudio --version 0.4.2
                    
#r "nuget: NodeStudio, 0.4.2"
                    
#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 NodeStudio@0.4.2
                    
#: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=NodeStudio&version=0.4.2
                    
Install as a Cake Addin
#tool nuget:?package=NodeStudio&version=0.4.2
                    
Install as a Cake Tool

NodeStudio

节点图框架核心库(.NET Standard 2.0)——图引擎、节点模型、表达式与序列化

NodeStudio 是一个 WPF 节点图编辑器框架的核心库:提供节点/端口模型、并行 DAG 执行引擎、条件/数值表达式引擎、图序列化(导出/导入)、组合源生成器,以及自定义类型/属性持久化扩展机制。配套控件库 NodeStudio.Controls 提供完整的 WPF 编辑器界面。

功能

  • 并行执行引擎:入度事件驱动调度,就绪节点并行运行、失败不影响下游、支持取消
  • 节点模型:继承 NodeBase 定义节点,AddInput<T>/AddOutput<T> 声明端口,[Node] 特性进工具箱
  • 节点块:子图封装 + for 循环 + 「运行」开关,双击进入内部编辑
  • 条件/计算表达式:内置表达式引擎(引用输入、数学函数、算术/比较/逻辑),实时校验
  • 序列化:图 JSON 导出/导入(节点/连线/参数/子图),格式带版本号,旧文件兼容、过新文件友好提示
  • 自定义类型端口PortTypeRegistry.Register("name", typeof(T)) 注册任意类型,节点块动态端口可选
  • 属性分层持久化:复杂属性自动序列化 → PropertySerializerRegistry 编解码 → ISerializableNode 完全接管;[NotSerialized] 标记排除
  • 执行会话资源Scope.Track(disposable) 在每轮图执行结束(含失败/取消)后统一释放
  • 全局信号SignalStore + 「发送信号/等待信号」节点——跨块/跨图运行期同步(并行块中途汇合、多图共享状态)
  • 内置延时节点:输入/输出 object 通配、任意类型数据流中做时序控制(响应取消)

快速开始

dotnet add package NodeStudio
using NodeStudio.Core;

var graph = new NodeGraph();
var node = new MyNode { Name = "我的节点" };
graph.AddNode(node);
var result = await graph.ExecuteAsync(); // GraphResult:耗时/成功/失败节点

定义节点

// [Node(分类, 工具箱显示名)];Icon 可选(Segoe MDL2 Assets 码点),不写则用工具箱默认图标
[Node("基础", "常量", Icon = "\uE8A5", Description = "输出固定常量值")]
public class ConstantNode : NodeBase
{
    private readonly NodeOutput<int> _output;
    public int Value { get; set; } = 1; // 自动随图序列化

    public ConstantNode() => _output = AddOutput<int>("结果");

    protected override Task ExecuteAsync()
    {
        _output.SetValue(Value);
        return Task.CompletedTask;
    }

    public override INode Clone() // 复制粘贴需要
    {
        var c = new ConstantNode { Value = Value };
        Comp.CopyTo(c.Comp);
        return c;
    }
}
  • 输入端口:AddInput<int>("数值A"),执行时 input.GetValue() 读取
  • 异步/取消:await Task.Delay(ms, CurrentCancellationToken)
  • 资源释放:Scope?.Track(obj)
  • 属性持久化:默认自动;[NotSerialized] 排除;PropertySerializerRegistry / ISerializableNode 处理特殊类型
  • 工具箱图标:[Node(Icon = "\uE8EF")] 指定专属图标;不指定则显示通用默认图标(全局默认可改:ToolboxItem.DefaultIcon = "\uXXXX",需在扫描工具箱前设置)

组合源生成器

本包同时是 Roslyn 源生成器(NodeCompositionGenerator):使用 NodeComposition 组合方式定义节点时,源生成器自动生成接口委托成员,避免手写重复代码。

依赖

  • System.Text.Json 8.0.5

许可证

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NodeStudio:

Package Downloads
NodeStudio.Controls

NodeStudio 节点图编辑器控件库(WPF):基于 Nodify 的节点画布、工具箱、属性面板与操作界面,内置深色样式;依赖 NodeStudio 核心库。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.3 32 8/30/2026
0.4.2 89 8/24/2026
0.4.1 91 8/21/2026
0.4.0 102 8/17/2026
0.3.0 101 8/16/2026
0.2.0 97 8/13/2026
0.1.0 93 8/11/2026