mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
如果方法入参如果有Description特性,则能够在节点悬浮窗口中显示
This commit is contained in:
@@ -86,6 +86,12 @@ namespace Serein.Library
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private string _name ;
|
||||
|
||||
/// <summary>
|
||||
/// 入参注释
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private string _description;
|
||||
|
||||
/// <summary>
|
||||
/// 自定义的方法入参数据
|
||||
/// </summary>
|
||||
@@ -179,7 +185,7 @@ namespace Serein.Library
|
||||
DataValue = string.IsNullOrEmpty(DataValue) ? string.Empty : DataValue,
|
||||
Items = this.Items?.Select(it => it).ToArray(),
|
||||
IsParams = this.IsParams,
|
||||
|
||||
Description = this.Description,
|
||||
};
|
||||
return pd;
|
||||
}
|
||||
@@ -326,7 +332,7 @@ namespace Serein.Library
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[{this.Index}] {this.Name} : {this.DataType?.FullName}";
|
||||
return $"[{this.Index}] {(string.IsNullOrWhiteSpace(this.Description) ? string.Empty : $"({this.Description})")}{this.Name} : {this.DataType?.FullName}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ namespace Serein.NodeFlow.Model
|
||||
//Convertor = null,
|
||||
InputType = ParameterValueInputType.Input,
|
||||
Items = null,
|
||||
Description = "条件节点入参控制点"
|
||||
};
|
||||
this.MethodDetails.ParameterDetailss = [..pd];
|
||||
}
|
||||
|
||||
@@ -62,6 +62,8 @@ namespace Serein.NodeFlow.Model
|
||||
//Convertor = null,
|
||||
InputType = ParameterValueInputType.Input,
|
||||
Items = null,
|
||||
Description = "表达式节点入参控制点"
|
||||
|
||||
};
|
||||
this.MethodDetails.ParameterDetailss = [.. pd];
|
||||
}
|
||||
|
||||
@@ -92,6 +92,8 @@ namespace Serein.NodeFlow.Model
|
||||
InputType = ParameterValueInputType.Input,
|
||||
Items = null,
|
||||
IsParams = true,
|
||||
Description = "脚本节点入参"
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using Serein.Library.FlowNode;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Serein.NodeFlow.Tool;
|
||||
|
||||
@@ -309,6 +310,7 @@ public static class NodeMethodDetailsHelper
|
||||
{
|
||||
dataType = parameterInfo.ParameterType;
|
||||
}
|
||||
var description = parameterInfo.GetCustomAttribute<DescriptionAttribute>()?.Description ?? "";
|
||||
|
||||
var inputType = GetInputType(explicitParemType);
|
||||
var items = GetExplicitItems(explicitParemType, inputType);
|
||||
@@ -325,6 +327,8 @@ public static class NodeMethodDetailsHelper
|
||||
DataValue = parameterInfo.HasDefaultValue ? parameterInfo?.DefaultValue?.ToString() : "", // 如果存在默认值,则使用默认值
|
||||
Items = items.ToArray(), // 如果是枚举值入参,则获取枚举类型的字面量
|
||||
IsParams = hasParams, // 判断是否为可变参数
|
||||
Description = description // 入参描述
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -107,7 +107,6 @@
|
||||
<CheckBox IsChecked="{Binding NodeModel.DebugSetting.IsInterrupt, Mode=TwoWay}"/>
|
||||
<TextBlock Text="中断节点"/>
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user