public static string GenerateName(this IMethodOperation methodOperation) { var method = methodOperation.Method; var name = method.Name; return(name + GenerateParmString(method.GetParameters())); }
public static string GenerateParmsVariableList(this IMethodOperation methodOperation) { var method = methodOperation.Method; var variables = method.GetParameters().Select(p => p.ParameterType.Name.CamelCase()); var list = variables.ToCommaDelimitedList(); return(list); }
public static string GenerateSignature(this IMethodOperation methodOperation) { var method = methodOperation.Method; var returnType = method.ReturnType != null ? method.ReturnType.Name : "void"; var name = returnType + " " + method.Name; return(name + GenerateParmStringSignature(method.GetParameters())); }
public static string GetMethodDebugInfo(this IMethodOperation methodOperation) { var builder = new StringBuilder(); builder.AppendFormat("{0}{1}------------------------------------ MethodOperation ------------------------------------{1}", CodeInterfaceExtensions.Prefix, CodeInterfaceExtensions.DoubleSuffix); builder.AppendFormat("{0}Name: {1}{2}", CodeInterfaceExtensions.Prefix, methodOperation.Name, CodeInterfaceExtensions.DoubleSuffix); builder.AppendFormat("{0}{1}****************** OperationInfo ******************{2}", CodeInterfaceExtensions.NewLine, CodeInterfaceExtensions.Prefix, CodeInterfaceExtensions.DoubleSuffix); builder.Append(((IOperation)methodOperation).GetDebugInfo()); builder.AppendFormat("{0}{1}*****************************************************{2}", CodeInterfaceExtensions.NewLine, CodeInterfaceExtensions.Prefix, CodeInterfaceExtensions.DoubleSuffix); builder.AppendFormat("{0}{1}{1}----------------------------------------------------------------------------------{1}", CodeInterfaceExtensions.Prefix, CodeInterfaceExtensions.Suffix); return(builder.ToString()); }