-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
40 lines (34 loc) · 1013 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.IO;
using Gtk;
using System.Linq;
using System.Xml;
namespace SpineGTK_v1
{
class MainClass
{
public static void Main(string[] args)
{
Application.Init();
MainWindow win = new MainWindow();
string home = Environment.GetEnvironmentVariable("HOME");
if (string.IsNullOrEmpty(home))
{
var passwd = File.ReadAllLines("/etc/passwd");
var entry = passwd.FirstOrDefault(x => x.StartsWith(Environment.UserName + ":"));
if (entry != null)
{
var parts = entry.Split(':');
home = parts[5];
}
}
String Path = home + "/SpineGTK/config.xml";
if (!Directory.Exists(home + "/SpineGTK"))
{
Directory.CreateDirectory(home + "/SpineGTK");
}
win.ShowAll();
Application.Run();
}
}
}