diff --git a/generator/Ctor.cs b/generator/Ctor.cs index 9d5704316..2beb66dd3 100644 --- a/generator/Ctor.cs +++ b/generator/Ctor.cs @@ -71,7 +71,7 @@ namespace GtkSharp.Generation { void GenerateStatic (GenerationInfo gen_info) { StreamWriter sw = gen_info.Writer; - sw.WriteLine("\t\t" + Protection + " static " + Safety + Modifiers + name + " " + StaticName + "(" + Signature + ")"); + sw.WriteLine("\t\t" + Protection + " static " + Safety + Modifiers + name + " " + StaticName + "(" + Signature + ")"); sw.WriteLine("\t\t{"); Body.Initialize(gen_info, false, false, ""); @@ -100,7 +100,7 @@ namespace GtkSharp.Generation { if (IsStatic) GenerateStatic (gen_info); else { - sw.WriteLine("\t\t{0} {1}{2} ({3}) {4}", Protection, Safety, name, Signature.ToString(), needs_chaining ? ": base (IntPtr.Zero)" : ""); + sw.WriteLine("\t\t{0} {1}{2} ({3}) {4}", Protection, Safety, name, Signature.ToString(), needs_chaining ? ": base (IntPtr.Zero)" : ""); sw.WriteLine("\t\t{"); if (needs_chaining) { diff --git a/generator/GenBase.cs b/generator/GenBase.cs index db0a0040d..b12831bc7 100644 --- a/generator/GenBase.cs +++ b/generator/GenBase.cs @@ -49,16 +49,16 @@ namespace GtkSharp.Generation { } } - public bool IsInternal { - get { - if (elem.HasAttribute ("internal")) { - string attr = elem.GetAttribute ("internal"); - return attr == "1" || attr == "true"; - } - return false; - } - } - + public bool IsInternal { + get { + if (elem.HasAttribute ("internal")) { + string attr = elem.GetAttribute ("internal"); + return attr == "1" || attr == "true"; + } + return false; + } + } + public string LibraryName { get { return ns.GetAttribute ("library"); diff --git a/generator/InterfaceGen.cs b/generator/InterfaceGen.cs index 84042c50d..289267173 100644 --- a/generator/InterfaceGen.cs +++ b/generator/InterfaceGen.cs @@ -170,7 +170,7 @@ namespace GtkSharp.Generation { sw.WriteLine (); sw.WriteLine ("\t\tpublic {0}Adapter ({0}Implementor implementor)", Name); sw.WriteLine ("\t\t{"); - sw.WriteLine ("\t\t\tif (implementor == null)"); + sw.WriteLine ("\t\t\tif (implementor == null)"); sw.WriteLine ("\t\t\t\tthrow new ArgumentNullException (\"implementor\");"); sw.WriteLine ("\t\t\tthis.implementor = implementor;"); sw.WriteLine ("\t\t}"); diff --git a/generator/Method.cs b/generator/Method.cs index 76cd72104..1492bc463 100644 --- a/generator/Method.cs +++ b/generator/Method.cs @@ -229,7 +229,7 @@ namespace GtkSharp.Generation { if (IsDeprecated) gen_info.Writer.WriteLine("\t\t[Obsolete]"); gen_info.Writer.Write("\t\t"); - if (Protection != "") + if (Protection != "") gen_info.Writer.Write("{0} ", Protection); GenerateDeclCommon (gen_info.Writer, implementor); diff --git a/generator/MethodBase.cs b/generator/MethodBase.cs index 9a25fa0e7..9716ff8f6 100644 --- a/generator/MethodBase.cs +++ b/generator/MethodBase.cs @@ -33,7 +33,7 @@ namespace GtkSharp.Generation { bool is_static = false; string mods = String.Empty; string name; - private string protection = "public"; + private string protection = "public"; protected MethodBase (XmlElement elem, ClassBase container_type) { @@ -44,18 +44,18 @@ namespace GtkSharp.Generation { IsStatic = elem.GetAttribute ("shared") == "true"; if (elem.HasAttribute ("new_flag")) mods = "new "; - if (elem.HasAttribute ("accessibility")) { - string attr = elem.GetAttribute ("accessibility"); - switch (attr) { - case "public": - case "protected": - case "internal": - case "private": - case "protected internal": - protection = attr; - break; - } - } + if (elem.HasAttribute ("accessibility")) { + string attr = elem.GetAttribute ("accessibility"); + switch (attr) { + case "public": + case "protected": + case "internal": + case "private": + case "protected internal": + protection = attr; + break; + } + } } protected string BaseName { @@ -148,12 +148,12 @@ namespace GtkSharp.Generation { return parms; } } - - public string Protection { - get { return protection; } - set { protection = value; } - } - + + public string Protection { + get { return protection; } + set { protection = value; } + } + protected string Safety { get { return Body.ThrowsException && !(container_type is InterfaceGen) ? "unsafe " : "";