示例#1
0
        internal static ICodeWriter AddParameter(this ICodeWriter @this, ParameterInfo p)
        {
            if (p.IsIn)
            {
                @this.Append("in ");
            }
            else if (p.IsOut)
            {
                @this.Append("out ");
            }
            else if (p.ParameterType.IsByRef)
            {
                @this.Append("ref ");
            }
            Type?parameterType = p.ParameterType.IsByRef ? p.ParameterType.GetElementType() : p.ParameterType;

            return(@this.AppendCSharpName(parameterType, true, true, useValueTupleParentheses: true)
                   .Space()
                   .AppendVariable(p.Name !));
        }