From a281a85f9dbd1a317a6daea6ec8629463e30f064 Mon Sep 17 00:00:00 2001 From: Antonius Riha Date: Sun, 7 Sep 2014 19:51:13 +0200 Subject: [PATCH] gtk: Use the same behavior in Builder constructor overloads Each overload needs to call Assembly.GetCallingAssembly () explicitly, otherwise the calling assembly would end up being gtk-sharp. --- gtk/Builder.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gtk/Builder.cs b/gtk/Builder.cs index de7d8c37d..acf34af93 100644 --- a/gtk/Builder.cs +++ b/gtk/Builder.cs @@ -26,6 +26,7 @@ namespace Gtk { using System; + using System.Reflection; using System.Runtime.InteropServices; public partial class Builder { @@ -168,21 +169,22 @@ namespace Gtk { TranslationDomain = translation_domain; } - public Builder (string resource_name) : this (resource_name, null) + public Builder (string resource_name) : this (Assembly.GetCallingAssembly (), resource_name, null) { } - public Builder (string resource_name, string translation_domain) : this (System.Reflection.Assembly.GetEntryAssembly (), resource_name, translation_domain) + public Builder (string resource_name, string translation_domain) + : this (Assembly.GetCallingAssembly (), resource_name, translation_domain) { } - public Builder (System.Reflection.Assembly assembly, string resource_name, string translation_domain) : this () + public Builder (Assembly assembly, string resource_name, string translation_domain) : this () { if (GetType() != typeof (Builder)) throw new InvalidOperationException ("Cannot chain to this constructor from subclasses."); if (assembly == null) - assembly = System.Reflection.Assembly.GetCallingAssembly (); + assembly = Assembly.GetCallingAssembly (); System.IO.Stream s = assembly.GetManifestResourceStream (resource_name); if (s == null)