The MiniObject.CreateNativeObject method does not and can't have parameters
This commit is contained in:
parent
74756f2c2a
commit
0efb6ed587
@ -32,6 +32,7 @@ namespace GtkSharp.Generation {
|
|||||||
private bool preferred;
|
private bool preferred;
|
||||||
private string name;
|
private string name;
|
||||||
private bool needs_chaining = false;
|
private bool needs_chaining = false;
|
||||||
|
private bool mini_object = false;
|
||||||
|
|
||||||
public Ctor (XmlElement elem, ClassBase implementor) : base (elem, implementor)
|
public Ctor (XmlElement elem, ClassBase implementor) : base (elem, implementor)
|
||||||
{
|
{
|
||||||
@ -40,6 +41,7 @@ namespace GtkSharp.Generation {
|
|||||||
if (implementor is ObjectGen || implementor is MiniObjectGen)
|
if (implementor is ObjectGen || implementor is MiniObjectGen)
|
||||||
needs_chaining = true;
|
needs_chaining = true;
|
||||||
name = implementor.Name;
|
name = implementor.Name;
|
||||||
|
mini_object = implementor is MiniObjectGen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Preferred {
|
public bool Preferred {
|
||||||
@ -110,9 +112,14 @@ namespace GtkSharp.Generation {
|
|||||||
sw.WriteLine ("\t\t\tif (GetType () != typeof (" + name + ")) {");
|
sw.WriteLine ("\t\t\tif (GetType () != typeof (" + name + ")) {");
|
||||||
|
|
||||||
if (Parameters.Count == 0) {
|
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;");
|
sw.WriteLine ("\t\t\t\treturn;");
|
||||||
} else {
|
} else {
|
||||||
|
if (mini_object)
|
||||||
|
throw new Exception ("MiniObject subclasses can't have ctors with parameters");
|
||||||
ArrayList names = new ArrayList ();
|
ArrayList names = new ArrayList ();
|
||||||
ArrayList values = new ArrayList ();
|
ArrayList values = new ArrayList ();
|
||||||
for (int i = 0; i < Parameters.Count; i++) {
|
for (int i = 0; i < Parameters.Count; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user