public virtual void EmitPublicCall(CodeBuilder b, string apiClassName, string apiFunctionName) { var apiCall = string.Format("CfxApi.{2}.{0}({1})", apiFunctionName, PublicArgumentList, apiClassName); for (var i = 0; i <= ManagedParameters.Length - 1; i++) { ManagedParameters[i].EmitPublicPreCallStatements(b); } var b1 = new CodeBuilder(b.CurrentIndent); for (var i = 0; i <= ManagedParameters.Length - 1; i++) { ManagedParameters[i].EmitPostPublicStatements(b1); } ReturnType.EmitPublicCallProcessReturnValueStatements(b1); if (PublicReturnType.IsVoid) { b.AppendLine(apiCall + ";"); b.AppendBuilder(b1); } else { if (b1.IsNotEmpty) { b.AppendLine("var __retval = {0};", apiCall); b.AppendBuilder(b1); b.AppendLine("return {0};", PublicReturnType.PublicReturnExpression("__retval")); } else { b.AppendLine("return {0};", PublicReturnType.PublicReturnExpression(apiCall)); } } }