Fix error in case glade.sh is not found (#9)

This commit is contained in:
Harry 2017-09-23 16:56:25 +02:00 committed by Thibault Saunier
parent 5f3d138d1a
commit 86b20442a2

View file

@ -8,7 +8,22 @@ namespace MonoDevelop.GtkSharp.Addin
{ {
public class GladeDesktopApplication : DesktopApplication public class GladeDesktopApplication : DesktopApplication
{ {
private static readonly string s_unixgladeapp = "-c '" + File.ReadAllText("glade.sh") + "'"; private static readonly string s_unixgladeapp;
static GladeDesktopApplication()
{
try
{
var assembly = typeof(GladeDesktopApplication).Assembly.Location;
var gladesh = Path.Combine(Path.GetDirectoryName(assembly), "glade.sh");
s_unixgladeapp = "-c '" + File.ReadAllText(gladesh) + "'";
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
private readonly string _filename; private readonly string _filename;