public string GetSignature(IEntityWithParameters method, bool includeFullName) { _buffer.Length = 0; if (includeFullName) { _buffer.Append(method.FullName); } else { _buffer.Append(method.Name); } _buffer.Append("("); IParameter[] parameters = method.GetParameters(); for (int i = 0; i < parameters.Length; ++i) { if (i > 0) { _buffer.Append(", "); } if (method.AcceptVarArgs && i == parameters.Length - 1) { _buffer.Append('*'); } _buffer.Append(parameters[i].Type); } _buffer.Append(")"); return(_buffer.ToString()); }
public static string GetSignature(IEntityWithParameters method, bool includeFullName) { var buffer = new StringBuilder(includeFullName ? method.FullName : method.Name); buffer.Append("("); IParameter[] parameters = method.GetParameters(); for (int i = 0; i < parameters.Length; ++i) { if (i > 0) { buffer.Append(", "); } if (method.AcceptVarArgs && i == parameters.Length - 1) { buffer.Append('*'); } buffer.Append(parameters[i].Type); } buffer.Append(")"); return(buffer.ToString()); }
private IEnumerable <string> GenericArgumentsOf(IEntityWithParameters entity) { var method = entity as IMethod; if (method != null) { return(GenericsFrom(method.ConstructedInfo, method.GenericInfo)); } return(null); }
public override void LeaveMethodInvocationExpression(MethodInvocationExpression node) { IEntityWithParameters entity = node.Target.Entity as IEntityWithParameters; if (entity != null) { ExpressionCollection arguments = node.Arguments; if (entity.AcceptVarArgs && UnityCallableResolutionServiceModule.IsArrayArgumentExplicitlyProvided(entity.GetParameters(), arguments)) { UnaryExpression expression2; Expression expression = arguments[-1]; UnaryExpression expression1 = expression2 = new UnaryExpression(); int num1 = (int)(expression2.Operator = UnaryOperatorType.Explode); Expression expression4 = expression2.Operand = expression; IType type1 = expression2.ExpressionType = this.GetExpressionType(expression); arguments.ReplaceAt(-1, expression2); } } }
public virtual string FormatSignature(IEntityWithParameters method) { var buffer = new StringBuilder(method.Name); var genericArgs = GenericArgumentsOf(method); if (genericArgs != null) buffer.Append(FormatGenericArguments(genericArgs)); buffer.Append("("); var parameters = method.GetParameters(); var varArgsIndex = method.AcceptVarArgs ? parameters.Length - 1 : -1; for (var i = 0; i < parameters.Length; ++i) { if (i > 0) buffer.Append(", "); if (i == varArgsIndex) buffer.Append('*'); buffer.Append(FormatType(parameters[i].Type)); } buffer.Append(")"); return buffer.ToString(); }
private void PreNormalizeExtensionInvocation(MethodInvocationExpression node, IEntityWithParameters extension) { if (0 == node.Arguments.Count || null == extension || node.Arguments.Count < extension.GetParameters().Length) { node.Arguments.Insert(0, EnsureMemberReferenceForExtension(node).Target); } }
public static string GetSignature(IEntityWithParameters method) { return(My <EntityFormatter> .Instance.FormatSignature(method)); }
private static bool IsVarArgsInvocation(MethodInvocationExpression node, IEntityWithParameters entityWithParameters) { return(entityWithParameters.AcceptVarArgs && !AstUtil.InvocationEndsWithExplodeExpression(node)); }
private IEnumerable<string> GenericArgumentsOf(IEntityWithParameters entity) { var method = entity as IMethod; if (method != null) return GenericsFrom(method.ConstructedInfo, method.GenericInfo); return null; }
private static bool IsVarArgsInvocation(MethodInvocationExpression node, IEntityWithParameters entityWithParameters) { return entityWithParameters.AcceptVarArgs && !AstUtil.InvocationEndsWithExplodeExpression(node); }
public static string GetSignature(IEntityWithParameters method, bool includeFullName) { var buffer = new StringBuilder(includeFullName ? method.FullName : method.Name); buffer.Append("("); IParameter[] parameters = method.GetParameters(); for (int i = 0; i < parameters.Length; ++i) { if (i > 0) buffer.Append(", "); if (method.AcceptVarArgs && i == parameters.Length - 1) buffer.Append('*'); buffer.Append(parameters[i].Type); } buffer.Append(")"); return buffer.ToString(); }
public static string GetSignature(IEntityWithParameters method) { return GetSignature(method, true); }
public static string GetSignature(IEntityWithParameters method) { return My<EntityFormatter>.Instance.FormatSignature(method); }
public string GetSignature(IEntityWithParameters method) { return(GetSignature(method, true)); }
public string GetSignature(IEntityWithParameters method, bool includeFullName) { _buffer.Length = 0; if (includeFullName) { _buffer.Append(method.FullName); } else { _buffer.Append(method.Name); } _buffer.Append("("); IParameter[] parameters = method.GetParameters(); for (int i=0; i<parameters.Length; ++i) { if (i > 0) { _buffer.Append(", "); } if (method.AcceptVarArgs && i == parameters.Length-1) { _buffer.Append('*'); } _buffer.Append(parameters[i].Type); } _buffer.Append(")"); return _buffer.ToString(); }