forked from cpipero/ArduinoLadder
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
57 lines (44 loc) · 1.3 KB
/
Program.cs
File metadata and controls
57 lines (44 loc) · 1.3 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
54
55
56
57
using Gtk;
using System.Configuration;
using System;
using System.IO;
using GLib;
using LadderLogic.Reader;
using LadderLogic.Surface;
namespace LadderLogic
{
using Controller;
using Presentation;
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();
var isElementsView = ConfigurationManager
.AppSettings ["ElementsView"]
.ToLowerInvariant () == "true";
if (isElementsView) {
DrawingAreaController.Instance.Initialize ();
} else {
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);
}
}
Application.Init ();
if (isElementsView) {
//_main = new DrawingAreaWindow ();
} else {
_main = new AppWindow ();
}
Application.Run ();
}
}
}