hytos / ID2.Manager / ID2.Manager.Compare / Program.cs @ dfb9a03c
이력 | 보기 | 이력해설 | 다운로드 (3.52 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Threading.Tasks; |
5 |
using System.Windows.Forms; |
6 |
using ID2.Manager.Forms; |
7 |
using log4net; |
8 |
using GemBox.Spreadsheet; |
9 |
using System.ComponentModel; |
10 |
using System.Drawing; |
11 |
|
12 |
namespace ID2.Manager |
13 |
{ |
14 |
public class Document : INotifyPropertyChanged |
15 |
{ |
16 |
public event PropertyChangedEventHandler PropertyChanged; |
17 |
protected void OnPropertyChanged(string propName) |
18 |
{ |
19 |
if (PropertyChanged != null) |
20 |
{ |
21 |
PropertyChanged(this, new PropertyChangedEventArgs(propName)); |
22 |
} |
23 |
} |
24 |
|
25 |
public Document(string DocNo) |
26 |
{ |
27 |
DocumentNo = DocNo; |
28 |
} |
29 |
|
30 |
private bool _Checked = false; |
31 |
public bool Checked |
32 |
{ |
33 |
get { return _Checked; } |
34 |
set |
35 |
{ |
36 |
bool tmp = IsValid && value; |
37 |
if(_Checked != tmp) |
38 |
{ |
39 |
_Checked = tmp; |
40 |
OnPropertyChanged("Checked"); |
41 |
} |
42 |
} |
43 |
} |
44 |
|
45 |
[Browsable(false)] |
46 |
public string DocumentNo { get; set; } |
47 |
public string AutoCADFileName { get; set; } |
48 |
public string AVEVAFileName { get; set; } |
49 |
|
50 |
[Browsable(false)] |
51 |
public bool IsValid |
52 |
{ |
53 |
get { return !string.IsNullOrEmpty(AutoCADFileName) && !string.IsNullOrEmpty(AVEVAFileName); } |
54 |
} |
55 |
} |
56 |
|
57 |
static class Program |
58 |
{ |
59 |
/// </summary> |
60 |
public static ILog logger = null; |
61 |
|
62 |
public static string IniFilePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), |
63 |
Application.ProductName, $"{Application.ProductName}.ini"); |
64 |
#region 테마 |
65 |
public static string ThemeName = "ControlDefault"; |
66 |
#endregion |
67 |
|
68 |
public static string AutoCADFolder = string.Empty; |
69 |
public static string AVEVAPIDFolder = string.Empty; |
70 |
|
71 |
public static Font UnmatchedFont = new System.Drawing.Font("Segoe UI", 9F, FontStyle.Italic); |
72 |
public static Font MatchedFont = new System.Drawing.Font("Segoe UI", 9F, FontStyle.Bold); |
73 |
|
74 |
public static BindingList<Document> Documents {get;} = new BindingList<Document>(); |
75 |
|
76 |
/// <summary> |
77 |
/// 해당 애플리케이션의 주 진입점입니다. |
78 |
/// </summary> |
79 |
[STAThread] |
80 |
static void Main() |
81 |
{ |
82 |
logger = LogManager.GetLogger(typeof(Program)); |
83 |
|
84 |
Application.ThreadException += Application_ThreadException; |
85 |
devDept.LicenseManager.Unlock(typeof(devDept.Eyeshot.Workspace), "US22-CKTU9-RX12F-3SF6-R1X9"); |
86 |
SpreadsheetInfo.SetLicense(Properties.Settings.Default.GemBoxLicense); |
87 |
|
88 |
Application.EnableVisualStyles(); |
89 |
Application.SetCompatibleTextRenderingDefault(false); |
90 |
|
91 |
CustomSynchronizationContext.Install(); |
92 |
|
93 |
#region 프로그램 업데이트 후 기존 설정값을 유지하도록 함 |
94 |
if (Properties.Settings.Default.UserInfo.Equals(string.Empty) || Properties.Settings.Default.ID2SQLiteInfo.Equals(string.Empty)) |
95 |
{ |
96 |
Properties.Settings.Default.Upgrade(); |
97 |
Properties.Settings.Default.Reload(); |
98 |
} |
99 |
#endregion |
100 |
|
101 |
Application.Run(new Main()); |
102 |
} |
103 |
|
104 |
private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) |
105 |
{ |
106 |
logger.Error("Application Exception.", e.Exception); |
107 |
} |
108 |
} |
109 |
} |