本文整理汇总了C#中Dynamo.Models.NodeModel.HasInput方法的典型用法代码示例。如果您正苦于以下问题:C# NodeModel.HasInput方法的具体用法?C# NodeModel.HasInput怎么用?C# NodeModel.HasInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamo.Models.NodeModel
的用法示例。
在下文中一共展示了NodeModel.HasInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildAstForPartialMultiOutput
/// <summary>
/// Produces AST for a partial function application of a multi-output function.
/// </summary>
/// <param name="model">NodeModel to produce AST for.</param>
/// <param name="rhs">AST representing the partial application. This will need to be used to assign all output port identifiers.</param>
/// <param name="resultAst">Result accumulator: add all new output AST to this list.</param>
protected virtual void BuildAstForPartialMultiOutput(
NodeModel model, AssociativeNode rhs, List<AssociativeNode> resultAst)
{
var missingAmt =
Enumerable.Range(0, model.InPortData.Count).Count(x => !model.HasInput(x));
var tmp =
AstFactory.BuildIdentifier("__partial_" + model.GUID.ToString().Replace('-', '_'));
resultAst.Add(AstFactory.BuildAssignment(tmp, rhs));
resultAst.AddRange(
(Definition.ReturnKeys ?? Enumerable.Empty<string>()).Select(
AstFactory.BuildStringNode)
.Select(
(rtnKey, index) =>
AstFactory.BuildAssignment(
model.GetAstIdentifierForOutputIndex(index),
AstFactory.BuildFunctionObject(
"__ComposeBuffered",
3,
new[] { 0, 1 },
new List<AssociativeNode>
{
AstFactory.BuildExprList(
new List<AssociativeNode>
{
AstFactory.BuildFunctionObject(
"__GetOutput",
2,
new[] { 1 },
new List<AssociativeNode>
{
AstFactory.BuildNullNode(),
rtnKey
}),
tmp
}),
AstFactory.BuildIntNode(missingAmt),
AstFactory.BuildNullNode()
}))));
}