本文整理汇总了C#中BoundObjectCreationExpression.Update方法的典型用法代码示例。如果您正苦于以下问题:C# BoundObjectCreationExpression.Update方法的具体用法?C# BoundObjectCreationExpression.Update怎么用?C# BoundObjectCreationExpression.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoundObjectCreationExpression
的用法示例。
在下文中一共展示了BoundObjectCreationExpression.Update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitObjectCreationExpression
public override BoundNode VisitObjectCreationExpression(BoundObjectCreationExpression node)
{
ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
Debug.Assert(node.InitializerExpressionOpt == null);
TypeSymbol type = this.VisitType(node.Type);
return node.Update(node.Constructor, arguments, node.ArgumentNamesOpt, node.ArgumentRefKindsOpt, node.Expanded, node.ArgsToParamsOpt, node.ConstantValueOpt, null, type);
}
示例2: VisitObjectCreationExpression
public override BoundNode VisitObjectCreationExpression(BoundObjectCreationExpression node)
{
Debug.Assert(node != null);
// Start by rewriting the arguments:
var rewrittenArguments = VisitList(node.Arguments);
// If the mapping from arguments to parameters is perfectly in order, no complex rewriting is needed.
if (node.ArgsToParamsOpt.IsNull && !node.Expanded)
{
return node.Update(node.ConstructorOpt, rewrittenArguments, node.ArgumentNamesOpt, node.ArgumentRefKindsOpt, node.Expanded, node.ArgsToParamsOpt, node.ConstantValueOpt, node.Type);
}
var argumentRefKinds = node.ArgumentRefKindsOpt;
ReadOnlyArray<LocalSymbol> temps;
Debug.Assert(node.ConstructorOpt != null, "rewriting arguments when there is no constructor");
RewriteArguments(node.ConstructorOpt,
node.Expanded,
node.ArgsToParamsOpt,
ref argumentRefKinds,
ref rewrittenArguments,
out temps);
if (temps.IsNullOrEmpty)
{
return node.Update(
node.ConstructorOpt,
rewrittenArguments,
ReadOnlyArray<string>.Null,
argumentRefKinds,
false,
ReadOnlyArray<int>.Null,
node.ConstantValueOpt,
node.Type);
}
else
{
return new BoundSequence(
null,
null,
temps,
ReadOnlyArray<BoundExpression>.Empty,
new BoundObjectCreationExpression(
node.Syntax,
node.SyntaxTree,
node.ConstructorOpt,
rewrittenArguments,
ReadOnlyArray<string>.Null,
argumentRefKinds,
false,
ReadOnlyArray<int>.Null,
node.ConstantValueOpt,
node.Type),
node.Type
);
}
}