1 |
787a4489
|
KangIngu
|
using KCOM.Common;
|
2 |
32af2c3b
|
djkim
|
using KCOM.Controls;
|
3 |
264c9309
|
ljiyeon
|
using KCOM.Views;
|
4 |
787a4489
|
KangIngu
|
using KCOMDataModel;
|
5 |
|
|
using KCOMDataModel.DataModel;
|
6 |
b0fb3ad7
|
ljiyeon
|
using MarkupToPDF.Common;
|
7 |
5529d2a2
|
humkyung
|
using MarkupToPDF.Controls.Parsing;
|
8 |
b0fb3ad7
|
ljiyeon
|
using MarkupToPDF.Serialize.Core;
|
9 |
|
|
using MarkupToPDF.Serialize.S_Control;
|
10 |
787a4489
|
KangIngu
|
using System;
|
11 |
|
|
using System.Collections.Generic;
|
12 |
264c9309
|
ljiyeon
|
using System.ComponentModel;
|
13 |
|
|
using System.Diagnostics;
|
14 |
6707a5c7
|
ljiyeon
|
using System.IO;
|
15 |
787a4489
|
KangIngu
|
using System.Linq;
|
16 |
264c9309
|
ljiyeon
|
using System.Net;
|
17 |
|
|
using System.Reflection;
|
18 |
71bfd53e
|
ljiyeon
|
using System.Runtime.InteropServices;
|
19 |
787a4489
|
KangIngu
|
using System.Text;
|
20 |
264c9309
|
ljiyeon
|
using System.Threading;
|
21 |
|
|
using System.Threading.Tasks;
|
22 |
787a4489
|
KangIngu
|
using System.Windows;
|
23 |
|
|
using System.Windows.Controls;
|
24 |
|
|
using System.Windows.Data;
|
25 |
|
|
using System.Windows.Documents;
|
26 |
|
|
using System.Windows.Input;
|
27 |
|
|
using System.Windows.Media;
|
28 |
|
|
using System.Windows.Media.Imaging;
|
29 |
|
|
using System.Windows.Navigation;
|
30 |
|
|
using System.Windows.Shapes;
|
31 |
6707a5c7
|
ljiyeon
|
using System.Xml;
|
32 |
992a98b4
|
KangIngu
|
using Telerik.Windows.Controls;
|
33 |
7e2d29a0
|
ljiyeon
|
using WinInterop = System.Windows.Interop;
|
34 |
787a4489
|
KangIngu
|
|
35 |
|
|
namespace KCOM
|
36 |
|
|
{
|
37 |
|
|
/// <summary>
|
38 |
|
|
/// MainWindow.xaml에 대한 상호 작용 논리
|
39 |
|
|
/// </summary>
|
40 |
68302e9d
|
taeseongkim
|
public partial class MainWindow : KCOM.Controls.CustomizedWindow.CustomWindow
|
41 |
787a4489
|
KangIngu
|
{
|
42 |
32af2c3b
|
djkim
|
bool isSaveCheck = false;
|
43 |
d33ef543
|
taeseongkim
|
|
44 |
32af2c3b
|
djkim
|
ProgressControl progressControl = null;
|
45 |
|
|
string destfilepath = string.Empty;
|
46 |
|
|
|
47 |
787a4489
|
KangIngu
|
public MainWindow()
|
48 |
|
|
{
|
49 |
e0cfc73c
|
ljiyeon
|
App.splashString(ISplashMessage.MAINWINDOW);
|
50 |
c362d2a5
|
taeseongkim
|
|
51 |
787a4489
|
KangIngu
|
this.Loaded += MainWindow_Loaded;
|
52 |
eeb0a39c
|
taeseongkim
|
this.Unloaded += MainWindow_Unloaded;
|
53 |
8e6884a5
|
taeseongkim
|
//this.PreviewKeyDown += new KeyEventHandler(KeyEventDownAction);
|
54 |
d97dbc7f
|
taeseongkim
|
this.Activated += MainWindow_Activated;
|
55 |
|
|
}
|
56 |
|
|
|
57 |
9d5b4bc2
|
taeseongkim
|
|
58 |
2007ecaa
|
taeseongkim
|
|
59 |
d97dbc7f
|
taeseongkim
|
private void MainWindow_Activated(object sender, EventArgs e)
|
60 |
|
|
{
|
61 |
|
|
this.Topmost = true;
|
62 |
448c5399
|
taeseongkim
|
this.Topmost = false;
|
63 |
787a4489
|
KangIngu
|
}
|
64 |
ca16abb2
|
ljiyeon
|
|
65 |
eeb0a39c
|
taeseongkim
|
private void MainWindow_Unloaded(object sender, RoutedEventArgs e)
|
66 |
|
|
{
|
67 |
|
|
}
|
68 |
|
|
|
69 |
787a4489
|
KangIngu
|
public void DialogMessage_Alert(string content, string header)
|
70 |
|
|
{
|
71 |
c362d2a5
|
taeseongkim
|
App.splashScreen.Close();
|
72 |
|
|
|
73 |
787a4489
|
KangIngu
|
Telerik.Windows.Controls.DialogParameters parameters = new Telerik.Windows.Controls.DialogParameters()
|
74 |
|
|
{
|
75 |
b9b01f8e
|
ljiyeon
|
Owner = Application.Current.MainWindow,
|
76 |
0d32593b
|
ljiyeon
|
Content = new TextBlock()
|
77 |
d33ef543
|
taeseongkim
|
{
|
78 |
0d32593b
|
ljiyeon
|
MinWidth = 400,
|
79 |
|
|
FontSize = 12,
|
80 |
|
|
Text = content,
|
81 |
|
|
TextWrapping = System.Windows.TextWrapping.Wrap
|
82 |
|
|
},
|
83 |
787a4489
|
KangIngu
|
Header = header,
|
84 |
|
|
Theme = new Telerik.Windows.Controls.VisualStudio2013Theme(),
|
85 |
|
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
86 |
|
|
};
|
87 |
|
|
Telerik.Windows.Controls.RadWindow.Alert(parameters);
|
88 |
|
|
}
|
89 |
7e2d29a0
|
ljiyeon
|
|
90 |
a197bf6f
|
taeseongkim
|
private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
|
91 |
787a4489
|
KangIngu
|
{
|
92 |
0c997b99
|
ljiyeon
|
InitializeComponent();
|
93 |
f44e0cd0
|
이지연
|
//Loaded 이벤트에서 MaxHeight를 설정 모니터가 1개일때만
|
94 |
|
|
//MaxHeight = SystemParameters.WorkArea.Height;
|
95 |
|
|
//LocationChanged : 모니터가 2개 이상이고, 모니터의 해상도가 다를 때에 설정
|
96 |
e550eccb
|
이지연
|
//20240610 LJY 화면 넘어갈때 이슈로 주석
|
97 |
|
|
//this.LocationChanged += Window_LocationChanged;
|
98 |
ca16abb2
|
ljiyeon
|
//cursor change
|
99 |
902faaea
|
taeseongkim
|
this.Cursor = new Cursor(App.DefaultArrowCursorStream);
|
100 |
ca16abb2
|
ljiyeon
|
|
101 |
d33ef543
|
taeseongkim
|
var point = GetScreenCenter();
|
102 |
|
|
|
103 |
c362d2a5
|
taeseongkim
|
//this.Left = point.X;
|
104 |
|
|
//this.Top = point.Y;
|
105 |
787a4489
|
KangIngu
|
|
106 |
|
|
ViewerDataModel.Instance.SystemMain = this;
|
107 |
|
|
|
108 |
|
|
if (!App.ParameterMode)
|
109 |
|
|
{
|
110 |
|
|
//App.ViewInfo = new IKCOM.ViewInfo
|
111 |
|
|
//{
|
112 |
|
|
// DocumentItemID = "11111112",
|
113 |
|
|
// //DocumentItemID = "10001",
|
114 |
|
|
// bPartner = false,
|
115 |
|
|
// CreateFinalPDFPermission = true,
|
116 |
|
|
// NewCommentPermission = true,
|
117 |
|
|
// ProjectNO = "000000",
|
118 |
|
|
// UserID = "H2011357",
|
119 |
|
|
// //UserID = "H2009115",
|
120 |
|
|
// //Mode = 0 , 1 , 2
|
121 |
|
|
//};
|
122 |
|
|
//DialogMessage_Alert("데모버전은 단독 실행모드를 지원하지 않습니다", "안내");
|
123 |
|
|
|
124 |
7e2d29a0
|
ljiyeon
|
//#if DEBUG
|
125 |
|
|
// App.ViewInfo = new IKCOM.ViewInfo
|
126 |
|
|
// {
|
127 |
|
|
// DocumentItemID = "11111112",
|
128 |
|
|
// //DocumentItemID = "10001",
|
129 |
|
|
// bPartner = false,
|
130 |
|
|
// CreateFinalPDFPermission = true,
|
131 |
|
|
// NewCommentPermission = true,
|
132 |
|
|
// ProjectNO = "000000",
|
133 |
|
|
// UserID = "H2011357",
|
134 |
|
|
// //UserID = "H2009115",
|
135 |
|
|
// //Mode = 0 , 1 , 2
|
136 |
|
|
// };
|
137 |
|
|
// App.ParameterMode = true;
|
138 |
|
|
// this.dzMainMenu.ServiceOn();
|
139 |
|
|
// this.dzMainMenu.SetView(App.ViewInfo);
|
140 |
|
|
//#else
|
141 |
787a4489
|
KangIngu
|
|
142 |
|
|
DialogMessage_Alert("데모버전은 단독 실행모드를 지원하지 않습니다", "안내");
|
143 |
|
|
this.dzMainMenu.pageNavigator.Visibility = Visibility.Collapsed;
|
144 |
|
|
this.dzMainMenu.historyPane.Visibility = Visibility.Collapsed;
|
145 |
|
|
this.dzMainMenu.infoListPane.Visibility = Visibility.Collapsed;
|
146 |
|
|
this.dzMainMenu.searchPane.Visibility = Visibility.Collapsed;
|
147 |
|
|
this.dzMainMenu.talkPane.Visibility = Visibility.Collapsed;
|
148 |
7e2d29a0
|
ljiyeon
|
//#endif
|
149 |
787a4489
|
KangIngu
|
}
|
150 |
|
|
else
|
151 |
|
|
{
|
152 |
43e1d368
|
taeseongkim
|
this.dzMainMenu.talkPane.Visibility = Visibility.Collapsed;
|
153 |
787a4489
|
KangIngu
|
this.dzMainMenu.ServiceOn();
|
154 |
992a98b4
|
KangIngu
|
|
155 |
|
|
if (!App.ViewInfo.CreateFinalPDFPermission && !App.ViewInfo.NewCommentPermission)
|
156 |
|
|
{
|
157 |
|
|
this.dzTopMenu.radRibbonView.HelpButtonVisibility = Visibility.Collapsed;
|
158 |
|
|
var list = this.dzTopMenu.ChildrenOfType<RadRibbonTab>().ToList();
|
159 |
|
|
list.ForEach(item => item.Visibility = Visibility.Collapsed);
|
160 |
|
|
this.dzTopMenu.ribbontab_ReadOnly.Visibility = Visibility.Visible;
|
161 |
|
|
this.dzTopMenu.radRibbonView.SelectedItem = this.dzTopMenu.ribbontab_ReadOnly;
|
162 |
e0204db0
|
djkim
|
//this.dzMainMenu.SymbolPane.Visibility = Visibility.Collapsed;
|
163 |
|
|
//this.dzMainMenu.FavoritePane.Visibility = Visibility.Collapsed;
|
164 |
|
|
//this.dzMainMenu.drawingRotateCanvas.IsHitTestVisible = false;
|
165 |
992a98b4
|
KangIngu
|
}
|
166 |
a197bf6f
|
taeseongkim
|
else
|
167 |
|
|
{
|
168 |
|
|
string signData = await this.dzMainMenu.BaseTaskClient.GetSignDataAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID);
|
169 |
|
|
string signStrokes = await this.dzMainMenu.BaseTaskClient.GetSignStrokesAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID);
|
170 |
|
|
|
171 |
|
|
if (signData != null && signStrokes != null)
|
172 |
|
|
{
|
173 |
|
|
MarkupToPDF.MarkupContext.SetUserSignItem(App.ViewInfo.UserID, signData, signStrokes);
|
174 |
|
|
}
|
175 |
|
|
else
|
176 |
|
|
{
|
177 |
|
|
SignManager signManager = new SignManager();
|
178 |
|
|
|
179 |
|
|
RadWindow signManagerPop = new RadWindow
|
180 |
|
|
{
|
181 |
|
|
MinWidth = 1200,
|
182 |
|
|
MinHeight = 500,
|
183 |
|
|
//Header = "My Check List",
|
184 |
|
|
Header = "",
|
185 |
|
|
Content = signManager,
|
186 |
|
|
Owner = this,
|
187 |
cda7efcc
|
taeseongkim
|
IsTopmost = true,
|
188 |
a197bf6f
|
taeseongkim
|
//ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
|
189 |
cda7efcc
|
taeseongkim
|
ResizeMode = System.Windows.ResizeMode.NoResize,
|
190 |
a197bf6f
|
taeseongkim
|
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
|
191 |
|
|
};
|
192 |
|
|
StyleManager.SetTheme(signManagerPop, new Office2013Theme());
|
193 |
|
|
|
194 |
|
|
//CheckPop.ShowDialog();
|
195 |
|
|
signManagerPop.Show();
|
196 |
|
|
}
|
197 |
|
|
}
|
198 |
3d31db34
|
송근호
|
|
199 |
|
|
try
|
200 |
|
|
{
|
201 |
ff01c725
|
humkyung
|
///this.dzMainMenu.HubSet();
|
202 |
3d31db34
|
송근호
|
this.dzMainMenu.SetView(App.ViewInfo);
|
203 |
|
|
}
|
204 |
5a6493ad
|
humkyung
|
catch (Exception ex)
|
205 |
3d31db34
|
송근호
|
{
|
206 |
5a6493ad
|
humkyung
|
MessageBox.Show(string.Format("웹 서비스 접속시 에러가 발생했습니다.\n{0}", ex.StackTrace));
|
207 |
3724d2a2
|
송근호
|
|
208 |
|
|
System.Environment.Exit(0);
|
209 |
3d31db34
|
송근호
|
}
|
210 |
787a4489
|
KangIngu
|
}
|
211 |
|
|
}
|
212 |
f44e0cd0
|
이지연
|
/// <summary>
|
213 |
|
|
/// 멤버 변수로 현 사용자의 모든 모니터들의 상태를 가져온다.
|
214 |
|
|
/// Window의 LocationChanged Event를 통해 Window가 이동할 때마다 어떤 모니터에 있는지를 확인
|
215 |
|
|
/// Window가 어떤 모니터에 있는지의 기준은 각 Window의 중앙 부분
|
216 |
|
|
/// Sum 은 모니터들의 왼쪽 끝 부터 오른쪽 끝까지의 합
|
217 |
|
|
/// 현재 Window의 중앙은 Left 값 + Width의 반
|
218 |
|
|
/// um보다 작다면 현재 더하게 된 Screen 안에 있다는 뜻이므로 현재 더한 item의 WorkingArea의 Height를MaxHeight로 설정
|
219 |
|
|
/// </summary>
|
220 |
|
|
System.Windows.Forms.Screen[] screens = System.Windows.Forms.Screen.AllScreens;
|
221 |
|
|
private void Window_LocationChanged(object sender, EventArgs e)
|
222 |
0d2d2a08
|
이지연
|
{
|
223 |
|
|
int sum = 0;
|
224 |
|
|
foreach (var item in screens)
|
225 |
|
|
{
|
226 |
|
|
sum += item.WorkingArea.Width;
|
227 |
|
|
if (sum >= this.Left + this.Width / 2)
|
228 |
|
|
{
|
229 |
f44e0cd0
|
이지연
|
this.MaxHeight = item.WorkingArea.Height;
|
230 |
0d2d2a08
|
이지연
|
this.MaxWidth = item.WorkingArea.Width;
|
231 |
|
|
if (this.Left < 0)
|
232 |
|
|
{
|
233 |
|
|
this.Left = 0;
|
234 |
|
|
}
|
235 |
|
|
|
236 |
|
|
if (this.Top < 0)
|
237 |
|
|
{
|
238 |
|
|
this.Top = 0;
|
239 |
|
|
}
|
240 |
|
|
// if(this.Tag.Equals("Normal"))
|
241 |
|
|
//{
|
242 |
|
|
// this.WindowState = WindowState.Normal;
|
243 |
|
|
// this.CustomState = WindowState.Maximized;
|
244 |
|
|
//}
|
245 |
|
|
//if (this.CustomState == WindowState.Maximized)
|
246 |
|
|
//{
|
247 |
|
|
// this.WindowState = WindowState.Normal;
|
248 |
|
|
// this.CustomState = WindowState.Normal;
|
249 |
|
|
|
250 |
|
|
|
251 |
|
|
//}
|
252 |
|
|
//else
|
253 |
|
|
//{
|
254 |
|
|
// this.WindowState = WindowState.Normal;
|
255 |
|
|
// this.CustomState = WindowState.Maximized;
|
256 |
|
|
// this.NomalWindowArea = new Rect(this.Left, this.Top, this.Width, this.Height);
|
257 |
|
|
|
258 |
|
|
//}
|
259 |
|
|
break;
|
260 |
|
|
}
|
261 |
f44e0cd0
|
이지연
|
}
|
262 |
|
|
}
|
263 |
|
|
|
264 |
d33ef543
|
taeseongkim
|
private Point GetScreenCenter()
|
265 |
787a4489
|
KangIngu
|
{
|
266 |
d33ef543
|
taeseongkim
|
Point result = new Point();
|
267 |
3933072f
|
ljiyeon
|
|
268 |
d33ef543
|
taeseongkim
|
//first get all the screens
|
269 |
|
|
System.Drawing.Rectangle ret;
|
270 |
|
|
int ScreenWidth = 0;
|
271 |
787a4489
|
KangIngu
|
|
272 |
d33ef543
|
taeseongkim
|
var mousePosition = System.Windows.Forms.Cursor.Position;
|
273 |
71bfd53e
|
ljiyeon
|
|
274 |
d33ef543
|
taeseongkim
|
for (int i = 1; i <= System.Windows.Forms.Screen.AllScreens.Count(); i++)
|
275 |
71bfd53e
|
ljiyeon
|
{
|
276 |
d33ef543
|
taeseongkim
|
ret = System.Windows.Forms.Screen.AllScreens[i - 1].Bounds;
|
277 |
3933072f
|
ljiyeon
|
|
278 |
d33ef543
|
taeseongkim
|
if (ret.Contains(mousePosition))
|
279 |
|
|
{
|
280 |
|
|
result.X = ScreenWidth + (ret.Width / 2 - this.Width / 2);
|
281 |
|
|
result.Y = (ret.Height / 2 - this.Height / 2);
|
282 |
71bfd53e
|
ljiyeon
|
|
283 |
d33ef543
|
taeseongkim
|
break;
|
284 |
|
|
}
|
285 |
|
|
else
|
286 |
|
|
{
|
287 |
|
|
ScreenWidth += ret.Width;
|
288 |
71bfd53e
|
ljiyeon
|
}
|
289 |
|
|
|
290 |
d33ef543
|
taeseongkim
|
}
|
291 |
71bfd53e
|
ljiyeon
|
|
292 |
|
|
|
293 |
d33ef543
|
taeseongkim
|
return result;
|
294 |
71bfd53e
|
ljiyeon
|
}
|
295 |
|
|
|
296 |
d33ef543
|
taeseongkim
|
protected override void OnStateChanged(EventArgs e)
|
297 |
71bfd53e
|
ljiyeon
|
{
|
298 |
d33ef543
|
taeseongkim
|
base.OnStateChanged(e);
|
299 |
71bfd53e
|
ljiyeon
|
}
|
300 |
|
|
|
301 |
d33ef543
|
taeseongkim
|
protected override void OnClosing(CancelEventArgs e)
|
302 |
787a4489
|
KangIngu
|
{
|
303 |
d33ef543
|
taeseongkim
|
base.OnClosing(e);
|
304 |
cf1cc862
|
taeseongkim
|
|
305 |
bae83c92
|
taeseongkim
|
if(!ViewerDataModel.Instance.SaveCheck())
|
306 |
75f6ff19
|
taeseongkim
|
{
|
307 |
c362d2a5
|
taeseongkim
|
var IsConfirm = SaveConfirm();
|
308 |
|
|
|
309 |
|
|
if (IsConfirm == null)
|
310 |
75f6ff19
|
taeseongkim
|
{
|
311 |
|
|
e.Cancel = true;
|
312 |
|
|
}
|
313 |
c362d2a5
|
taeseongkim
|
else if(IsConfirm == true)
|
314 |
|
|
{
|
315 |
|
|
dzTopMenu.SaveEventCallback(null, null);
|
316 |
|
|
}
|
317 |
75f6ff19
|
taeseongkim
|
}
|
318 |
787a4489
|
KangIngu
|
|
319 |
bae83c92
|
taeseongkim
|
if (App.ViewInfo.CreateFinalPDFPermission)
|
320 |
|
|
{
|
321 |
|
|
if (!ViewerDataModel.Instance.FinalPDFCheck())
|
322 |
|
|
{
|
323 |
|
|
var result = FinalConfirm();
|
324 |
|
|
|
325 |
9380813b
|
swate0609
|
if(result == null)
|
326 |
|
|
e.Cancel = true;
|
327 |
|
|
|
328 |
bae83c92
|
taeseongkim
|
if (result == false)
|
329 |
|
|
{
|
330 |
|
|
e.Cancel = true;
|
331 |
|
|
}
|
332 |
|
|
else
|
333 |
|
|
{
|
334 |
6a19b48d
|
taeseongkim
|
//Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveLog(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID, "최종 Merged PDF 안됨.");
|
335 |
bae83c92
|
taeseongkim
|
}
|
336 |
|
|
}
|
337 |
|
|
}
|
338 |
|
|
|
339 |
d33ef543
|
taeseongkim
|
//Update Check 를 통해 update url 을 Get 하고 결과값이 있을 경우에는 SmartUpdater 실행.
|
340 |
9d5b4bc2
|
taeseongkim
|
//KeyValuePair<bool, string> updatecheck = UpdateCheck();
|
341 |
|
|
//if (updatecheck.Key && !string.IsNullOrEmpty(updatecheck.Value))
|
342 |
|
|
//{
|
343 |
|
|
// CallUpdateProcess(updatecheck.Value);
|
344 |
|
|
//}
|
345 |
787a4489
|
KangIngu
|
}
|
346 |
d33ef543
|
taeseongkim
|
|
347 |
bae83c92
|
taeseongkim
|
|
348 |
|
|
private bool? SaveConfirm()
|
349 |
264c9309
|
ljiyeon
|
{
|
350 |
bae83c92
|
taeseongkim
|
bool? result = null;
|
351 |
|
|
|
352 |
|
|
EventHandler<WindowClosedEventArgs> Closedhandler = null;
|
353 |
75f6ff19
|
taeseongkim
|
|
354 |
bae83c92
|
taeseongkim
|
Closedhandler = (snd, evt) =>
|
355 |
32af2c3b
|
djkim
|
{
|
356 |
bae83c92
|
taeseongkim
|
result = evt.DialogResult;
|
357 |
|
|
};
|
358 |
264c9309
|
ljiyeon
|
|
359 |
bae83c92
|
taeseongkim
|
DialogParameters parameters = new DialogParameters()
|
360 |
|
|
{
|
361 |
|
|
Content = new TextBlock()
|
362 |
32af2c3b
|
djkim
|
{
|
363 |
bae83c92
|
taeseongkim
|
MinWidth = 300,
|
364 |
|
|
FontSize = 11,
|
365 |
|
|
Text = "Found unsaved comments. Save now?",
|
366 |
|
|
TextWrapping = System.Windows.TextWrapping.Wrap
|
367 |
|
|
},
|
368 |
|
|
|
369 |
|
|
Header = "Confirm",
|
370 |
|
|
Theme = new VisualStudio2013Theme(),
|
371 |
|
|
ContentStyle = Application.Current.Resources["RadConfirmYNCStyle"] as Style,
|
372 |
|
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
373 |
|
|
|
374 |
|
|
Owner = Application.Current.MainWindow,
|
375 |
|
|
Opened = (s, openedEvent) =>
|
376 |
32af2c3b
|
djkim
|
{
|
377 |
bae83c92
|
taeseongkim
|
RadWindow confirm = s as RadWindow;
|
378 |
|
|
//Button Cancel = confirm.ChildrenOfType<Button>()[5];
|
379 |
|
|
//FocusManager.SetIsFocusScope(confirm, true);
|
380 |
|
|
//FocusManager.SetFocusedElement(confirm, Cancel);
|
381 |
|
|
},
|
382 |
|
|
|
383 |
|
|
Closed = Closedhandler
|
384 |
|
|
};
|
385 |
|
|
|
386 |
|
|
RadWindow.Confirm(parameters);
|
387 |
75f6ff19
|
taeseongkim
|
|
388 |
|
|
return result;
|
389 |
264c9309
|
ljiyeon
|
}
|
390 |
75f6ff19
|
taeseongkim
|
|
391 |
bae83c92
|
taeseongkim
|
private bool? FinalConfirm()
|
392 |
32af2c3b
|
djkim
|
{
|
393 |
bae83c92
|
taeseongkim
|
bool? result = false;
|
394 |
75f6ff19
|
taeseongkim
|
|
395 |
|
|
EventHandler<WindowClosedEventArgs> Closedhandler = null;
|
396 |
|
|
|
397 |
|
|
Closedhandler = (snd, evt) =>
|
398 |
32af2c3b
|
djkim
|
{
|
399 |
c362d2a5
|
taeseongkim
|
result = evt.DialogResult;
|
400 |
75f6ff19
|
taeseongkim
|
};
|
401 |
|
|
|
402 |
|
|
DialogParameters parameters = new DialogParameters()
|
403 |
|
|
{
|
404 |
|
|
Content = new TextBlock()
|
405 |
|
|
{
|
406 |
c362d2a5
|
taeseongkim
|
MinWidth = 300,
|
407 |
75f6ff19
|
taeseongkim
|
FontSize = 11,
|
408 |
bae83c92
|
taeseongkim
|
Text = "Merged PDF가 수행되지 않았습니다. 창을 닫으시겠습니까?",
|
409 |
75f6ff19
|
taeseongkim
|
TextWrapping = System.Windows.TextWrapping.Wrap
|
410 |
|
|
},
|
411 |
c362d2a5
|
taeseongkim
|
|
412 |
75f6ff19
|
taeseongkim
|
Header = "Confirm",
|
413 |
|
|
Theme = new VisualStudio2013Theme(),
|
414 |
90d1dee0
|
swate0609
|
ContentStyle = Application.Current.Resources["RadConfirmYCStyle"] as Style,
|
415 |
75f6ff19
|
taeseongkim
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
416 |
c362d2a5
|
taeseongkim
|
|
417 |
|
|
Owner = Application.Current.MainWindow,
|
418 |
|
|
Opened = (s, openedEvent) =>
|
419 |
|
|
{
|
420 |
|
|
RadWindow confirm = s as RadWindow;
|
421 |
|
|
},
|
422 |
|
|
|
423 |
75f6ff19
|
taeseongkim
|
Closed = Closedhandler
|
424 |
|
|
};
|
425 |
|
|
|
426 |
|
|
RadWindow.Confirm(parameters);
|
427 |
|
|
|
428 |
|
|
return result;
|
429 |
32af2c3b
|
djkim
|
}
|
430 |
d33ef543
|
taeseongkim
|
|
431 |
32af2c3b
|
djkim
|
private void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
|
432 |
|
|
{
|
433 |
|
|
Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate
|
434 |
|
|
{
|
435 |
|
|
double bytesIn = double.Parse(e.BytesReceived.ToString());
|
436 |
|
|
double totalBytes = double.Parse(e.TotalBytesToReceive.ToString());
|
437 |
|
|
double percentage = bytesIn / totalBytes * 100;
|
438 |
|
|
progressControl.splashText.Text = "Download : " + Math.Truncate(percentage).ToString() + " %";
|
439 |
d33ef543
|
taeseongkim
|
progressControl.progressBar.Value = int.Parse(Math.Truncate(percentage).ToString());
|
440 |
32af2c3b
|
djkim
|
}));
|
441 |
310eff8b
|
djkim
|
}
|
442 |
|
|
|
443 |
|
|
/// <summary>
|
444 |
|
|
/// KCOM_API 를 통해 업데이트 URL 을 가져옴.
|
445 |
|
|
/// false : 업데이트 불필요.
|
446 |
|
|
/// true : 업데이트 필요. url 을 같이 Return.
|
447 |
|
|
/// </summary>
|
448 |
|
|
/// <returns></returns>
|
449 |
|
|
private KeyValuePair<bool, string> UpdateCheck()
|
450 |
264c9309
|
ljiyeon
|
{
|
451 |
310eff8b
|
djkim
|
bool isUpdateCheck = false;
|
452 |
|
|
string updateurl = string.Empty;
|
453 |
264c9309
|
ljiyeon
|
try
|
454 |
|
|
{
|
455 |
ffddbe4e
|
djkim
|
bool is64bit = Environment.Is64BitProcess;
|
456 |
|
|
string clientversion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
457 |
|
|
updateurl = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetVersionData(is64bit, clientversion);
|
458 |
d33ef543
|
taeseongkim
|
|
459 |
ffddbe4e
|
djkim
|
if (Check_Uri.isUri(updateurl))
|
460 |
d33ef543
|
taeseongkim
|
{
|
461 |
32af2c3b
|
djkim
|
DialogParameters parameters = new DialogParameters()
|
462 |
264c9309
|
ljiyeon
|
{
|
463 |
32af2c3b
|
djkim
|
Owner = Application.Current.MainWindow,
|
464 |
97cde7e3
|
ljiyeon
|
Content = new TextBlock()
|
465 |
|
|
{
|
466 |
|
|
MinWidth = 400,
|
467 |
|
|
FontSize = 11,
|
468 |
eeb0a39c
|
taeseongkim
|
Text = "Update is available. \n Update now?",
|
469 |
97cde7e3
|
ljiyeon
|
TextWrapping = System.Windows.TextWrapping.Wrap
|
470 |
|
|
},
|
471 |
32af2c3b
|
djkim
|
Header = "Confirm",
|
472 |
|
|
Theme = new VisualStudio2013Theme(),
|
473 |
d33ef543
|
taeseongkim
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
474 |
32af2c3b
|
djkim
|
Closed = delegate (object windowSender, WindowClosedEventArgs e)
|
475 |
264c9309
|
ljiyeon
|
{
|
476 |
32af2c3b
|
djkim
|
if (e.DialogResult == true)
|
477 |
d33ef543
|
taeseongkim
|
{
|
478 |
|
|
isUpdateCheck = true;
|
479 |
97cde7e3
|
ljiyeon
|
}
|
480 |
|
|
else
|
481 |
32af2c3b
|
djkim
|
{
|
482 |
310eff8b
|
djkim
|
isUpdateCheck = false;
|
483 |
d33ef543
|
taeseongkim
|
}
|
484 |
|
|
}
|
485 |
32af2c3b
|
djkim
|
};
|
486 |
d33ef543
|
taeseongkim
|
RadWindow.Confirm(parameters);
|
487 |
|
|
|
488 |
264c9309
|
ljiyeon
|
}
|
489 |
|
|
else
|
490 |
|
|
{
|
491 |
310eff8b
|
djkim
|
isUpdateCheck = false;
|
492 |
264c9309
|
ljiyeon
|
}
|
493 |
|
|
}
|
494 |
5a6493ad
|
humkyung
|
catch (Exception ex)
|
495 |
264c9309
|
ljiyeon
|
{
|
496 |
5a6493ad
|
humkyung
|
throw ex;
|
497 |
310eff8b
|
djkim
|
}
|
498 |
|
|
return new KeyValuePair<bool, string>(isUpdateCheck, updateurl);
|
499 |
264c9309
|
ljiyeon
|
}
|
500 |
|
|
|
501 |
310eff8b
|
djkim
|
/// <summary>
|
502 |
|
|
/// SmartUpdate 를 호출.
|
503 |
|
|
/// </summary>
|
504 |
|
|
/// <param name="updateurl">Download 할 설치파일 경로</param>
|
505 |
|
|
private void CallUpdateProcess(string updateurl)
|
506 |
|
|
{
|
507 |
|
|
ProcessStartInfo proInfo = new ProcessStartInfo();
|
508 |
|
|
string smartupdaterpath = string.Empty;
|
509 |
|
|
smartupdaterpath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SmartUpdate.exe");
|
510 |
|
|
Process.Start(smartupdaterpath, updateurl);
|
511 |
|
|
}
|
512 |
d04e8ee9
|
taeseongkim
|
private async void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
|
513 |
32af2c3b
|
djkim
|
{
|
514 |
264c9309
|
ljiyeon
|
try
|
515 |
|
|
{
|
516 |
d33ef543
|
taeseongkim
|
await Dispatcher.InvokeAsync(() => progressControl.splashText.Text = "Download Completed");
|
517 |
d04e8ee9
|
taeseongkim
|
|
518 |
d33ef543
|
taeseongkim
|
if (progressControl != null)
|
519 |
32af2c3b
|
djkim
|
{
|
520 |
|
|
progressControl.Close();
|
521 |
|
|
progressControl = null;
|
522 |
|
|
}
|
523 |
d33ef543
|
taeseongkim
|
if (File.Exists(destfilepath))
|
524 |
32af2c3b
|
djkim
|
{
|
525 |
|
|
ProcessStartInfo update_msi = new ProcessStartInfo();
|
526 |
|
|
update_msi.FileName = destfilepath;
|
527 |
|
|
Process.Start(update_msi);
|
528 |
d33ef543
|
taeseongkim
|
}
|
529 |
32af2c3b
|
djkim
|
this.Close();
|
530 |
264c9309
|
ljiyeon
|
}
|
531 |
32af2c3b
|
djkim
|
catch (Exception)
|
532 |
69ef0800
|
KangIngu
|
{
|
533 |
32af2c3b
|
djkim
|
throw;
|
534 |
69ef0800
|
KangIngu
|
}
|
535 |
7e2d29a0
|
ljiyeon
|
|
536 |
|
|
}
|
537 |
787a4489
|
KangIngu
|
}
|
538 |
|
|
} |