using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Automation.Peers; using Microsoft.UI.Xaml.Automation.Provider; using Windows.Foundation; using Windows.System; using XFEWorkflow.Abstractions; using XFEWorkflow.Core.Runtime; using XFEWorkflow.Services; namespace XFEWorkflow.Controls; public sealed partial class WorkflowCanvas { internal async Task SmokeTypedPortsAsync(string output, Func verifyProperties) { await Task.Delay(180); CenterView(true); await Task.Delay(150); DrawEdges(); PortAnchor Port(string node, string name, bool? outputPort = null) => portElements.Single(x => x.Node == node && x.Port == name && (outputPort is null || x.Output == outputPort)); var colors = Enum.GetValues().Select(type => WorkflowPortPresentation.Color(PortKind.Data, new() { Type = type })).ToList(); colors.Add(WorkflowPortPresentation.Color(PortKind.Execution, null)); colors.Add(WorkflowPortPresentation.Color(PortKind.Data, new() { Type = WorkflowValueType.Object, TypeId = "xfe.wecom.message" })); if (colors.Distinct().Count() != colors.Count) throw new InvalidOperationException("数据类型没有使用不同端口颜色"); foreach (var port in portElements) { var button = UiSmokeTest.Descendants