The MiniObject.CreateNativeObject method does not and can't have parameters

This commit is contained in:
Sebastian Dröge 2009-06-02 12:39:07 +02:00
parent 74756f2c2a
commit 0efb6ed587

View file

@ -32,6 +32,7 @@ namespace GtkSharp.Generation {
private bool preferred;
private string name;
private bool needs_chaining = false;
private bool mini_object = false;
public Ctor (XmlElement elem, ClassBase implementor) : base (elem, implementor)
{
@ -40,6 +41,7 @@ namespace GtkSharp.Generation {
if (implementor is ObjectGen || implementor is MiniObjectGen)
needs_chaining = true;
name = implementor.Name;
mini_object = implementor is MiniObjectGen;
}
public bool Preferred {
@ -110,9 +112,14 @@ namespace GtkSharp.Generation {
sw.WriteLine ("\t\t\tif (GetType () != typeof (" + name + ")) {");
if (Parameters.Count == 0) {
sw.WriteLine ("\t\t\t\tCreateNativeObject (new string [0], new GLib.Value[0]);");
if (mini_object)
sw.WriteLine ("\t\t\t\tCreateNativeObject ();");
else
sw.WriteLine ("\t\t\t\tCreateNativeObject (new string [0], new GLib.Value[0]);");
sw.WriteLine ("\t\t\t\treturn;");
} else {
if (mini_object)
throw new Exception ("MiniObject subclasses can't have ctors with parameters");
ArrayList names = new ArrayList ();
ArrayList values = new ArrayList ();
for (int i = 0; i < Parameters.Count; i++) {