-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathProgram.cs
More file actions
53 lines (40 loc) · 1.51 KB
/
Program.cs
File metadata and controls
53 lines (40 loc) · 1.51 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Configuration;
using GLib;
using Gtk;
using LadderLogic.Updater;
namespace LadderLogic
{
using Controller;
using Presentation;
using Reader;
using Surface;
class MainClass
{
public static AppWindow _main;
public static void Main (string[] args)
{
AppDomain.CurrentDomain.UnhandledException +=
(sender, e) => new UnhandledExceptionDialog(_main, e.ExceptionObject as Exception).ShowDialog();
ExceptionManager.UnhandledException +=
e => new UnhandledExceptionDialog(_main, e.ExceptionObject as Exception).ShowDialog();
AppController.Instance.Initialize();
if (args.Length > 0 && System.IO.File.Exists(args[0]))
{
AppController.Instance.FileName = args[0];
var saved = ConfigManager.Read<PrimitivesSurface>(AppController.Instance.FileName);
AppController.Instance.ResetSurface();
AppController.Instance.ReloadSurface(saved);
}
var localFile = ConfigurationManager.AppSettings["LocalFile"];
var remoteFile = ConfigurationManager.AppSettings["RemoteFile"];
var remoteVersion = ConfigurationManager.AppSettings["RemoteVersion"];
UpdateHelper.LocalFile = string.IsNullOrEmpty(localFile) ? UpdateHelper.LocalFile : localFile;
UpdateHelper.RemoteFile = string.IsNullOrEmpty(remoteFile) ? UpdateHelper.RemoteFile : remoteFile;
UpdateHelper.RemoteVersion = string.IsNullOrEmpty(remoteVersion) ? UpdateHelper.RemoteVersion : remoteVersion;
Application.Init ();
_main = new AppWindow();
Application.Run();
}
}
}