本文整理汇总了C#中Dynamo.Models.WorkspaceModel.AddConnection方法的典型用法代码示例。如果您正苦于以下问题:C# WorkspaceModel.AddConnection方法的具体用法?C# WorkspaceModel.AddConnection怎么用?C# WorkspaceModel.AddConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamo.Models.WorkspaceModel
的用法示例。
在下文中一共展示了WorkspaceModel.AddConnection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Collapse
//.........这里部分代码省略.........
int inputReceiverData = input.Item2.Item2;
NodeModel inputNode = input.Item2.Item3.Item2;
int inputData = input.Item2.Item3.Item1;
Symbol node;
var key = Tuple.Create(inputNode, inputData);
if (uniqueInputSenders.ContainsKey(key))
{
node = uniqueInputSenders[key];
}
else
{
inConnectors.Add(Tuple.Create(inputNode, inputData));
node = newNodeWorkspace.AddNode<Symbol>();
node.InputSymbol = inputReceiverNode.InPortData[inputReceiverData].NickName;
node.SetNickNameFromAttribute();
node.DisableReporting();
node.X = 0;
node.Y = inputIndex*(50 + node.Height);
uniqueInputSenders[key] = node;
}
var curriedNode = curriedNodeArgs.FirstOrDefault(x => x.OuterNode == inputNode);
if (curriedNode == null)
{
newNodeWorkspace.AddConnection(
node,
inputReceiverNode,
0,
inputReceiverData);
}
else
{
//Connect it to the applier
newNodeWorkspace.AddConnection(node, curriedNode.InnerNode, 0, 0);
//Connect applier to the inner input receive
newNodeWorkspace.AddConnection(
curriedNode.InnerNode,
inputReceiverNode,
0,
inputReceiverData);
}
}
#endregion
#region Process outputs
//List of all inner nodes to connect an output. Unique.
var outportList = new List<Tuple<NodeModel, int>>();
var outConnectors = new List<Tuple<NodeModel, int, int>>();
int i = 0;
if (outputs.Any())
{
foreach (var output in outputs)