mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-19 16:06:33 +08:00
尝试使用源生成器规范NodeModel代码逻辑
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Serein.Workbench.Themes"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib">
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
>
|
||||
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@@ -12,7 +13,7 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:MethodDetailsControl}">
|
||||
|
||||
<!--根据方法入参数量生成相应的控件-->
|
||||
<ItemsControl ItemsSource="{Binding MethodDetails.ParameterDetailss, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -21,6 +22,7 @@
|
||||
<Style TargetType="ContentControl">
|
||||
<Style.Triggers>
|
||||
<MultiDataTrigger>
|
||||
<!--无须指定参数-->
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding IsExplicitData}" Value="false" />
|
||||
</MultiDataTrigger.Conditions>
|
||||
@@ -43,7 +45,8 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</MultiDataTrigger>
|
||||
|
||||
|
||||
<!--指定参数:选项类型-->
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding IsExplicitData}" Value="true" />
|
||||
@@ -71,13 +74,11 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</MultiDataTrigger>
|
||||
|
||||
<!--指定参数:文本类型(可输入)-->
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding IsExplicitData}" Value="true" />
|
||||
<Condition Binding="{Binding ExplicitTypeName}" Value="Value" />
|
||||
<!--<Condition Binding="{Binding ExplicitTypeName}" Value="{x:Type sys:String}" />
|
||||
<Condition Binding="{Binding ExplicitTypeName}" Value="{x:Type sys:Double}" />-->
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="ContentTemplate">
|
||||
<Setter.Value>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Serein.Library.Entity;
|
||||
using Serein.NodeFlow;
|
||||
using Serein.Library;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
@@ -37,6 +36,9 @@ namespace Serein.Workbench.Themes
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 方法参数控件
|
||||
/// </summary>
|
||||
public partial class MethodDetailsControl : UserControl//,ItemsControl
|
||||
{
|
||||
static MethodDetailsControl()
|
||||
|
||||
@@ -1,25 +1,7 @@
|
||||
using Serein.Library.Api;
|
||||
using Serein.Library.Enums;
|
||||
using Serein.NodeFlow;
|
||||
using Serein.NodeFlow.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Serein.Library;
|
||||
using Serein.Library.Api;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Xml.Linq;
|
||||
using static Serein.Workbench.Themes.TypeViewerWindow;
|
||||
|
||||
namespace Serein.Workbench.Themes
|
||||
{
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
using Serein.Library.Api;
|
||||
using Serein.NodeFlow.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using Serein.Library;
|
||||
using Serein.Library.Api;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Serein.Workbench.Themes
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Serein.Library.Api;
|
||||
using Serein.NodeFlow.Base;
|
||||
using Serein.NodeFlow.Tool.SereinExpression;
|
||||
using Serein.Library.Utils.SereinExpression;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -131,9 +130,9 @@ namespace Serein.Workbench.Themes
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void UpMonitorExpressionButton_Click(object sender, RoutedEventArgs e)
|
||||
private async void UpMonitorExpressionButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (FlowEnvironment is not null && FlowEnvironment.AddInterruptExpression(monitorKey, MonitorExpression)) // 对象预览器尝试添加中断表达式
|
||||
if (FlowEnvironment is not null && await FlowEnvironment.AddInterruptExpressionAsync(monitorKey, MonitorExpression)) // 对象预览器尝试添加中断表达式
|
||||
{
|
||||
if (string.IsNullOrEmpty(MonitorExpression))
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="地址" HorizontalAlignment="Center"></TextBlock>
|
||||
<TextBox x:Name="TextBlockAddres" Grid.Row="0" Grid.Column="1" Text="192.168.1.100"></TextBox>
|
||||
<TextBox x:Name="TextBlockAddres" Grid.Row="0" Grid.Column="1" Text="127.0.0.1"></TextBox>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="端口" HorizontalAlignment="Center"></TextBlock>
|
||||
<TextBox x:Name="TextBlockPort" Grid.Row="1" Grid.Column="1" Text="7525"></TextBox>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="密码" HorizontalAlignment="Center"></TextBlock>
|
||||
|
||||
Reference in New Issue
Block a user