generator: Fix signature of static method overloads

For method with optional parameters, when generating the overload
without the optional parameters, mark the overload as static if the
original method is static.
This commit is contained in:
Bertrand Lorentz 2014-01-05 17:28:30 +01:00
parent 3ea36f5746
commit ee8499483e

View File

@ -218,7 +218,10 @@ namespace GtkSharp.Generation {
public void GenerateOverloads (StreamWriter sw)
{
sw.WriteLine ();
sw.WriteLine ("\t\tpublic " + retval.CSType + " " + Name + "(" + (Signature != null ? Signature.WithoutOptional () : "") + ") {");
sw.Write ("\t\tpublic ");
if (IsStatic)
sw.Write ("static ");
sw.WriteLine (retval.CSType + " " + Name + "(" + (Signature != null ? Signature.WithoutOptional () : "") + ") {");
sw.WriteLine ("\t\t\t{0}{1} ({2});", !retval.IsVoid ? "return " : String.Empty, Name, Signature.CallWithoutOptionals ());
sw.WriteLine ("\t\t}");
}