本文整理汇总了C#中SeparatedSyntaxList.Select方法的典型用法代码示例。如果您正苦于以下问题:C# SeparatedSyntaxList.Select方法的具体用法?C# SeparatedSyntaxList.Select怎么用?C# SeparatedSyntaxList.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SeparatedSyntaxList
的用法示例。
在下文中一共展示了SeparatedSyntaxList.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteArguments
private static void WriteArguments(OutputWriter writer, InvocationExpressionSyntax invocationExpression,
SeparatedSyntaxList<ArgumentSyntax> arguments, bool firstParameter, bool inParams, IMethodSymbol methodSymbol, bool foundParamsArray,
ITypeSymbol typeSymbol, bool isOverloaded, ISymbol symbol, string instanceName=null)
{
foreach (var arg in arguments.Select(o => new TransformedArgument(o)))
{
if (firstParameter)
firstParameter = false;
else
writer.Write(", ");
var argumentType = TypeProcessor.GetTypeInfo(arg.ArgumentOpt.Expression);
if (!inParams && IsParamsArgument(invocationExpression, arg.ArgumentOpt, methodSymbol))
{
foundParamsArray = true;
typeSymbol = TypeProcessor.GetTypeInfo(arg.ArgumentOpt.Expression).ConvertedType;
if (
!TypeProcessor.ConvertType(typeSymbol)
.StartsWith("Array_T"))
{
inParams = true;
var s = TypeProcessor.ConvertType(typeSymbol);
writer.Write("__ARRAY!(" + s + ")([");
}
}
var isValueType = argumentType.Type != null && argumentType.Type.IsValueType;
ProcessArgument(writer, arg.ArgumentOpt,
isOverloaded && isValueType &&
(arg.ArgumentOpt.RefOrOutKeyword.RawKind == (decimal) SyntaxKind.None));
}
if (inParams)
writer.Write("])");
if (!foundParamsArray && methodSymbol.Parameters.Any() && methodSymbol.Parameters.Last().IsParams)
{
// if (typeSymbol != null)
//{
if (!firstParameter)
writer.Write(",");
var s = TypeProcessor.ConvertType(((IArrayTypeSymbol) methodSymbol.Parameters.Last().Type).ElementType);
writer.Write("__ARRAY!(" + s + ")([])");
//}
/* else
{
if (!firstParameter)
writer.Write(",");
writer.Write("null"); //params method called without any params argument. Send null.
}*/
}
if (instanceName != null)
{
if (!firstParameter)
writer.Write(",");
writer.Write(instanceName);
firstParameter = false;
}
else
if (symbol.ContainingType.TypeKind == TypeKind.Interface) // Need it as specialized as possible
{
if (!firstParameter)
writer.Write(",");
writer.Write("cast({0}) null", TypeProcessor.ConvertType(symbol.ContainingType));
}
writer.Write(")");
}