mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-30 09:38:37 +02:00
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.
This commit is contained in:
parent
2034648ec2
commit
a281a85f9d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user