protected void PrintCSC(TextWriter textWriter, String indentation,
String namePrefix, String curNS, bool bPrintBody,
String bodyPrefix, StringBuilder sb)
{
Util.Log("URTMethod.PrintCSC name "+_methodName+" namePrefix "+namePrefix+" curNS "+curNS+" bPrintBody "+bPrintBody+" bodyPrefix "+bodyPrefix);
// Custom Attributes
/*
if (!fromSubclass)
{
bool bSoapAction = false;
String soapAction = SoapAction;
if ((soapAction != null) && (soapAction.Length > 0))
bSoapAction = true;
if (IsInteropType || bSoapAction)
{
sb.Length = 0;
sb.Append(indentation);
sb.Append("[SoapMethod(");
if (bSoapAction)
{
sb.Append("SoapAction=\"");
sb.Append(soapAction);
sb.Append("\"");
}
if (IsInteropType)
{
if (bSoapAction)
{
sb.Append(",");
}
sb.Append(", ReturnXmlElementName=\"");
sb.Append(MethodType.Name);
sb.Append(",XmlNamespace=\"");
sb.Append(_methodType.TypeNS);
sb.Append("\", ResponseXmlNamespace=\"");
sb.Append(_methodType.TypeNS);
sb.Append("\"");
}
sb.Append(")]");
textWriter.WriteLine(sb);
}
}
*/
// Check for class methods
sb.Length = 0;
sb.Append(indentation);
if(_methodFlags != 0)
{
if((_methodFlags & 2) != 0)
sb.Append("protected ");
else
sb.Append("public ");
if((_methodFlags & 4) != 0)
sb.Append("override ");
}
sb.Append(GetTypeString(curNS));
sb.Append(namePrefix);
sb.Append(_methodName);
sb.Append('(');
if(_params.Count > 0)
{
Util.Log("URTMethod.PrintCSC Invoke _params[0] 1 PrintCSC");
((URTParam) _params[0]).PrintCSC(sb, curNS);
for(int i=1;i<_params.Count;i++)
{
sb.Append(", ");
Util.Log("URTMethod.PrintCSC Invoke _params 2 PrintCSC");
((URTParam) _params[i]).PrintCSC(sb, curNS);
}
}
sb.Append(')');
if(!bPrintBody)
sb.Append(';');
textWriter.WriteLine(sb);
if(bPrintBody)
{
sb.Length = 0;
sb.Append(indentation);
sb.Append('{');
textWriter.WriteLine(sb);
String newIndentation = indentation + " ";
if(bodyPrefix == null)
{
for(int i=0;i<_params.Count;i++)
{
URTParam param = (URTParam) _params[i];
if(param.ParamType == URTParamType.OUT)
{
sb.Length = 0;
sb.Append(newIndentation);
sb.Append(param.Name);
sb.Append(" = ");
sb.Append(ValueString(param.GetTypeString(curNS)));
sb.Append(';');
textWriter.WriteLine(sb);
}
}
Util.Log("URTMethod.PrintCSC return print");
sb.Length = 0;
sb.Append(newIndentation);
sb.Append("return");
String returnString = ValueString(GetTypeString(curNS));
if(returnString != null)
{
sb.Append('(');
sb.Append(returnString);
sb.Append(')');
}
sb.Append(';');
}
else
{
sb.Length = 0;
sb.Append(newIndentation);
if(ValueString(GetTypeString(curNS)) != null)
sb.Append("return ");
sb.Append(bodyPrefix);
sb.Append(_methodName);
sb.Append('(');
if(_params.Count > 0)
{
Util.Log("URTMethod.PrintCSC Invoke _params[0] 3 PrintCSC");
((URTParam) _params[0]).PrintCSC(sb);
for(int i=1;i<_params.Count;i++)
{
sb.Append(", ");
Util.Log("URTMethod.PrintCSC Invoke _params 4 PrintCSC");
((URTParam) _params[i]).PrintCSC(sb);
}
}
sb.Append(");");
}
textWriter.WriteLine(sb);
textWriter.Write(indentation);
textWriter.WriteLine('}');
}
}