generator: Use List<T> in generated constructors

This makes the generated code a bit nicer, but has no impact outside of
the generated constructors.
This commit is contained in:
Bertrand Lorentz 2012-11-04 16:29:40 +01:00
parent 15c5820cd8
commit 3d6decbd0d

View File

@ -123,8 +123,8 @@ namespace GtkSharp.Generation {
}
if (names.Count == Parameters.Count) {
sw.WriteLine ("\t\t\t\tArrayList vals = new ArrayList();");
sw.WriteLine ("\t\t\t\tArrayList names = new ArrayList();");
sw.WriteLine ("\t\t\t\tvar vals = new List<GLib.Value> ();");
sw.WriteLine ("\t\t\t\tvar names = new List<string> ();");
for (int i = 0; i < names.Count; i++) {
Parameter p = Parameters [i];
string indent = "\t\t\t\t";
@ -139,7 +139,7 @@ namespace GtkSharp.Generation {
sw.WriteLine ("\t\t\t\t}");
}
sw.WriteLine ("\t\t\t\tCreateNativeObject ((string[])names.ToArray (typeof (string)), (GLib.Value[])vals.ToArray (typeof (GLib.Value)));");
sw.WriteLine ("\t\t\t\tCreateNativeObject (names.ToArray (), vals.ToArray ());");
sw.WriteLine ("\t\t\t\treturn;");
} else
sw.WriteLine ("\t\t\t\tthrow new InvalidOperationException (\"Can't override this constructor.\");");