markus / KCOM / Events / Implementation / TopMenuEvent.cs @ e5bd2147
이력 | 보기 | 이력해설 | 다운로드 (158 KB)
1 |
using KCOM.Common; |
---|---|
2 |
using KCOM.Common.Converter; |
3 |
using KCOM.Controls; |
4 |
using KCOM.Events; |
5 |
using KCOMDataModel.DataModel; |
6 |
using MarkupToPDF.Common; |
7 |
using System; |
8 |
using System.Collections.Generic; |
9 |
using System.Linq; |
10 |
using System.Text; |
11 |
using System.Windows; |
12 |
using System.Windows.Controls; |
13 |
using System.Windows.Input; |
14 |
using System.Windows.Media; |
15 |
using System.Windows.Media.Imaging; |
16 |
using Telerik.Windows.Controls; |
17 |
using IKCOM; |
18 |
using Microsoft.Win32; |
19 |
using System.IO; |
20 |
using System.Reflection; |
21 |
using System.Windows.Controls.Primitives; |
22 |
using MarkupToPDF.Controls.Parsing; |
23 |
using Telerik.Windows.Data; |
24 |
using System.ComponentModel; |
25 |
using System.Web; |
26 |
using Markus.Fonts; |
27 |
using System.Threading.Tasks; |
28 |
using System.Windows.Threading; |
29 |
using System.Text.RegularExpressions; |
30 |
|
31 |
namespace KCOM.Views |
32 |
{ |
33 |
public partial class TopMenu : UserControl |
34 |
{ |
35 |
public int rotateOffSet = 0; |
36 |
private double[] rotateValue = { 0, 90, 180, 270 }; |
37 |
public System.Windows.Threading.DispatcherTimer SaveTimer { get; set; } |
38 |
public bool isClosed = true; |
39 |
public RadWindow CheckPop; |
40 |
public RadWindow OptionPop; |
41 |
|
42 |
/// <summary> |
43 |
/// TaskBar에 메시지를 입력합니다 |
44 |
/// </summary> |
45 |
/// <param name="message"></param> |
46 |
/// <param name="type"></param> |
47 |
public void TaskMessage(string message, TaskMessageType type) |
48 |
{ |
49 |
/* |
50 |
if (taskBar != null) |
51 |
{ |
52 |
string color = ""; |
53 |
taskBar.Content = message; |
54 |
DicTaskMessage.TryGetValue(type, out color); |
55 |
taskBar.Foreground = new SolidColorBrush(StringToColorBrushConverter.Parse(color)); |
56 |
} |
57 |
*/ |
58 |
} |
59 |
|
60 |
/// <summary> |
61 |
/// Task Type명을 Key값으로 지정합니다 |
62 |
/// </summary> |
63 |
public enum TaskMessageType |
64 |
{ |
65 |
Normal, |
66 |
Caption, |
67 |
Error, |
68 |
} |
69 |
|
70 |
private void CheckShapeState() |
71 |
{ |
72 |
|
73 |
|
74 |
if (cbHatchShape.IsChecked == true) |
75 |
{ |
76 |
cbFillShape.IsChecked = false; |
77 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch; |
78 |
} |
79 |
else if(cbFillShape.IsChecked == true) |
80 |
{ |
81 |
cbHatchShape.IsChecked = false; |
82 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill; |
83 |
} |
84 |
else |
85 |
{ |
86 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None; |
87 |
} |
88 |
} |
89 |
|
90 |
/// <summary> |
91 |
/// comment의 속성 변경시 저장여부 확인 하도록 undocommand에 추가 |
92 |
/// </summary> |
93 |
/// <param name="adnoerFinal"></param> |
94 |
public void ChangeComment(Controls.AdornerFinal adnoerFinal) |
95 |
{ |
96 |
var adornerMembers = adnoerFinal.Members.Cast<Controls.AdornerMember>(); |
97 |
|
98 |
if (adornerMembers.Count() > 0) |
99 |
{ |
100 |
//UndoCommand.Instance.Push(adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList(), adnoerFinal.AngleValue); |
101 |
UndoCommand.Instance.Push(adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList()); |
102 |
} |
103 |
} |
104 |
|
105 |
//강인구 추가(Undo End) |
106 |
private void SetPaintEvent() |
107 |
{ |
108 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
109 |
|
110 |
if (AdonerList.Count > 0) |
111 |
{ |
112 |
Undo_data UndoData = new Undo_data() |
113 |
{ |
114 |
IsUndo = false, |
115 |
Event = Event_Type.Option, |
116 |
EventTime = DateTime.Now, |
117 |
paint = ViewerDataModel.Instance.paintSet, |
118 |
Markup_List = new List<Multi_Undo_data>() |
119 |
}; |
120 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
121 |
|
122 |
foreach (AdornerMember InnerItem in AdonerList) |
123 |
{ |
124 |
multi_Undo_Data.PointSet = new List<Point>(); |
125 |
|
126 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl) != null) |
127 |
{ |
128 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl).Paint = ViewerDataModel.Instance.paintSet; |
129 |
} |
130 |
|
131 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
132 |
UndoData.Markup_List.Add(multi_Undo_Data); |
133 |
multi_Undo_Data = new Multi_Undo_data(); |
134 |
} |
135 |
|
136 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
137 |
{ |
138 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
139 |
}); |
140 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
141 |
} |
142 |
} |
143 |
|
144 |
private void SetHighlightEvent() |
145 |
{ |
146 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
147 |
|
148 |
if (AdonerList.Count > 0) |
149 |
{ |
150 |
foreach (AdornerMember InnerItem in AdonerList) |
151 |
{ |
152 |
switch (InnerItem.DrawingData.GetType().Name) |
153 |
{ |
154 |
case ("TextControl"): |
155 |
{ |
156 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape; |
157 |
} |
158 |
break; |
159 |
case ("ArrowTextControl"): |
160 |
{ |
161 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
162 |
} |
163 |
break; |
164 |
} |
165 |
} |
166 |
|
167 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
168 |
} |
169 |
|
170 |
} |
171 |
|
172 |
private void FillShapeEvent(object sender, RoutedEventArgs e) |
173 |
{ |
174 |
#region 주석 |
175 |
//if ((sender as CheckBox).IsChecked.Value) |
176 |
//{ |
177 |
// cbHatchShape.IsChecked = false; |
178 |
// imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Fill.png", UriKind.Relative)); |
179 |
// imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Fill.png", UriKind.Relative)); |
180 |
// imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle_Fill.png", UriKind.Relative)); |
181 |
// imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon.png", UriKind.Relative)); |
182 |
// imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon.png", UriKind.Relative)); |
183 |
// imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_Fill.png", UriKind.Relative)); |
184 |
// TaskMessage("채우기 옵션이 적용되었습니다", TaskMessageType.Normal); |
185 |
//} |
186 |
//else |
187 |
//{ |
188 |
|
189 |
// imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative)); |
190 |
// imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative)); |
191 |
// imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative)); |
192 |
// imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative)); |
193 |
// imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative)); |
194 |
// imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative)); |
195 |
// TaskMessage("채우기 옵션이 해제되었습니다", TaskMessageType.Caption); |
196 |
//} |
197 |
#endregion |
198 |
ViewerDataModel.Instance.checkFillShape = (sender as CheckBox).IsChecked.Value; |
199 |
|
200 |
if (ViewerDataModel.Instance.checkFillShape) |
201 |
{ |
202 |
cbHatchShape.IsChecked = false; |
203 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill; |
204 |
} |
205 |
else |
206 |
{ |
207 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None; |
208 |
} |
209 |
SetPaintEvent(); |
210 |
} |
211 |
|
212 |
/// <summary> |
213 |
/// 도형 빗금 처리 |
214 |
/// </summary> |
215 |
/// <param name="sender"></param> |
216 |
/// <param name="e"></param> |
217 |
private void HatchShapeEvent(object sender, RoutedEventArgs e) |
218 |
{ |
219 |
#region 주석 |
220 |
//if ((sender as CheckBox).IsChecked.Value) |
221 |
//{ |
222 |
// cbFillShape.IsChecked = false; |
223 |
// imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Hatch.png", UriKind.Relative)); |
224 |
// imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Hatch.png", UriKind.Relative)); |
225 |
// imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/rectangle-icon_Hatch.png", UriKind.Relative)); |
226 |
// imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_Hatch.png", UriKind.Relative)); |
227 |
// imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_Hatch.png", UriKind.Relative)); |
228 |
// imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_hatch.png", UriKind.Relative)); |
229 |
// TaskMessage("무늬 옵션이 적용되었습니다", TaskMessageType.Normal); |
230 |
//} |
231 |
//else |
232 |
//{ |
233 |
// imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative)); |
234 |
// imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative)); |
235 |
// imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative)); |
236 |
// imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative)); |
237 |
// imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative)); |
238 |
// imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative)); |
239 |
// TaskMessage("무늬 옵션이 해제되었습니다", TaskMessageType.Caption); |
240 |
//} |
241 |
#endregion |
242 |
|
243 |
//강인구 추가 |
244 |
ViewerDataModel.Instance.checkHatchShape = (sender as CheckBox).IsChecked.Value; |
245 |
if (ViewerDataModel.Instance.checkHatchShape) |
246 |
{ |
247 |
cbFillShape.IsChecked = false; |
248 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch; |
249 |
} |
250 |
else |
251 |
{ |
252 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None; |
253 |
} |
254 |
SetPaintEvent(); |
255 |
} |
256 |
|
257 |
void SaveTimer_Tick(object sender, EventArgs e) |
258 |
{ |
259 |
//if (this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode != IKCOM.MouseHandlingMode.Drawing) |
260 |
if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl == null && this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count == 0) |
261 |
{ |
262 |
SaveEventCallback(null, null); |
263 |
} |
264 |
} |
265 |
|
266 |
private void SaveTime(bool IsRun) |
267 |
{ |
268 |
if(SaveTimer == null) |
269 |
{ |
270 |
SaveTimer = new System.Windows.Threading.DispatcherTimer(); |
271 |
SaveTimer.Interval = new TimeSpan(0, 0, 5); |
272 |
SaveTimer.Tick += new EventHandler(SaveTimer_Tick); |
273 |
} |
274 |
|
275 |
if (IsRun) |
276 |
{ |
277 |
SaveTimer.Start(); |
278 |
} |
279 |
else |
280 |
{ |
281 |
SaveTimer.Stop(); |
282 |
} |
283 |
} |
284 |
private void SaveTime(bool IsRun,int timeinterval) |
285 |
{ |
286 |
if (SaveTimer == null) |
287 |
{ |
288 |
SaveTimer = new System.Windows.Threading.DispatcherTimer(); |
289 |
SaveTimer.Interval = new TimeSpan(0, timeinterval, 0); |
290 |
SaveTimer.Tick += new EventHandler(SaveTimer_Tick); |
291 |
} |
292 |
else |
293 |
{ |
294 |
SaveTimer.Stop(); |
295 |
SaveTimer.Interval = new TimeSpan(0, timeinterval, 0); |
296 |
} |
297 |
|
298 |
if (IsRun) |
299 |
{ |
300 |
SaveTimer.Start(); |
301 |
} |
302 |
else |
303 |
{ |
304 |
SaveTimer.Stop(); |
305 |
} |
306 |
} |
307 |
/// <summary> |
308 |
/// enable busy indicator and then call _SaveEvent method. |
309 |
/// </summary> |
310 |
/// <param name="sender"></param> |
311 |
/// <param name="e"></param> |
312 |
public void SaveEventCallback(object sender, RoutedEventArgs e) |
313 |
{ |
314 |
var mianMenu = this.ParentOfType<MainWindow>().dzMainMenu; |
315 |
|
316 |
if (mianMenu.busyIndicator.IsBusy == true) |
317 |
{ |
318 |
return; |
319 |
} |
320 |
|
321 |
//var result = await Dispatcher.InvokeAsync<bool>(()=> |
322 |
//{ |
323 |
this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = true; |
324 |
|
325 |
_SaveEvent(sender, e); |
326 |
|
327 |
mianMenu.busyIndicator.IsBusy = false; |
328 |
|
329 |
//}); |
330 |
|
331 |
//System.Threading.Tasks.Task SaveTask = System.Threading.Tasks.Task.Factory.StartNew(() => |
332 |
//{ |
333 |
// Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action<object, RoutedEventArgs>(_SaveEvent), sender, e); |
334 |
//}).ContinueWith(task => |
335 |
//{ |
336 |
// Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate () { this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = false; })); |
337 |
//}); |
338 |
} |
339 |
|
340 |
/// <summary> |
341 |
/// save markup |
342 |
/// - convert ink control to polygon control if ink control exists |
343 |
/// - unselect and update my markup list |
344 |
/// <param name="sender"></param> |
345 |
/// <param name="e"></param> |
346 |
public bool _SaveEvent(object sender, RoutedEventArgs e) |
347 |
{ |
348 |
bool result = false; |
349 |
|
350 |
var mainMenu = this.ParentOfType<MainWindow>().dzMainMenu; |
351 |
try |
352 |
{ |
353 |
mainMenu.ConvertInkControlToPolygon(); |
354 |
|
355 |
//Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl_MouseDown(this, new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Right)); |
356 |
|
357 |
//SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu); |
358 |
// update mylist and gridview |
359 |
mainMenu.UpdateMyMarkupList(); |
360 |
|
361 |
if (mainMenu.gridViewMarkup.SelectedItems.Count == 0 && mainMenu.gridViewMarkup.Items.Count > 0) |
362 |
{ |
363 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert"); |
364 |
} |
365 |
else |
366 |
{ |
367 |
foreach (var item in mainMenu.gridViewMarkup.SelectedItems) |
368 |
{ |
369 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
370 |
{ |
371 |
/// 저장 서비스 호출 |
372 |
this.ExecuteSaveCommandAsync(mainMenu); |
373 |
|
374 |
ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now; |
375 |
if (!ViewerDataModel.Instance.IsConsolidate && (sender != null)) |
376 |
{ |
377 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("Save is complete.", "Info"); |
378 |
|
379 |
} |
380 |
|
381 |
result = true; |
382 |
} |
383 |
} |
384 |
} |
385 |
|
386 |
mainMenu.SetCommentPages(null); |
387 |
|
388 |
ViewerDataModel.Instance.UndoDataList.Clear(); |
389 |
} |
390 |
catch (Exception ex) |
391 |
{ |
392 |
System.Diagnostics.Debug.WriteLine("_SaveEvent Error : " + ex.ToString()); |
393 |
} |
394 |
finally |
395 |
{ |
396 |
/* |
397 |
/// delete markup information when 코멘트가 없을 경우 |
398 |
if (ViewerDataModel.Instance.MyMarkupList.Count == 0) |
399 |
{ |
400 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
401 |
{ |
402 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
403 |
{ |
404 |
//this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem)); |
405 |
} |
406 |
} |
407 |
} |
408 |
*/ |
409 |
} |
410 |
|
411 |
return result; |
412 |
} |
413 |
|
414 |
public async Task<bool> SaveEventAsync() |
415 |
{ |
416 |
bool result = false; |
417 |
|
418 |
var mainMenu = this.ParentOfType<MainWindow>().dzMainMenu; |
419 |
try |
420 |
{ |
421 |
mainMenu.ConvertInkControlToPolygon(); |
422 |
|
423 |
SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu); |
424 |
// update mylist and gridview |
425 |
mainMenu.UpdateMyMarkupList(); |
426 |
|
427 |
if (mainMenu.gridViewMarkup.SelectedItems.Count == 0 && mainMenu.gridViewMarkup.Items.Count > 0) |
428 |
{ |
429 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert"); |
430 |
} |
431 |
else |
432 |
{ |
433 |
foreach (var item in mainMenu.gridViewMarkup.SelectedItems) |
434 |
{ |
435 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
436 |
{ |
437 |
/// 저장 서비스 호출 |
438 |
result = await this.ExecuteSaveCommandAsync(mainMenu); |
439 |
|
440 |
ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now; |
441 |
} |
442 |
} |
443 |
} |
444 |
|
445 |
mainMenu.SetCommentPages(null); |
446 |
|
447 |
ViewerDataModel.Instance.UndoDataList.Clear(); |
448 |
result = true; |
449 |
} |
450 |
catch (Exception ex) |
451 |
{ |
452 |
System.Diagnostics.Debug.WriteLine("_SaveEvent Error : " + ex.ToString()); |
453 |
} |
454 |
finally |
455 |
{ |
456 |
/* |
457 |
/// delete markup information when 코멘트가 없을 경우 |
458 |
if (ViewerDataModel.Instance.MyMarkupList.Count == 0) |
459 |
{ |
460 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
461 |
{ |
462 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
463 |
{ |
464 |
//this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem)); |
465 |
} |
466 |
} |
467 |
} |
468 |
*/ |
469 |
} |
470 |
|
471 |
return result; |
472 |
} |
473 |
|
474 |
public bool SaveEvent() |
475 |
{ |
476 |
bool result = false; |
477 |
|
478 |
var mainMenu = this.ParentOfType<MainWindow>().dzMainMenu; |
479 |
try |
480 |
{ |
481 |
mainMenu.ConvertInkControlToPolygon(); |
482 |
|
483 |
SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu); |
484 |
// update mylist and gridview |
485 |
mainMenu.UpdateMyMarkupList(); |
486 |
|
487 |
if (mainMenu.gridViewMarkup.SelectedItems.Count == 0 && mainMenu.gridViewMarkup.Items.Count > 0) |
488 |
{ |
489 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert"); |
490 |
} |
491 |
else |
492 |
{ |
493 |
foreach (var item in mainMenu.gridViewMarkup.SelectedItems) |
494 |
{ |
495 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
496 |
{ |
497 |
/// 저장 서비스 호출 |
498 |
result = this.ExecuteSaveCommandAsync(mainMenu).GetAwaiter().GetResult(); |
499 |
|
500 |
ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now; |
501 |
} |
502 |
} |
503 |
} |
504 |
|
505 |
mainMenu.SetCommentPages(null); |
506 |
|
507 |
ViewerDataModel.Instance.UndoDataList.Clear(); |
508 |
result = true; |
509 |
} |
510 |
catch (Exception ex) |
511 |
{ |
512 |
System.Diagnostics.Debug.WriteLine("_SaveEvent Error : " + ex.ToString()); |
513 |
} |
514 |
finally |
515 |
{ |
516 |
/* |
517 |
/// delete markup information when 코멘트가 없을 경우 |
518 |
if (ViewerDataModel.Instance.MyMarkupList.Count == 0) |
519 |
{ |
520 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
521 |
{ |
522 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
523 |
{ |
524 |
//this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem)); |
525 |
} |
526 |
} |
527 |
} |
528 |
*/ |
529 |
} |
530 |
|
531 |
return result; |
532 |
} |
533 |
|
534 |
/// <summary> |
535 |
/// call save command |
536 |
/// </summary> |
537 |
/// <param name="menu"></param> |
538 |
public void ExecuteSaveCommand2(MainMenu menu) |
539 |
{ |
540 |
if (menu.pageNavigator.CurrentPage != null) |
541 |
{ |
542 |
SaveCommand.Instance.Project_No = App.ViewInfo.ProjectNO; |
543 |
SaveCommand.Instance.document_id = App.ViewInfo.DocumentItemID; |
544 |
SaveCommand.Instance.user_id = App.ViewInfo.UserID; |
545 |
SaveCommand.Instance.page_no = menu.pageNavigator.CurrentPage.PageNumber; |
546 |
|
547 |
try |
548 |
{ |
549 |
if (ViewerDataModel.Instance.UndoDataList.Count > 0) |
550 |
{ |
551 |
List<IKCOM.MarkupInfoItem> SelectedMarkupInfos = new List<IKCOM.MarkupInfoItem>(); |
552 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
553 |
{ |
554 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
555 |
{ |
556 |
SelectedMarkupInfos.Add(item as IKCOM.MarkupInfoItem); |
557 |
} |
558 |
} |
559 |
|
560 |
SaveCommand.Instance.Execute(SelectedMarkupInfos); |
561 |
} |
562 |
|
563 |
if (ViewerDataModel.Instance.RotationDocs.Count > 0) |
564 |
{ |
565 |
SaveCommand.Instance.PageAngleSave(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.RotationDocs); |
566 |
} |
567 |
} |
568 |
catch (Exception ex) |
569 |
{ |
570 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(string.Format("세이브 실패:{0}", ex.Message), "Alert"); |
571 |
throw ex; |
572 |
} |
573 |
} |
574 |
else |
575 |
{ |
576 |
System.Diagnostics.Debug.WriteLine("ExecuteSaveCommand Error - pageNavigator.CurrentPage null"); |
577 |
} |
578 |
} |
579 |
public async Task<bool> ExecuteSaveCommandAsync(MainMenu menu) |
580 |
{ |
581 |
bool result = false; |
582 |
|
583 |
if (menu.pageNavigator.CurrentPage != null) |
584 |
{ |
585 |
SaveCommand.Instance.Project_No = App.ViewInfo.ProjectNO; |
586 |
SaveCommand.Instance.document_id = App.ViewInfo.DocumentItemID; |
587 |
SaveCommand.Instance.user_id = App.ViewInfo.UserID; |
588 |
SaveCommand.Instance.page_no = menu.pageNavigator.CurrentPage.PageNumber; |
589 |
|
590 |
try |
591 |
{ |
592 |
if (ViewerDataModel.Instance.UndoDataList.Count > 0 || ViewerDataModel.Instance.IsMarkupUpdate) |
593 |
{ |
594 |
List<IKCOM.MarkupInfoItem> SelectedMarkupInfos = new List<IKCOM.MarkupInfoItem>(); |
595 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
596 |
{ |
597 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
598 |
{ |
599 |
SelectedMarkupInfos.Add(item as IKCOM.MarkupInfoItem); |
600 |
} |
601 |
} |
602 |
|
603 |
result = await SaveCommand.Instance.Execute(SelectedMarkupInfos); |
604 |
ViewerDataModel.Instance.IsMarkupUpdate = false; |
605 |
} |
606 |
else |
607 |
{ |
608 |
result = true; |
609 |
} |
610 |
|
611 |
if (ViewerDataModel.Instance.RotationDocs.Count > 0) |
612 |
{ |
613 |
SaveCommand.Instance.PageAngleSave(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.RotationDocs); |
614 |
} |
615 |
} |
616 |
catch (Exception ex) |
617 |
{ |
618 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(string.Format("세이브 실패:{0}", ex.Message), "Alert"); |
619 |
throw ex; |
620 |
} |
621 |
} |
622 |
else |
623 |
{ |
624 |
System.Diagnostics.Debug.WriteLine("ExecuteSaveCommand Error - pageNavigator.CurrentPage null"); |
625 |
} |
626 |
|
627 |
return result; |
628 |
} |
629 |
|
630 |
public bool ExecuteSaveCommand(MainMenu menu) |
631 |
{ |
632 |
bool result = false; |
633 |
|
634 |
if (menu.pageNavigator.CurrentPage != null) |
635 |
{ |
636 |
SaveCommand.Instance.Project_No = App.ViewInfo.ProjectNO; |
637 |
SaveCommand.Instance.document_id = App.ViewInfo.DocumentItemID; |
638 |
SaveCommand.Instance.user_id = App.ViewInfo.UserID; |
639 |
SaveCommand.Instance.page_no = menu.pageNavigator.CurrentPage.PageNumber; |
640 |
|
641 |
try |
642 |
{ |
643 |
if (ViewerDataModel.Instance.UndoDataList.Count > 0 || ViewerDataModel.Instance.IsMarkupUpdate) |
644 |
{ |
645 |
List<IKCOM.MarkupInfoItem> SelectedMarkupInfos = new List<IKCOM.MarkupInfoItem>(); |
646 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
647 |
{ |
648 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
649 |
{ |
650 |
SelectedMarkupInfos.Add(item as IKCOM.MarkupInfoItem); |
651 |
} |
652 |
} |
653 |
|
654 |
result = SaveCommand.Instance.Execute(SelectedMarkupInfos).GetAwaiter().GetResult(); |
655 |
ViewerDataModel.Instance.IsMarkupUpdate = false; |
656 |
} |
657 |
else |
658 |
{ |
659 |
result = true; |
660 |
} |
661 |
|
662 |
if (ViewerDataModel.Instance.RotationDocs.Count > 0) |
663 |
{ |
664 |
SaveCommand.Instance.PageAngleSave(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.RotationDocs); |
665 |
} |
666 |
} |
667 |
catch (Exception ex) |
668 |
{ |
669 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(string.Format("세이브 실패:{0}", ex.Message), "Alert"); |
670 |
throw ex; |
671 |
} |
672 |
} |
673 |
else |
674 |
{ |
675 |
System.Diagnostics.Debug.WriteLine("ExecuteSaveCommand Error - pageNavigator.CurrentPage null"); |
676 |
} |
677 |
|
678 |
return result; |
679 |
} |
680 |
|
681 |
//강인구 추가 |
682 |
public void Print_Start(string Type) |
683 |
{ |
684 |
if (ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
685 |
{ |
686 |
var menu = this.ParentOfType<MainWindow>().dzMainMenu; |
687 |
SelectionSet.Instance.UnSelect(menu); |
688 |
if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true) |
689 |
{ |
690 |
this.SaveEventCallback(null, null); |
691 |
} |
692 |
else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID) |
693 |
{ |
694 |
|
695 |
} |
696 |
else |
697 |
{ |
698 |
this.SaveEventCallback(null, null); |
699 |
} |
700 |
} |
701 |
|
702 |
bool isprint = false; |
703 |
if (Type == "Print") |
704 |
{ |
705 |
isprint = true; |
706 |
} |
707 |
|
708 |
RadWindow PrintWindow = new RadWindow(); |
709 |
PrintWindow.Width = 850; |
710 |
PrintWindow.Height = 600; |
711 |
PrintWindow.Header = Type; |
712 |
|
713 |
List<IKCOM.MarkupInfoItem> markupinfo = new List<IKCOM.MarkupInfoItem>(); |
714 |
|
715 |
markupinfo = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetPrintDocItemList(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID, ViewerDataModel.Instance._markupInfoList.ToList()); |
716 |
|
717 |
if (markupinfo?.Count() > 0) |
718 |
{ |
719 |
//Logger.sendResLog("GetPrintDocItemList", "TRUE", 1); |
720 |
} |
721 |
else |
722 |
{ |
723 |
//Logger.sendResLog("GetPrintDocItemList", "FALSE", 1); |
724 |
} |
725 |
|
726 |
/// Tile Source URL을 구한다 |
727 |
|
728 |
string sImageURL = ViewerDataModel.Instance.SystemMain.dzMainMenu.GetImageURL(App.ViewInfo.DocumentItemID, this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber); |
729 |
var url = new Uri(sImageURL); |
730 |
string sFolder = App.ViewInfo.DocumentItemID.All(char.IsDigit) ? (Convert.ToInt64(App.ViewInfo.DocumentItemID) / 100).ToString() : App.ViewInfo.DocumentItemID.Substring(0, 5); |
731 |
var Tile_Url = string.Format(@"{0}://{1}:{2}/TileSource/{3}_Tile/{4}/{5}/", |
732 |
url.Scheme, url.Host, url.Port, |
733 |
App.ViewInfo.ProjectNO, |
734 |
sFolder, |
735 |
App.ViewInfo.DocumentItemID |
736 |
); |
737 |
/// up to here |
738 |
|
739 |
var docitem = this.ParentOfType<MainWindow>().dzMainMenu._DocItem; |
740 |
|
741 |
PrintWindow.Content = new KCOM.Control.PrintControl( |
742 |
Tile_Url, |
743 |
App.ViewInfo.ProjectNO, |
744 |
this.ParentOfType<MainWindow>().dzMainMenu._DocInfo, |
745 |
markupinfo, |
746 |
this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber, |
747 |
docitem.GROUP_NO, |
748 |
docitem.DOCUMENT_NO, |
749 |
docitem.ORIGINAL_FILE, |
750 |
isprint); |
751 |
|
752 |
//프린트 팝업 옵션 |
753 |
//PrintWindow.BorderThickness = new Thickness(3); |
754 |
//PrintWindow.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 37, 160, 218)); |
755 |
PrintWindow.ResizeMode = System.Windows.ResizeMode.NoResize; |
756 |
PrintWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; |
757 |
PrintWindow.Background = new SolidColorBrush(Colors.Black); |
758 |
PrintWindow.Background.Opacity = 0.6; |
759 |
PrintWindow.Owner = Application.Current.MainWindow; |
760 |
Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.VisualStudio2013Theme()); |
761 |
PrintWindow.ShowDialog(); |
762 |
} |
763 |
|
764 |
//강인구 추가 |
765 |
private void PrintEvent(object sender, RoutedEventArgs e) |
766 |
{ |
767 |
RadRibbonButton button = sender as RadRibbonButton; |
768 |
Print_Start(button.Content.ToString()); |
769 |
} |
770 |
|
771 |
private List<AdornerMember> GetAdornerItem() |
772 |
{ |
773 |
List<AdornerMember> AdonerList = new List<AdornerMember>(); |
774 |
|
775 |
if (this.ParentOfType<MainWindow>() != null) |
776 |
{ |
777 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
778 |
{ |
779 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
780 |
{ |
781 |
if (item.GetType().Name == "AdornerFinal") |
782 |
{ |
783 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
784 |
{ |
785 |
AdonerList.Add(InnerItem); |
786 |
} |
787 |
} |
788 |
} |
789 |
} |
790 |
} |
791 |
|
792 |
return AdonerList; |
793 |
} |
794 |
/// <summary> |
795 |
/// 투명도 |
796 |
/// </summary> |
797 |
/// <param name="sender"></param> |
798 |
/// <param name="e"></param> |
799 |
//강인구 추가(Undo End) |
800 |
private void sdOpacity_ValueChanged(object sender, RoutedEventArgs e) |
801 |
{ |
802 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
803 |
if(AdonerList.Count > 0) |
804 |
{ |
805 |
Undo_data UndoData = new Undo_data() |
806 |
{ |
807 |
IsUndo = false, |
808 |
Event = Event_Type.Option, |
809 |
EventTime = DateTime.Now, |
810 |
Opacity = ViewerDataModel.Instance.ControlOpacity, |
811 |
Markup_List = new List<Multi_Undo_data>() |
812 |
}; |
813 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
814 |
|
815 |
foreach (AdornerMember InnerItem in AdonerList) |
816 |
{ |
817 |
InnerItem.DrawingData.Opacity = ViewerDataModel.Instance.ControlOpacity; |
818 |
|
819 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
820 |
UndoData.Markup_List.Add(multi_Undo_Data); |
821 |
multi_Undo_Data = new Multi_Undo_data(); |
822 |
} |
823 |
|
824 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
825 |
{ |
826 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
827 |
}); |
828 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
829 |
} |
830 |
} |
831 |
|
832 |
//강인구 추가(Undo End) |
833 |
private void cbLineSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
834 |
{ |
835 |
if (string.IsNullOrEmpty(cbLineSize.Value.ToString())) |
836 |
{ |
837 |
cbLineSize.Value = cbLineSize.Minimum; |
838 |
} |
839 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
840 |
if (AdonerList.Count > 0) |
841 |
{ |
842 |
Undo_data UndoData = new Undo_data() |
843 |
{ |
844 |
IsUndo = false, |
845 |
Event = Event_Type.Option, |
846 |
EventTime = DateTime.Now, |
847 |
LineSize = ViewerDataModel.Instance.LineSize, |
848 |
Markup_List = new List<Multi_Undo_data>() |
849 |
}; |
850 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
851 |
|
852 |
foreach (AdornerMember InnerItem in AdonerList) |
853 |
{ |
854 |
switch (InnerItem.DrawingData.GetType().Name) |
855 |
{ |
856 |
case ("LineControl"): |
857 |
{ |
858 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).LineSize = ViewerDataModel.Instance.LineSize; |
859 |
} |
860 |
break; |
861 |
case ("ArcControl"): |
862 |
{ |
863 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).LineSize = ViewerDataModel.Instance.LineSize; |
864 |
} |
865 |
break; |
866 |
case ("ArrowArcControl"): |
867 |
{ |
868 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).LineSize = ViewerDataModel.Instance.LineSize; |
869 |
} |
870 |
break; |
871 |
case ("ArrowControl_Multi"): |
872 |
{ |
873 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).LineSize = ViewerDataModel.Instance.LineSize; |
874 |
} |
875 |
break; |
876 |
case ("CloudControl"): |
877 |
{ |
878 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).LineSize = ViewerDataModel.Instance.LineSize; |
879 |
} |
880 |
break; |
881 |
case ("PolygonControl"): |
882 |
{ |
883 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).LineSize = ViewerDataModel.Instance.LineSize; |
884 |
} |
885 |
break; |
886 |
case ("RectangleControl"): |
887 |
{ |
888 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).LineSize = ViewerDataModel.Instance.LineSize; |
889 |
} |
890 |
break; |
891 |
case ("RectCloudControl"): |
892 |
{ |
893 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).LineSize = ViewerDataModel.Instance.LineSize; |
894 |
} |
895 |
break; |
896 |
case ("TriControl"): |
897 |
{ |
898 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).LineSize = ViewerDataModel.Instance.LineSize; |
899 |
} |
900 |
break; |
901 |
case ("CircleControl"): |
902 |
{ |
903 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).LineSize = ViewerDataModel.Instance.LineSize; |
904 |
} |
905 |
break; |
906 |
case ("ArrowTextControl"): |
907 |
{ |
908 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).LineSize = ViewerDataModel.Instance.LineSize; |
909 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).BorderSize = new Thickness(ViewerDataModel.Instance.LineSize); |
910 |
} |
911 |
break; |
912 |
case ("TextControl"): |
913 |
{ |
914 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).LineSize = new Thickness(ViewerDataModel.Instance.LineSize); |
915 |
} |
916 |
break; |
917 |
case ("InsideWhiteControl"): |
918 |
{ |
919 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
920 |
} |
921 |
break; |
922 |
case ("OverlapWhiteControl"): |
923 |
{ |
924 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
925 |
} |
926 |
break; |
927 |
case ("ClipWhiteControl"): |
928 |
{ |
929 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
930 |
} |
931 |
break; |
932 |
case ("CoordinateControl"): |
933 |
{ |
934 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).LineSize = 10; //ViewerDataModel.Instance.LineSize |
935 |
} |
936 |
break; |
937 |
} |
938 |
|
939 |
|
940 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
941 |
UndoData.Markup_List.Add(multi_Undo_Data); |
942 |
multi_Undo_Data = new Multi_Undo_data(); |
943 |
} |
944 |
|
945 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
946 |
{ |
947 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
948 |
}); |
949 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
950 |
|
951 |
|
952 |
} |
953 |
KCOM.Properties.Settings.Default.LineSize = (double)cbLineSize.Value; |
954 |
Properties.Settings.Default.Save(); |
955 |
} |
956 |
|
957 |
|
958 |
private void cbIntervalSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
959 |
{ |
960 |
if (string.IsNullOrEmpty(cbIntervalSize.Value.ToString())) |
961 |
{ |
962 |
cbIntervalSize.Value = cbIntervalSize.Minimum; |
963 |
} |
964 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
965 |
if (AdonerList.Count > 0) |
966 |
{ |
967 |
|
968 |
Undo_data UndoData = new Undo_data() |
969 |
{ |
970 |
IsUndo = false, |
971 |
Event = Event_Type.Option, |
972 |
EventTime = DateTime.Now, |
973 |
Interval = ViewerDataModel.Instance.Interval, |
974 |
Markup_List = new List<Multi_Undo_data>() |
975 |
}; |
976 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
977 |
|
978 |
foreach (AdornerMember InnerItem in AdonerList) |
979 |
{ |
980 |
switch (InnerItem.DrawingData.GetType().Name) |
981 |
{ |
982 |
case ("LineControl"): |
983 |
{ |
984 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).Interval = ViewerDataModel.Instance.Interval; |
985 |
|
986 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
987 |
UndoData.Markup_List.Add(multi_Undo_Data); |
988 |
multi_Undo_Data = new Multi_Undo_data(); |
989 |
} |
990 |
break; |
991 |
} |
992 |
} |
993 |
|
994 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
995 |
{ |
996 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
997 |
}); |
998 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
999 |
} |
1000 |
KCOM.Properties.Settings.Default.Interval = (double)cbIntervalSize.Value; |
1001 |
Properties.Settings.Default.Save(); |
1002 |
} |
1003 |
|
1004 |
private void cbArcLength_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
1005 |
{ |
1006 |
if (string.IsNullOrEmpty(cbArcLength.Value.ToString())) |
1007 |
{ |
1008 |
cbArcLength.Value = cbArcLength.Minimum; |
1009 |
} |
1010 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
1011 |
if (AdonerList.Count > 0) |
1012 |
{ |
1013 |
|
1014 |
//Undo_data UndoData = new Undo_data() |
1015 |
//{ |
1016 |
// IsUndo = false, |
1017 |
// Event = Event_Type.Option, |
1018 |
// EventTime = DateTime.Now, |
1019 |
// Interval = ViewerDataModel.Instance.Interval, |
1020 |
// Markup_List = new List<Multi_Undo_data>() |
1021 |
//}; |
1022 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
1023 |
|
1024 |
foreach (AdornerMember InnerItem in AdonerList) |
1025 |
{ |
1026 |
switch (InnerItem.DrawingData.GetType().Name) |
1027 |
{ |
1028 |
case ("RectCloudControl"): |
1029 |
{ |
1030 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).ArcLength = ViewerDataModel.Instance.ArcLength; |
1031 |
|
1032 |
//multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
1033 |
//UndoData.Markup_List.Add(multi_Undo_Data); |
1034 |
//multi_Undo_Data = new Multi_Undo_data(); |
1035 |
} |
1036 |
break; |
1037 |
case ("CloudControl"): |
1038 |
{ |
1039 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).ArcLength = ViewerDataModel.Instance.ArcLength; |
1040 |
|
1041 |
//multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
1042 |
//UndoData.Markup_List.Add(multi_Undo_Data); |
1043 |
//multi_Undo_Data = new Multi_Undo_data(); |
1044 |
} |
1045 |
break; |
1046 |
} |
1047 |
} |
1048 |
|
1049 |
//ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
1050 |
//{ |
1051 |
// ViewerDataModel.Instance.UndoDataList.Remove(i); |
1052 |
//}); |
1053 |
//ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
1054 |
} |
1055 |
|
1056 |
KCOM.Properties.Settings.Default.ArcLength = (double)cbArcLength.Value; |
1057 |
Properties.Settings.Default.Save(); |
1058 |
} |
1059 |
|
1060 |
//강인구 추가(Undo End) |
1061 |
private void cbDashStyle_SelectionChanged(object sender, SelectionChangedEventArgs e) |
1062 |
{ |
1063 |
//강인구 추가 |
1064 |
if (this.ParentOfType<MainWindow>() != null) |
1065 |
{ |
1066 |
ViewerDataModel.Instance.DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1067 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1068 |
{ |
1069 |
Undo_data UndoData = new Undo_data() |
1070 |
{ |
1071 |
IsUndo = false, |
1072 |
Event = Event_Type.Option, |
1073 |
EventTime = DateTime.Now, |
1074 |
DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData, |
1075 |
Markup_List = new List<Multi_Undo_data>() |
1076 |
}; |
1077 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
1078 |
|
1079 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1080 |
{ |
1081 |
if (item.GetType().Name == "AdornerFinal") |
1082 |
{ |
1083 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
1084 |
{ |
1085 |
switch (InnerItem.DrawingData.GetType().Name) |
1086 |
{ |
1087 |
case ("LineControl"): |
1088 |
{ |
1089 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1090 |
} |
1091 |
break; |
1092 |
case ("ArcControl"): |
1093 |
{ |
1094 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1095 |
} |
1096 |
break; |
1097 |
case ("ArrowArcControl"): |
1098 |
{ |
1099 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1100 |
} |
1101 |
break; |
1102 |
case ("ArrowControl_Multi"): |
1103 |
{ |
1104 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1105 |
} |
1106 |
break; |
1107 |
case ("CloudControl"): |
1108 |
{ |
1109 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1110 |
} |
1111 |
break; |
1112 |
case ("PolygonControl"): |
1113 |
{ |
1114 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1115 |
} |
1116 |
break; |
1117 |
case ("RectangleControl"): |
1118 |
{ |
1119 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1120 |
} |
1121 |
break; |
1122 |
case ("RectCloudControl"): |
1123 |
{ |
1124 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1125 |
} |
1126 |
break; |
1127 |
case ("TriControl"): |
1128 |
{ |
1129 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1130 |
} |
1131 |
break; |
1132 |
case ("CircleControl"): |
1133 |
{ |
1134 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1135 |
} |
1136 |
break; |
1137 |
case ("InsideWhiteControl"): |
1138 |
{ |
1139 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1140 |
} |
1141 |
break; |
1142 |
case ("OverlapWhiteControl"): |
1143 |
{ |
1144 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1145 |
} |
1146 |
break; |
1147 |
case ("ClipWhiteControl"): |
1148 |
{ |
1149 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1150 |
} |
1151 |
break; |
1152 |
case ("CoordinateControl"): |
1153 |
{ |
1154 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
1155 |
} |
1156 |
break; |
1157 |
} |
1158 |
|
1159 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
1160 |
UndoData.Markup_List.Add(multi_Undo_Data); |
1161 |
multi_Undo_Data = new Multi_Undo_data(); |
1162 |
} |
1163 |
|
1164 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
1165 |
{ |
1166 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
1167 |
}); |
1168 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
1169 |
} |
1170 |
} |
1171 |
} |
1172 |
} |
1173 |
} |
1174 |
|
1175 |
//강인구 추가 |
1176 |
private void comboFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e) |
1177 |
{ |
1178 |
//if (this.ParentOfType<MainWindow>() != null) |
1179 |
//{ |
1180 |
// if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1181 |
// { |
1182 |
// foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1183 |
// { |
1184 |
// if (item.GetType().Name == "AdornerFinal") |
1185 |
// { |
1186 |
// foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
1187 |
// { |
1188 |
// switch (InnerItem.DrawingData.GetType().Name) |
1189 |
// { |
1190 |
// case ("TextControl"): |
1191 |
// { |
1192 |
// (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Text); |
1193 |
// } |
1194 |
// break; |
1195 |
// case ("ArrowTextControl"): |
1196 |
// { |
1197 |
// (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Text); |
1198 |
// } |
1199 |
// break; |
1200 |
// } |
1201 |
// } |
1202 |
// } |
1203 |
// } |
1204 |
// } |
1205 |
//} |
1206 |
} |
1207 |
|
1208 |
//강인구 추가 |
1209 |
private void btnBold_Checked(object sender, RoutedEventArgs e) |
1210 |
{ |
1211 |
if (this.ParentOfType<MainWindow>() != null) |
1212 |
{ |
1213 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1214 |
{ |
1215 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1216 |
{ |
1217 |
if (item.GetType().Name == "AdornerFinal") |
1218 |
{ |
1219 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
1220 |
{ |
1221 |
switch (InnerItem.DrawingData.GetType().Name) |
1222 |
{ |
1223 |
case ("TextControl"): |
1224 |
{ |
1225 |
if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight == FontWeights.Bold) |
1226 |
{ |
1227 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Normal; |
1228 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1229 |
} |
1230 |
else |
1231 |
{ |
1232 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Bold; |
1233 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1234 |
} |
1235 |
|
1236 |
} |
1237 |
break; |
1238 |
case ("ArrowTextControl"): |
1239 |
{ |
1240 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight == FontWeights.Bold) |
1241 |
{ |
1242 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Normal; |
1243 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1244 |
} |
1245 |
else |
1246 |
{ |
1247 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Bold; |
1248 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1249 |
} |
1250 |
} |
1251 |
break; |
1252 |
} |
1253 |
} |
1254 |
} |
1255 |
} |
1256 |
} |
1257 |
} |
1258 |
} |
1259 |
|
1260 |
//강인구 추가 |
1261 |
private void btnItalic_Checked(object sender, RoutedEventArgs e) |
1262 |
{ |
1263 |
if (this.ParentOfType<MainWindow>() != null) |
1264 |
{ |
1265 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1266 |
{ |
1267 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1268 |
{ |
1269 |
if (item.GetType().Name == "AdornerFinal") |
1270 |
{ |
1271 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
1272 |
{ |
1273 |
switch (InnerItem.DrawingData.GetType().Name) |
1274 |
{ |
1275 |
case ("TextControl"): |
1276 |
{ |
1277 |
if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle == FontStyles.Italic) |
1278 |
{ |
1279 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = System.Windows.FontStyles.Normal; |
1280 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1281 |
} |
1282 |
else |
1283 |
{ |
1284 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = FontStyles.Italic; |
1285 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1286 |
} |
1287 |
|
1288 |
} |
1289 |
break; |
1290 |
case ("ArrowTextControl"): |
1291 |
{ |
1292 |
if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle == FontStyles.Italic) |
1293 |
{ |
1294 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Normal; |
1295 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1296 |
} |
1297 |
else |
1298 |
{ |
1299 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Italic; |
1300 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1301 |
} |
1302 |
} |
1303 |
break; |
1304 |
} |
1305 |
} |
1306 |
} |
1307 |
} |
1308 |
} |
1309 |
} |
1310 |
} |
1311 |
|
1312 |
//강인구 추가 |
1313 |
private void btnUnderLine_Checked(object sender, RoutedEventArgs e) |
1314 |
{ |
1315 |
if (this.ParentOfType<MainWindow>() != null) |
1316 |
{ |
1317 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1318 |
{ |
1319 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1320 |
{ |
1321 |
if (item.GetType().Name == "AdornerFinal") |
1322 |
{ |
1323 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
1324 |
{ |
1325 |
switch (InnerItem.DrawingData.GetType().Name) |
1326 |
{ |
1327 |
case ("TextControl"): |
1328 |
{ |
1329 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine == TextDecorations.Underline) |
1330 |
{ |
1331 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = null; |
1332 |
} |
1333 |
else |
1334 |
{ |
1335 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline; |
1336 |
} |
1337 |
} |
1338 |
break; |
1339 |
case ("ArrowTextControl"): |
1340 |
{ |
1341 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline) |
1342 |
{ |
1343 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null; |
1344 |
} |
1345 |
else |
1346 |
{ |
1347 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline; |
1348 |
} |
1349 |
} |
1350 |
break; |
1351 |
} |
1352 |
|
1353 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1354 |
} |
1355 |
} |
1356 |
} |
1357 |
} |
1358 |
} |
1359 |
} |
1360 |
|
1361 |
private void comboFontSize_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) |
1362 |
{ |
1363 |
if (e.Key == Key.Space || e.Key == Key.ImeProcessed) |
1364 |
{ |
1365 |
e.Handled = true; |
1366 |
} |
1367 |
} |
1368 |
|
1369 |
private void comboFontSize_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e) |
1370 |
{ |
1371 |
var regex = new Regex(@"[^a-zA-Z0-9\s]"); |
1372 |
if (regex.IsMatch(e.Text)) |
1373 |
{ |
1374 |
e.Handled = true; |
1375 |
} |
1376 |
} |
1377 |
|
1378 |
private void comboFontSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
1379 |
{ |
1380 |
if (string.IsNullOrEmpty(comboFontSize.Value.ToString())) |
1381 |
{ |
1382 |
comboFontSize.Value = comboFontSize.Minimum; |
1383 |
} |
1384 |
if (this.ParentOfType<MainWindow>() != null) |
1385 |
{ |
1386 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1387 |
{ |
1388 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1389 |
{ |
1390 |
if (item.GetType().Name == "AdornerFinal") |
1391 |
{ |
1392 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
1393 |
{ |
1394 |
switch (InnerItem.DrawingData.GetType().Name) |
1395 |
{ |
1396 |
case ("TextControl"): |
1397 |
{ |
1398 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Value.ToString()); |
1399 |
} |
1400 |
break; |
1401 |
case ("ArrowTextControl"): |
1402 |
{ |
1403 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Value.ToString()); |
1404 |
} |
1405 |
break; |
1406 |
} |
1407 |
} |
1408 |
|
1409 |
ChangeComment(item as Controls.AdornerFinal); |
1410 |
} |
1411 |
} |
1412 |
} |
1413 |
} |
1414 |
|
1415 |
KCOM.Properties.Settings.Default.TextSize = (double)comboFontSize.Value; |
1416 |
Properties.Settings.Default.Save(); |
1417 |
} |
1418 |
|
1419 |
//강인구 추가 |
1420 |
private void comboFontFamily_SelectionChanged(object sender, SelectionChangedEventArgs e) |
1421 |
{ |
1422 |
|
1423 |
if (comboFontFamily.SelectedItem != null && !IsSuspendChange) |
1424 |
{ |
1425 |
var main = this.ParentOfType<MainWindow>()?.dzMainMenu; |
1426 |
var font = comboFontFamily.SelectedItem as Markus.Fonts.MarkusFont; |
1427 |
var lstTextCtrl = SelectTextControl(); |
1428 |
|
1429 |
foreach (var item in lstTextCtrl) |
1430 |
{ |
1431 |
if (item is MarkupToPDF.Controls.Text.ArrowTextControl ctrl1) |
1432 |
{ |
1433 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1434 |
ctrl1.SetFontFamily(font.FontFamily); |
1435 |
} |
1436 |
else if (item is MarkupToPDF.Controls.Text.TextControl ctrl2) |
1437 |
{ |
1438 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1439 |
ctrl2.SetFontFamily(font.FontFamily); |
1440 |
} |
1441 |
} |
1442 |
|
1443 |
KCOM.Properties.Settings.Default.FontFamily = font.FontFamily.FontName(); |
1444 |
Properties.Settings.Default.Save(); |
1445 |
} |
1446 |
} |
1447 |
|
1448 |
private List<UIElement> SelectTextControl() |
1449 |
{ |
1450 |
List<UIElement> lstTextCtrl = new List<UIElement>(); |
1451 |
|
1452 |
var main = this.ParentOfType<MainWindow>()?.dzMainMenu; |
1453 |
var font = comboFontFamily.SelectedItem as Markus.Fonts.MarkusFont; |
1454 |
|
1455 |
|
1456 |
if (main.SelectLayer.FindChildByType<AdornerFinal>() != null) |
1457 |
{ |
1458 |
lstTextCtrl.AddRange(main.SelectLayer.FindChildByType<AdornerFinal>().Members.Where(x => x.DrawingData is MarkupToPDF.Controls.Common.ITextControl).Select(x => x.DrawingData)); |
1459 |
} |
1460 |
|
1461 |
lstTextCtrl.AddRange(main.zoomAndPanCanvas.FindAllChildren(x => x is MarkupToPDF.Controls.Common.ITextControl c && (c.IsSelected || c.IsEditingMode == true)).Select(x => (UIElement)x)); |
1462 |
|
1463 |
return lstTextCtrl; |
1464 |
} |
1465 |
|
1466 |
|
1467 |
/// <summary> |
1468 |
/// 텍스트 컨트롤 하일라이트 처리 |
1469 |
/// </summary> |
1470 |
/// <param name="sender"></param> |
1471 |
/// <param name="e"></param> |
1472 |
private void HighlightEvent(object sender, RoutedEventArgs e) |
1473 |
{ |
1474 |
|
1475 |
ViewerDataModel.Instance.checkHighShape = (sender as CheckBox).IsChecked.Value; |
1476 |
SetHighlightEvent(); |
1477 |
//if ((sender as CheckBox).IsChecked.Value) |
1478 |
//{ |
1479 |
// TaskMessage("HighLight가 설정되었습니다", TaskMessageType.Normal); |
1480 |
//} |
1481 |
//else |
1482 |
//{ |
1483 |
// TaskMessage("HighLight가 해제되었습니다", TaskMessageType.Caption); |
1484 |
//} |
1485 |
//if (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl != null) |
1486 |
//{ |
1487 |
// MarkupToPDF.Controls.Text.TextControl instance = (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl); |
1488 |
// instance.IsHighLight = ViewerDataModel.Instance.checkHighShape; |
1489 |
// instance.SetText(); |
1490 |
//} |
1491 |
} |
1492 |
|
1493 |
//추가페이지 이동 엔터 |
1494 |
private void tlcurrentPage_KeyDown(object sender, KeyEventArgs e) |
1495 |
{ |
1496 |
//강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch |
1497 |
if (e.Key == Key.Enter) |
1498 |
{ |
1499 |
try |
1500 |
{ |
1501 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1502 |
var max = instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Max(f => f.PageNumber); |
1503 |
if (string.IsNullOrEmpty(tlcurrentPage.Text)) |
1504 |
{ |
1505 |
RadWindow.Alert(new DialogParameters |
1506 |
{ |
1507 |
Owner = Application.Current.MainWindow, |
1508 |
Theme = new VisualStudio2013Theme(), |
1509 |
Header = "Info", |
1510 |
Content = "Enter the correct page number.", |
1511 |
}); |
1512 |
} |
1513 |
else |
1514 |
{ |
1515 |
if (Convert.ToInt32(tlcurrentPage.Text) > max || Convert.ToInt32(tlcurrentPage.Text) == 0) |
1516 |
{ |
1517 |
RadWindow.Alert(new DialogParameters |
1518 |
{ |
1519 |
Owner = Application.Current.MainWindow, |
1520 |
Theme = new VisualStudio2013Theme(), |
1521 |
Header = "Info", |
1522 |
Content = "Enter the correct page number.", |
1523 |
}); |
1524 |
} |
1525 |
else |
1526 |
{ |
1527 |
instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text)); |
1528 |
} |
1529 |
} |
1530 |
|
1531 |
} |
1532 |
catch (Exception) |
1533 |
{ |
1534 |
RadWindow.Alert(new DialogParameters |
1535 |
{ |
1536 |
Owner = Application.Current.MainWindow, |
1537 |
Theme = new VisualStudio2013Theme(), |
1538 |
Header = "Info", |
1539 |
Content = "Enter the correct page number.", |
1540 |
}); |
1541 |
} |
1542 |
|
1543 |
} |
1544 |
} |
1545 |
private string previousText; |
1546 |
private void TlcurrentPage_PreviewTextInput(object sender, TextCompositionEventArgs e) |
1547 |
{ |
1548 |
System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("[^0-9]+"); |
1549 |
e.Handled = regex.IsMatch(e.Text); |
1550 |
} |
1551 |
private void TlcurrentPage_TextChanged(object sender, TextChangedEventArgs e) |
1552 |
{ |
1553 |
double num = 0; |
1554 |
bool success = double.TryParse(((TextBox)sender).Text, out num); |
1555 |
if (success & num >= 0) |
1556 |
previousText = ((TextBox)sender).Text; |
1557 |
else |
1558 |
{ |
1559 |
if (string.IsNullOrEmpty(((TextBox)sender).Text)) |
1560 |
{ |
1561 |
((TextBox)sender).Text = ""; |
1562 |
} |
1563 |
else |
1564 |
{ |
1565 |
|
1566 |
((TextBox)sender).Text = previousText; |
1567 |
} |
1568 |
} |
1569 |
} |
1570 |
|
1571 |
/// <summary> |
1572 |
/// 입력한 페이지로 이동한다 |
1573 |
/// </summary> |
1574 |
/// <param name="sender"></param> |
1575 |
/// <param name="e"></param> |
1576 |
private void tlcurrentPage_readonly_KeyDown(object sender, KeyEventArgs e) |
1577 |
{ |
1578 |
if (e.Key == Key.Enter) |
1579 |
{ |
1580 |
try |
1581 |
{ |
1582 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1583 |
instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage_readonly.Text)); |
1584 |
} |
1585 |
catch (Exception) |
1586 |
{ |
1587 |
RadWindow.Alert(new DialogParameters |
1588 |
{ |
1589 |
Owner = Application.Current.MainWindow, |
1590 |
Theme = new VisualStudio2013Theme(), |
1591 |
Header = "Info", |
1592 |
Content = "Enter the correct page number.", |
1593 |
}); |
1594 |
} |
1595 |
} |
1596 |
} |
1597 |
|
1598 |
private void PanoramaEvent(object sender, RoutedEventArgs e) |
1599 |
{ |
1600 |
PanoramaShow(); |
1601 |
} |
1602 |
|
1603 |
public void PanoramaShow() |
1604 |
{ |
1605 |
Panorama check = new Panorama(); |
1606 |
double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; |
1607 |
double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; |
1608 |
//double windowWidth = this.Width; |
1609 |
//double windowHeight = this.Height; |
1610 |
|
1611 |
var PanoramaPop = new RadWindow |
1612 |
{ |
1613 |
//MinWidth = 600, |
1614 |
//MinHeight = 400, |
1615 |
//Header = "My Check List", |
1616 |
Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION, |
1617 |
Content = check, |
1618 |
Owner = this, |
1619 |
ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, |
1620 |
//ResizeMode = System.Windows.ResizeMode.NoResize, |
1621 |
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
1622 |
IsTopmost = false, |
1623 |
//Left = (screenWidth / 2) - (windowWidth / 2), |
1624 |
//Top = (screenHeight / 2) - (windowHeight / 2), |
1625 |
//Left = (screenWidth / 2), |
1626 |
//Top = (screenHeight / 2), |
1627 |
Width = screenWidth * 0.4, |
1628 |
Height = screenHeight * 0.4, |
1629 |
}; |
1630 |
StyleManager.SetTheme(PanoramaPop, new VisualStudio2013Theme()); |
1631 |
//CheckPop.ShowDialog(); |
1632 |
PanoramaPop.Owner = Application.Current.MainWindow; |
1633 |
PanoramaPop.Show(); |
1634 |
} |
1635 |
|
1636 |
private void CheckEvent(object sender, RoutedEventArgs e) |
1637 |
{ |
1638 |
//창이 떠있을 경우 재 실행 방지 |
1639 |
if (isClosed) |
1640 |
{ |
1641 |
//토글 및 마우스 상태 초기화 |
1642 |
var toggleList = this.Parent.ChildrenOfType<RadToggleButton>(); |
1643 |
foreach(var togle in toggleList) |
1644 |
{ |
1645 |
togle.IsChecked = false; |
1646 |
} |
1647 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
1648 |
|
1649 |
isClosed = false; |
1650 |
|
1651 |
|
1652 |
CheckList check = new CheckList(this.ParentOfType<MainWindow>()); |
1653 |
|
1654 |
CheckPop = new RadWindow |
1655 |
{ |
1656 |
MinWidth = 1200, |
1657 |
MinHeight = 500, |
1658 |
//Header = "My Check List", |
1659 |
Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION, |
1660 |
Content = check, |
1661 |
//Owner = this, |
1662 |
//ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, |
1663 |
ResizeMode = System.Windows.ResizeMode.NoResize, |
1664 |
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
1665 |
IsTopmost = true, |
1666 |
}; |
1667 |
StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
1668 |
CheckPop.Closed += CheckPop_Closed; |
1669 |
|
1670 |
//CheckPop.ShowDialog(); |
1671 |
CheckPop.Show(); |
1672 |
} |
1673 |
} |
1674 |
|
1675 |
private void SignManagerEvent(object sender,RoutedEventArgs e) |
1676 |
{ |
1677 |
SignManager signManager = new SignManager(); |
1678 |
|
1679 |
RadWindow signManagerPop = new RadWindow |
1680 |
{ |
1681 |
MinWidth = 1200, |
1682 |
MinHeight = 500, |
1683 |
//Header = "My Check List", |
1684 |
Header = "", |
1685 |
Content = signManager, |
1686 |
Owner = this, |
1687 |
//ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, |
1688 |
ResizeMode = System.Windows.ResizeMode.CanResize, |
1689 |
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
1690 |
}; |
1691 |
StyleManager.SetTheme(signManagerPop, new Office2013Theme()); |
1692 |
|
1693 |
//CheckPop.ShowDialog(); |
1694 |
signManagerPop.ShowDialog(); |
1695 |
} |
1696 |
|
1697 |
private void OptionPop_Closed(object sender, WindowClosedEventArgs e) |
1698 |
{ |
1699 |
isClosed = true; |
1700 |
//this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true; |
1701 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
1702 |
ViewerDataModel.Instance.Capture_Opacity = 0; |
1703 |
} |
1704 |
|
1705 |
private void CheckPop_Closed(object sender, WindowClosedEventArgs e) |
1706 |
{ |
1707 |
isClosed = true; |
1708 |
//this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true; |
1709 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
1710 |
ViewerDataModel.Instance.Capture_Opacity = 0; |
1711 |
} |
1712 |
|
1713 |
/// <summary> |
1714 |
/// 사용자가 선택한 페이지로 이동(썸네일 동기화 시킴) |
1715 |
/// </summary> |
1716 |
/// <param name="sender"></param> |
1717 |
/// <param name="e"></param> |
1718 |
private void PageGoEvent(object sender, RoutedEventArgs e) |
1719 |
{ |
1720 |
RadButton button = sender as RadButton; |
1721 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1722 |
|
1723 |
//강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch |
1724 |
try |
1725 |
{ |
1726 |
switch (button.CommandParameter.ToString()) |
1727 |
{ |
1728 |
case "Down": |
1729 |
{ |
1730 |
instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) + 1); |
1731 |
} |
1732 |
break; |
1733 |
case "Up": |
1734 |
{ |
1735 |
instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) - 1); |
1736 |
} |
1737 |
break; |
1738 |
} |
1739 |
} |
1740 |
catch (Exception) |
1741 |
{ |
1742 |
RadWindow.Alert(new DialogParameters |
1743 |
{ |
1744 |
Owner = Application.Current.MainWindow, |
1745 |
Theme = new VisualStudio2013Theme(), |
1746 |
Header = "Info", |
1747 |
Content = "Enter the correct page number.", |
1748 |
}); |
1749 |
} |
1750 |
} |
1751 |
|
1752 |
private void viewEvent(object sender, RoutedEventArgs e) |
1753 |
{ |
1754 |
RadRibbonToggleButton viewButton = sender as RadRibbonToggleButton; |
1755 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1756 |
|
1757 |
Point point = new Point(instanceMain.dzMainMenu.zoomAndPanCanvas.Width / 2, instanceMain.dzMainMenu.zoomAndPanCanvas.Height / 2); |
1758 |
|
1759 |
//if ((sender as RadRibbonToggleButton) != null) |
1760 |
//{ |
1761 |
// Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString(); |
1762 |
// instanceToggle = (sender as RadRibbonToggleButton); |
1763 |
//} |
1764 |
|
1765 |
//instanceToggle.IsChecked = false; |
1766 |
|
1767 |
switch (viewButton.CommandParameter.ToString()) |
1768 |
{ |
1769 |
case "zoomout": |
1770 |
{ |
1771 |
//장원 |
1772 |
//instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(new Rect(0, 0, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualWidth, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualHeight)); |
1773 |
instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale -= 0.1, point); |
1774 |
viewButton.IsChecked = false; |
1775 |
//Common.ViewerDataModel.Instance.zom |
1776 |
} |
1777 |
break; |
1778 |
case "zoomin": |
1779 |
{ |
1780 |
instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale += 0.1, point); |
1781 |
viewButton.IsChecked = false; |
1782 |
} |
1783 |
break; |
1784 |
case "fullscreen": |
1785 |
{ |
1786 |
instanceMain.WindowState = WindowState.Maximized; |
1787 |
//Sizemode 대기(강인구) |
1788 |
//instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit; |
1789 |
instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit(); |
1790 |
viewButton.IsChecked = false; |
1791 |
} |
1792 |
break; |
1793 |
case "fitWidth": |
1794 |
{ |
1795 |
instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit(); |
1796 |
viewButton.IsChecked = false; |
1797 |
} |
1798 |
break; |
1799 |
case "fitHeight": |
1800 |
{ |
1801 |
instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit(); |
1802 |
viewButton.IsChecked = false; |
1803 |
} |
1804 |
break; |
1805 |
case "boundzoom": |
1806 |
{ |
1807 |
|
1808 |
} |
1809 |
break; |
1810 |
case "Rotate_M": |
1811 |
{ |
1812 |
drawingPannelRotate(false); |
1813 |
viewButton.IsChecked = false; |
1814 |
} |
1815 |
break; |
1816 |
case "Rotate_P": |
1817 |
{ |
1818 |
drawingPannelRotate(true); |
1819 |
viewButton.IsChecked = false; |
1820 |
} |
1821 |
break; |
1822 |
case "Rotate_half": |
1823 |
{ |
1824 |
drawingPannelRotate(true); |
1825 |
drawingPannelRotate(true); |
1826 |
viewButton.IsChecked = false; |
1827 |
} |
1828 |
break; |
1829 |
} |
1830 |
} |
1831 |
|
1832 |
private void Control_Event(object sender, RoutedEventArgs e) |
1833 |
{ |
1834 |
|
1835 |
} |
1836 |
|
1837 |
#region 대기 |
1838 |
|
1839 |
public void drawingPannelRotate(bool Flag) |
1840 |
{ |
1841 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1842 |
|
1843 |
//if (rotateOffSet > 3) |
1844 |
// rotateOffSet = 0; |
1845 |
|
1846 |
//if (rotateOffSet < 0) |
1847 |
// rotateOffSet = 3; |
1848 |
|
1849 |
if(Flag) |
1850 |
{ |
1851 |
if (instanceMain.dzMainMenu.rotate.Angle == 270) |
1852 |
{ |
1853 |
instanceMain.dzMainMenu.rotate.Angle = 0; |
1854 |
} |
1855 |
else |
1856 |
{ |
1857 |
instanceMain.dzMainMenu.rotate.Angle += 90; |
1858 |
} |
1859 |
} |
1860 |
else |
1861 |
{ |
1862 |
if(instanceMain.dzMainMenu.rotate.Angle == 0) |
1863 |
{ |
1864 |
instanceMain.dzMainMenu.rotate.Angle = 270; |
1865 |
} |
1866 |
else |
1867 |
{ |
1868 |
instanceMain.dzMainMenu.rotate.Angle -= 90; |
1869 |
} |
1870 |
} |
1871 |
//double angle = (double)rotateValue.GetValue(rotateOffSet); |
1872 |
//instanceMain.dzMainMenu.rotate.Angle = angle; |
1873 |
var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90)); |
1874 |
|
1875 |
if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth) |
1876 |
{ |
1877 |
double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
1878 |
instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
1879 |
instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize; |
1880 |
} |
1881 |
if (instanceMain.dzMainMenu.rotate.Angle == 0) |
1882 |
{ |
1883 |
instanceMain.dzMainMenu.translate.X = 0; |
1884 |
instanceMain.dzMainMenu.translate.Y = 0; |
1885 |
} |
1886 |
else if (instanceMain.dzMainMenu.rotate.Angle == 90) |
1887 |
{ |
1888 |
instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
1889 |
instanceMain.dzMainMenu.translate.Y = 0; |
1890 |
} |
1891 |
else if (instanceMain.dzMainMenu.rotate.Angle == 180) |
1892 |
{ |
1893 |
instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
1894 |
instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
1895 |
} |
1896 |
else |
1897 |
{ |
1898 |
instanceMain.dzMainMenu.translate.X = 0; |
1899 |
instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
1900 |
} |
1901 |
|
1902 |
//instanceMain.dzMainMenu.zoomAndPanControl.RenderTransformOrigin = new Point(0.5, 0.5); |
1903 |
instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle; |
1904 |
//대기(강인구) |
1905 |
//instanceMain.dzMainMenu.imageViewer.RotateAngle = instanceMain.dzMainMenu.rotate.Angle; |
1906 |
|
1907 |
|
1908 |
//instanceMain.dzMainMenu.imageViewer.RenderTransformOrigin = new Point(0.5, 0.5); |
1909 |
//RotateTransform rotateTransform = new RotateTransform(instanceMain.dzMainMenu.rotate.Angle); |
1910 |
//instanceMain.dzMainMenu.imageViewer.RenderTransform = rotateTransform; |
1911 |
|
1912 |
|
1913 |
ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
1914 |
ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
1915 |
ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X; |
1916 |
ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y; |
1917 |
ViewerDataModel.Instance.PageAngle = instanceMain.dzMainMenu.rotate.Angle; |
1918 |
//ViewerDataModel.Instance.Document_Info.Clear(); |
1919 |
//ViewerDataModel.Instance.Document_Info.Where(i => i.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(value => |
1920 |
//{ |
1921 |
// value.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
1922 |
//}); |
1923 |
|
1924 |
|
1925 |
//이미지 각도 변경 시 실시간 Thumbnail 각도 변경(강인구 추가) |
1926 |
var thumbnaillist = instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Where(info => info.PageNumber == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber); |
1927 |
|
1928 |
foreach (var data in thumbnaillist) |
1929 |
{ |
1930 |
data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
1931 |
|
1932 |
//instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems; |
1933 |
var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault(); |
1934 |
instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
1935 |
|
1936 |
instanceMain.dzMainMenu.pageNavigator.GotoPage(data.PageNumber); |
1937 |
|
1938 |
//rotation page add or update |
1939 |
var rotationdoc = ViewerDataModel.Instance.RotationDocs.Where(d => d.ID == instance.ID).FirstOrDefault(); |
1940 |
if (rotationdoc != null) |
1941 |
{ |
1942 |
rotationdoc.PAGE_ANGLE = instance.PAGE_ANGLE; |
1943 |
} |
1944 |
else |
1945 |
{ |
1946 |
ViewerDataModel.Instance.RotationDocs.Add(instance); |
1947 |
} |
1948 |
} |
1949 |
} |
1950 |
#endregion |
1951 |
|
1952 |
private void ImageConverter(RadToggleButton instanceToggle) |
1953 |
{ |
1954 |
try |
1955 |
{ |
1956 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1957 |
|
1958 |
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); |
1959 |
dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png"; |
1960 |
Nullable<bool> result = dlg.ShowDialog(); |
1961 |
if (result == true) |
1962 |
{ |
1963 |
instanceMain.dzMainMenu.filename = dlg.FileName; |
1964 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl; |
1965 |
|
1966 |
System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename); |
1967 |
String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename); |
1968 |
long numByte = fileInfo.Length; |
1969 |
double dLen = Convert.ToDouble(fileInfo.Length / 1000000); |
1970 |
kr.co.devdoftech.cloud.FileUpload fileUploader = App.FileUploader; |
1971 |
|
1972 |
if (dLen < 4) |
1973 |
{ |
1974 |
System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read); |
1975 |
System.IO.BinaryReader br = new System.IO.BinaryReader(fStream); |
1976 |
byte[] data = br.ReadBytes((int)numByte); |
1977 |
br.Close(); |
1978 |
|
1979 |
string filepath = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data); |
1980 |
|
1981 |
Check_Uri.UriCheck(filepath); |
1982 |
|
1983 |
instanceMain.dzMainMenu.filename = filepath; |
1984 |
|
1985 |
fStream.Close(); |
1986 |
fStream.Dispose(); |
1987 |
} |
1988 |
else |
1989 |
{ |
1990 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert"); |
1991 |
} |
1992 |
} |
1993 |
else |
1994 |
{ |
1995 |
instanceToggle.IsChecked = false; |
1996 |
Common.ViewerDataModel.Instance.SelectedControl = ""; |
1997 |
Common.ViewerDataModel.Instance.ControlTag = null; |
1998 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
1999 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2000 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("No Image selected.", "Alert"); |
2001 |
} |
2002 |
} |
2003 |
catch(Exception ex) |
2004 |
{ |
2005 |
instanceToggle.IsChecked = false; |
2006 |
Common.ViewerDataModel.Instance.SelectedControl = ""; |
2007 |
Common.ViewerDataModel.Instance.ControlTag = null; |
2008 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2009 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2010 |
App.FileLogger.Error("Image Converter ",ex); |
2011 |
|
2012 |
this.ParentOfType<MainWindow>().DialogMessage_Alert(ex.Message, "Alert"); |
2013 |
} |
2014 |
} |
2015 |
|
2016 |
private void Control_Init(RadToggleButton instanceToggle, object sender) |
2017 |
{ |
2018 |
|
2019 |
} |
2020 |
|
2021 |
private void ControlEvent(object sender, RoutedEventArgs e) |
2022 |
{ |
2023 |
RadToggleButton instanceToggle = sender as RadToggleButton; |
2024 |
var instanceMain = this.ParentOfType<MainWindow>(); |
2025 |
|
2026 |
#region Ctrl + A 눌렀을 때 대처 방법 |
2027 |
//원인 : Ctrl + A를 누르면 UIElementSet에 등록을 시키지 않는다(이유는 한꺼번에 많은 양의 컨트롤의 동작이 유입되기 때문에 |
2028 |
// 시스템의 성능저하를 불러올 수 있기 때문이다. 그래서 선택 후 다른 컨트롤을 누르면 등록되지 않은 컨트롤이기 때문에 삭제된다 |
2029 |
// 이를 대처하는 방법으로 아래 코드를 사용한다. |
2030 |
if (Common.ViewerDataModel.Instance.MarkupControls.Count == 0 && Common.ViewerDataModel.Instance.MarkupControls.Count >= 1) |
2031 |
{ |
2032 |
//var lstItem = instanceMain.DeepLayer._SelectLayer.ChildrenOfType<AdornerFinal>().ToList(); |
2033 |
//foreach (var item in lstItem) |
2034 |
//{ |
2035 |
// foreach (var member in item.MemberSet) |
2036 |
// { |
2037 |
// if (!instanceMain.DeepLayer.UIElementSet.Contains(member.DrawingData)) |
2038 |
// { |
2039 |
// instanceMain.DeepLayer.UIElementSet.Add(member.DrawingData); |
2040 |
// } |
2041 |
// } |
2042 |
//} |
2043 |
} |
2044 |
#endregion |
2045 |
|
2046 |
//if (!instanceMain.IsFreeSelectionMode) |
2047 |
//{ |
2048 |
// instanceMain.IsSwingMode = true; |
2049 |
//} |
2050 |
|
2051 |
//#region 다른 컨트롤 버튼 선택 해제 |
2052 |
//System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.SelectedControl).Subscribe(ControlState => |
2053 |
//{ |
2054 |
// if (ControlState == null) |
2055 |
// { |
2056 |
// instanceToggle.IsChecked = false; |
2057 |
// HiddenControlHide(); |
2058 |
// } |
2059 |
//}); |
2060 |
//#endregion |
2061 |
|
2062 |
Release_ToggleButton(sender); //-> 해당 컨트롤을 제외한 모든 컨트롤에 대해 해제 처리 |
2063 |
|
2064 |
if (instanceToggle != null) |
2065 |
{ |
2066 |
Common.ViewerDataModel.Instance.ControlTag = instanceToggle.Tag.ToString(); |
2067 |
} |
2068 |
else if ((sender as RadRibbonToggleButton) != null) |
2069 |
{ |
2070 |
Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString(); |
2071 |
instanceToggle = (sender as RadRibbonToggleButton); |
2072 |
} |
2073 |
else if ((sender as RadRibbonButton) != null) |
2074 |
{ |
2075 |
RadRibbonButton instanceButton = sender as RadRibbonButton; |
2076 |
Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString(); |
2077 |
} |
2078 |
else |
2079 |
{ |
2080 |
RadButton instanceButton = sender as RadButton; |
2081 |
Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString(); |
2082 |
} |
2083 |
|
2084 |
|
2085 |
//System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleVisibility).Subscribe(isSee => |
2086 |
//{ |
2087 |
// if (instanceToggle.CommandParameter.ToString() == "ChainLine") |
2088 |
// { |
2089 |
|
2090 |
// } |
2091 |
// else |
2092 |
// { |
2093 |
// System.Diagnostics.Debug.WriteLine(" instanceMain.dzMainMenu.MainAngle.Visibility " + isSee); |
2094 |
|
2095 |
// if (instanceMain.dzMainMenu.MainAngle.Visibility != isSee) |
2096 |
// { |
2097 |
// instanceMain.dzMainMenu.MainAngle.Visibility = isSee; |
2098 |
// } |
2099 |
// } |
2100 |
// //System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleValue).Subscribe(p => |
2101 |
// //{ |
2102 |
// // instanceMain.dzMainMenu.MainAngle.AngleValue = p; |
2103 |
// //}); |
2104 |
//}); |
2105 |
|
2106 |
instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing; |
2107 |
|
2108 |
instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false; |
2109 |
|
2110 |
if (instanceToggle.IsChecked != false) |
2111 |
{ |
2112 |
string param = instanceToggle.CommandParameter.ToString(); |
2113 |
string MacroIndex = ""; |
2114 |
|
2115 |
if (param.StartsWith("MACRO")) |
2116 |
{ |
2117 |
param = "MACRO"; |
2118 |
MacroIndex = param.Replace("MACRO;",""); |
2119 |
|
2120 |
//Common.ViewerDataModel.Instance.MacroItems = MacroHelper.LoadMacroItems(MacroIndex); |
2121 |
//var items = MacroHelper.TopMenuItems(); |
2122 |
|
2123 |
Common.ViewerDataModel.Instance.MacroItems = new List<MacroItem> |
2124 |
{ |
2125 |
new MacroItem |
2126 |
{ |
2127 |
Desc = "Cloud Rectangle", |
2128 |
ControlType = MarkupToPDF.Controls.Common.ControlType.RectCloud |
2129 |
}, |
2130 |
new MacroItem |
2131 |
{ |
2132 |
Desc = "Arrow TextBox", |
2133 |
ControlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl |
2134 |
} |
2135 |
}; |
2136 |
} |
2137 |
|
2138 |
#region 컨트롤이 체크되었다면 |
2139 |
switch (param) |
2140 |
{ |
2141 |
#region Line |
2142 |
case "Line": |
2143 |
Common.ViewerDataModel.Instance.SelectedControl = "Line"; |
2144 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2145 |
if (instanceToggle.Tag.ToString() == "LineDelete") |
2146 |
{ |
2147 |
//HiddenInterval.Visibility = Visibility.Visible; |
2148 |
} |
2149 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.SingleLine; |
2150 |
break; |
2151 |
#endregion |
2152 |
#region ChainLine |
2153 |
case "ChainLine": |
2154 |
Common.ViewerDataModel.Instance.SelectedControl = "ChainLine"; |
2155 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2156 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ChainLine; |
2157 |
break; |
2158 |
#endregion |
2159 |
#region DimLine |
2160 |
case "DimLine": |
2161 |
Common.ViewerDataModel.Instance.SelectedControl = "DimLine"; |
2162 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2163 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.DimLine; |
2164 |
break; |
2165 |
#endregion |
2166 |
#region TwinLine |
2167 |
case "TwinLine": |
2168 |
Common.ViewerDataModel.Instance.SelectedControl = "TwinLine"; |
2169 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2170 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TwinLine; |
2171 |
break; |
2172 |
#endregion |
2173 |
#region CancelLine |
2174 |
case "CancelLine": |
2175 |
Common.ViewerDataModel.Instance.SelectedControl = "CancelLine"; |
2176 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2177 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.CancelLine; |
2178 |
break; |
2179 |
#endregion |
2180 |
#region PolygonCloud |
2181 |
case "PolygonCloud": |
2182 |
Common.ViewerDataModel.Instance.SelectedControl = "PolygonCloud"; |
2183 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2184 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonCloud; |
2185 |
break; |
2186 |
#endregion |
2187 |
#region RectCloud |
2188 |
case "RectCloud": |
2189 |
Common.ViewerDataModel.Instance.SelectedControl = "RectCloud"; |
2190 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2191 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.RectCloud; |
2192 |
break; |
2193 |
#endregion |
2194 |
#region Rectangle |
2195 |
case "Rectangle": |
2196 |
Common.ViewerDataModel.Instance.SelectedControl = "Rectangle"; |
2197 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2198 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Rectangle; |
2199 |
break; |
2200 |
#endregion |
2201 |
#region Triangle |
2202 |
case "Triangle": |
2203 |
Common.ViewerDataModel.Instance.SelectedControl = "Triangle"; |
2204 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2205 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Triangle; |
2206 |
break; |
2207 |
#endregion |
2208 |
#region RectCloud |
2209 |
case "Circle": |
2210 |
Common.ViewerDataModel.Instance.SelectedControl = "Circle"; |
2211 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2212 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Circle; |
2213 |
break; |
2214 |
#endregion |
2215 |
#region Symbol |
2216 |
case "Symbol": |
2217 |
Common.ViewerDataModel.Instance.SelectedControl = "Symbol"; |
2218 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2219 |
break; |
2220 |
#endregion |
2221 |
#region SymbolN |
2222 |
case "SymbolN": |
2223 |
Common.ViewerDataModel.Instance.SelectedControl = "SymbolN"; |
2224 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Stamp; |
2225 |
break; |
2226 |
#endregion |
2227 |
#region Text |
2228 |
case "Text": |
2229 |
Common.ViewerDataModel.Instance.SelectedControl = "Text"; |
2230 |
TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal); |
2231 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextControl; |
2232 |
break; |
2233 |
#endregion |
2234 |
#region TextBorder |
2235 |
case "TextBorder": |
2236 |
Common.ViewerDataModel.Instance.SelectedControl = "TextBorder"; |
2237 |
TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal); |
2238 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextBorder; |
2239 |
break; |
2240 |
#endregion |
2241 |
#region TextCloud |
2242 |
case "TextCloud": |
2243 |
Common.ViewerDataModel.Instance.SelectedControl = "TextCloud"; |
2244 |
TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal); |
2245 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextCloud; |
2246 |
break; |
2247 |
#endregion |
2248 |
#region Date |
2249 |
case "Date": |
2250 |
Common.ViewerDataModel.Instance.SelectedControl = "Date"; |
2251 |
TaskMessage("날짜 컨트롤을 더블 클릭하면 날짜를 변경할 수 있습니다", TaskMessageType.Normal); |
2252 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Date; |
2253 |
break; |
2254 |
#endregion |
2255 |
#region ArrowText |
2256 |
case "ArrowText": |
2257 |
TaskMessage("ArrowText 컨트롤은 그린 후 컨트롤을 선택하였을 시 중간점을 조정할 수 있습니다", TaskMessageType.Normal); |
2258 |
if (instanceToggle.Tag.ToString() == "ArrowText_Cloud") |
2259 |
{ |
2260 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowText_Cloud"; |
2261 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl; |
2262 |
} |
2263 |
else if (instanceToggle.Tag.ToString() == "ArrowText_Border") |
2264 |
{ |
2265 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowTextBorderControl"; |
2266 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl; |
2267 |
} |
2268 |
else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Normal") |
2269 |
{ |
2270 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextControl"; |
2271 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl; |
2272 |
} |
2273 |
else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Border") |
2274 |
{ |
2275 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextBorderControl"; |
2276 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl; |
2277 |
} |
2278 |
else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Cloud") |
2279 |
{ |
2280 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextCloudControl"; |
2281 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl; |
2282 |
} |
2283 |
else |
2284 |
{ |
2285 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowText"; |
2286 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextControl; |
2287 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2288 |
} |
2289 |
break; |
2290 |
#endregion |
2291 |
#region Arrow |
2292 |
case "Arrow": |
2293 |
Common.ViewerDataModel.Instance.SelectedControl = "Arrow"; |
2294 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2295 |
//HiddenDimSize.Visibility = Visibility.Visible; |
2296 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowLine; |
2297 |
break; |
2298 |
#endregion |
2299 |
#region Shape |
2300 |
case "Shape": |
2301 |
Common.ViewerDataModel.Instance.SelectedControl = "Shape"; |
2302 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark; |
2303 |
break; |
2304 |
#endregion |
2305 |
#region Polygon |
2306 |
case "Polygon": |
2307 |
Common.ViewerDataModel.Instance.SelectedControl = "Polygon"; |
2308 |
TaskMessage("자유형 코멘트 도구는 오른쪽 마우스 클릭을 통해 그리기를 마칠 수 있습니다", TaskMessageType.Normal); |
2309 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2310 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonControl; |
2311 |
break; |
2312 |
#endregion |
2313 |
#region Arc |
2314 |
case "Arc": |
2315 |
Common.ViewerDataModel.Instance.SelectedControl = "Arc"; |
2316 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcLine; |
2317 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2318 |
TaskMessage("Arc 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal); |
2319 |
break; |
2320 |
#endregion |
2321 |
#region ArrowArc |
2322 |
case "ArrowArc": |
2323 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowArc"; |
2324 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcArrow; |
2325 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2326 |
TaskMessage("ArcArrow 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal); |
2327 |
break; |
2328 |
#endregion |
2329 |
#region ArrowMulti |
2330 |
case "ArrowMulti": |
2331 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowMulti"; |
2332 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowMultiLine; |
2333 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2334 |
break; |
2335 |
#endregion |
2336 |
#region Etc |
2337 |
case "Etc": |
2338 |
Common.ViewerDataModel.Instance.SelectedControl = "Etc"; |
2339 |
break; |
2340 |
#endregion |
2341 |
#region Ink |
2342 |
case "Ink": |
2343 |
if (instanceToggle.Tag.ToString() == "EraserClear") |
2344 |
{ |
2345 |
TaskMessage("해당 컨트롤은 점 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal); |
2346 |
//instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint; |
2347 |
instanceMain.dzMainMenu.inkBoard.Tag = "EraseByPoint"; |
2348 |
} |
2349 |
else if (instanceToggle.Tag.ToString() == "Eraser") |
2350 |
{ |
2351 |
TaskMessage("해당 컨트롤은 선 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal); |
2352 |
instanceMain.dzMainMenu.inkBoard.Tag = "EraseByStroke"; |
2353 |
//instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke; |
2354 |
} |
2355 |
else |
2356 |
{ |
2357 |
instanceMain.dzMainMenu.inkBoard.Tag = "Ink"; |
2358 |
//instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.Ink; |
2359 |
} |
2360 |
|
2361 |
//instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = true; |
2362 |
|
2363 |
Common.ViewerDataModel.Instance.SelectedControl = "Ink"; |
2364 |
Common.ViewerDataModel.Instance.LineSize = (double)cbLineSize.Value; |
2365 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PenControl; |
2366 |
break; |
2367 |
#endregion |
2368 |
#region Select |
2369 |
case "Select": |
2370 |
if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null) |
2371 |
{ |
2372 |
if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl is MarkupToPDF.Controls.Text.TextControl |
2373 |
&& !string.IsNullOrEmpty(((MarkupToPDF.Controls.Text.TextControl)this.ParentOfType<MainWindow>().dzMainMenu.currentControl).Text)) |
2374 |
{ |
2375 |
DependencyObject focusScope1 = FocusManager.GetFocusScope((MarkupToPDF.Controls.Text.TextControl)this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
2376 |
FocusManager.SetFocusedElement(focusScope1, (MarkupToPDF.Controls.Text.TextControl)this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
2377 |
|
2378 |
this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null; |
2379 |
Keyboard.ClearFocus(); |
2380 |
|
2381 |
} |
2382 |
else |
2383 |
{ |
2384 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
2385 |
this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null; |
2386 |
} |
2387 |
} |
2388 |
|
2389 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting; |
2390 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2391 |
instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
2392 |
break; |
2393 |
#endregion |
2394 |
#region Image |
2395 |
case "Image": |
2396 |
Common.ViewerDataModel.Instance.SelectedControl = "ImgControl"; |
2397 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl; |
2398 |
ImageConverter(instanceToggle); |
2399 |
break; |
2400 |
#endregion |
2401 |
#region Sign |
2402 |
case "Sign": |
2403 |
Common.ViewerDataModel.Instance.SelectedControl = "Sign"; |
2404 |
Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번 |
2405 |
//강인구 추가 |
2406 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Sign; |
2407 |
//instanceMain.BaseClient.GetUserSignCompleted += (sen, ea) => |
2408 |
//{ |
2409 |
// if (ea.Result == null) |
2410 |
// { |
2411 |
|
2412 |
// this.ParentOfType<MainPage>().DialogMessage_Alert("You Don't Have Sign Data", "Alert"); |
2413 |
// } |
2414 |
// else |
2415 |
// { |
2416 |
// byte[] imageBytes = System.Convert.FromBase64String(ea.Result); |
2417 |
// using (MemoryStream ms = new MemoryStream(imageBytes)) |
2418 |
// { |
2419 |
// BitmapImage im = new BitmapImage(); |
2420 |
// im.SetSource(ms); |
2421 |
// instanceMain.DeepLayer.SignImage = im; |
2422 |
// ms.Close(); |
2423 |
// } |
2424 |
// } |
2425 |
//}; |
2426 |
//instanceMain.BaseClient.GetUserSignAsync(instanceMain._ViewInfo.UserID); |
2427 |
break; |
2428 |
#endregion |
2429 |
#region Check |
2430 |
case "Check": |
2431 |
Common.ViewerDataModel.Instance.SelectedControl = "Check"; |
2432 |
Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번 |
2433 |
//강인구 추가 |
2434 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Symbol; |
2435 |
break; |
2436 |
#endregion |
2437 |
#region Batch |
2438 |
case "Batch": |
2439 |
Common.ViewerDataModel.Instance.SelectedControl = "Batch"; |
2440 |
Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번 |
2441 |
//강인구 추가 |
2442 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark; |
2443 |
instanceMain.dzMainMenu.txtBatch.Visibility = Visibility.Visible; |
2444 |
instanceMain.dzMainMenu.txtBatch.Text = "Place Mark"; |
2445 |
break; |
2446 |
#endregion |
2447 |
|
2448 |
#region MACRO -MACRO1 |
2449 |
case "MACRO": |
2450 |
Common.ViewerDataModel.Instance.SelectedControl = "MACRO"; |
2451 |
Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번 |
2452 |
|
2453 |
MacroHelper.MacroAction(); |
2454 |
|
2455 |
break; |
2456 |
#endregion |
2457 |
|
2458 |
#region Copy |
2459 |
case "Copy": |
2460 |
CopyCommand.Instance.Execute(); |
2461 |
//Copy_Start(); |
2462 |
instanceToggle.IsChecked = false; |
2463 |
ViewerDataModel.Instance.SelectedControl = ""; |
2464 |
ViewerDataModel.Instance.ControlTag = null; |
2465 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2466 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2467 |
break; |
2468 |
#endregion |
2469 |
#region Cut |
2470 |
case "Cut": |
2471 |
//Cut_Start(); |
2472 |
CutCommand.Instance.Execute(); |
2473 |
instanceToggle.IsChecked = false; |
2474 |
ViewerDataModel.Instance.SelectedControl = ""; |
2475 |
ViewerDataModel.Instance.ControlTag = null; |
2476 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2477 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2478 |
break; |
2479 |
#endregion |
2480 |
#region Paste |
2481 |
case "Paste": |
2482 |
PasteCommand.Instance.Execute(); |
2483 |
//Paste_Start(); |
2484 |
instanceToggle.IsChecked = false; |
2485 |
ViewerDataModel.Instance.SelectedControl = ""; |
2486 |
ViewerDataModel.Instance.ControlTag = null; |
2487 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2488 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2489 |
break; |
2490 |
#endregion |
2491 |
#region Delete |
2492 |
case "Delete": |
2493 |
DeleteCommand.Instance.Execute(SelectionSet.Instance.SelectedItems); |
2494 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear(); |
2495 |
|
2496 |
instanceToggle.IsChecked = false; |
2497 |
ViewerDataModel.Instance.SelectedControl = ""; |
2498 |
ViewerDataModel.Instance.ControlTag = null; |
2499 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2500 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2501 |
break; |
2502 |
#endregion |
2503 |
#region Undo |
2504 |
case "Undo": |
2505 |
UndoCommand.Instance.Execute(); |
2506 |
instanceToggle.IsChecked = false; |
2507 |
ViewerDataModel.Instance.SelectedControl = ""; |
2508 |
ViewerDataModel.Instance.ControlTag = null; |
2509 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2510 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2511 |
break; |
2512 |
#endregion |
2513 |
#region Redo |
2514 |
case "Redo": |
2515 |
RedoCommand.Instance.Execute(); |
2516 |
instanceToggle.IsChecked = false; |
2517 |
ViewerDataModel.Instance.SelectedControl = ""; |
2518 |
ViewerDataModel.Instance.ControlTag = null; |
2519 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2520 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2521 |
break; |
2522 |
#endregion |
2523 |
#region DragZoom |
2524 |
case "DragZoom": |
2525 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.DragZoom; |
2526 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2527 |
instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
2528 |
break; |
2529 |
#endregion |
2530 |
#region Grouping |
2531 |
case "Group": |
2532 |
//var GrouptoggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>(); |
2533 |
//foreach (var togle in GrouptoggleList) |
2534 |
//{ |
2535 |
// togle.IsChecked = false; |
2536 |
//} |
2537 |
|
2538 |
//if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null) |
2539 |
//{ |
2540 |
// ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
2541 |
// this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null; |
2542 |
//} |
2543 |
//this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2544 |
//instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2545 |
//instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
2546 |
//if (ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면 |
2547 |
//{ |
2548 |
// this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Please Select Controls", "Alert"); |
2549 |
//} |
2550 |
//else//if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
2551 |
//{ |
2552 |
// // string MarkupData = ""; |
2553 |
// foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
2554 |
// { |
2555 |
// if (item.GetType().Name == "AdornerFinal" && (item as AdornerFinal).MemberSet.Count >= 2) // 얘가 2개 이상이여야 그룹가능 버튼도 막을거긴하지만 일단.. |
2556 |
// { |
2557 |
// //MARKUP_DATA_GROUP INSERT |
2558 |
// MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP |
2559 |
// { |
2560 |
// SYMBOL_ID = null,//InnerItem.Symbol_ID |
2561 |
// STATE = 0, |
2562 |
// }; |
2563 |
// long group_id = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMarkupDataGroup(mARKUP_DATA_GROUP, App.ViewInfo.ProjectNO); |
2564 |
// //Logger.sendReqLog("AddMarkupDataGroup: ", "", 1); |
2565 |
// if (group_id > 0) |
2566 |
// { |
2567 |
// foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
2568 |
// { |
2569 |
// if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
2570 |
// { |
2571 |
// //MARKUP_DATA UPDATE |
2572 |
// //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, group_id, App.ViewInfo.ProjectNO); |
2573 |
// ////Logger.sendReqLog("UpdateMarkupData: ", "", 1); |
2574 |
// ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = group_id; |
2575 |
// ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true; |
2576 |
// } |
2577 |
// } |
2578 |
// } |
2579 |
// } |
2580 |
// } |
2581 |
//} |
2582 |
break; |
2583 |
case "UnGroup": |
2584 |
//var UnGrouptoggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>(); |
2585 |
//foreach (var togle in UnGrouptoggleList) |
2586 |
//{ |
2587 |
// togle.IsChecked = false; |
2588 |
//} |
2589 |
//if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null) |
2590 |
//{ |
2591 |
// ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
2592 |
// this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null; |
2593 |
//} |
2594 |
//this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2595 |
//instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2596 |
//instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
2597 |
|
2598 |
//if (ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면 |
2599 |
//{ |
2600 |
// this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Please Select Controls", "Alert"); |
2601 |
//} |
2602 |
//else//if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
2603 |
//{ |
2604 |
// // string MarkupData = ""; |
2605 |
// foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
2606 |
// { |
2607 |
// if (item.GetType().Name == "AdornerFinal" && (item as AdornerFinal).MemberSet.Count >= 1) // 1개 이상 |
2608 |
// { |
2609 |
// //MARKUP_DATA UPDATE |
2610 |
// foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
2611 |
// { |
2612 |
// if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
2613 |
// { |
2614 |
// long group_id = ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault().Group_ID; |
2615 |
// //MARKUP_DATA UPDATE |
2616 |
// //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, 0, App.ViewInfo.ProjectNO); |
2617 |
// ////Logger.sendReqLog("UpdateMarkupData: ", "", 1); |
2618 |
// ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = 0; |
2619 |
// ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true; |
2620 |
|
2621 |
|
2622 |
// //MARKUP_DATA_GROUP UPDATE |
2623 |
// //bool value = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupDataGroup(group_id, App.ViewInfo.ProjectNO); |
2624 |
// ////Logger.sendReqLog("AddMarkupDataGroup: ", value.ToString(), 1); |
2625 |
// } |
2626 |
// } |
2627 |
// } |
2628 |
// } |
2629 |
//} |
2630 |
break; |
2631 |
#endregion |
2632 |
#region Capture |
2633 |
case "Capture": |
2634 |
SyncInit(); |
2635 |
// instanceToggle.IsChecked = false; |
2636 |
var CaptureList = this.Parent.ChildrenOfType<RadRibbonToggleButton>(); |
2637 |
foreach (var togle in CaptureList) |
2638 |
{ |
2639 |
togle.IsChecked = false; |
2640 |
} |
2641 |
|
2642 |
if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null) |
2643 |
{ |
2644 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
2645 |
this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null; |
2646 |
} |
2647 |
|
2648 |
ViewerDataModel.Instance.SelectedControl = "ImgControl"; |
2649 |
// ViewerDataModel.Instance.ControlTag = null; |
2650 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl; |
2651 |
|
2652 |
/* |
2653 |
//캡쳐 하기 전에 코멘트 저장 |
2654 |
if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (Application.Current.MainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0) |
2655 |
{ |
2656 |
var menu = (Application.Current.MainWindow as MainWindow).dzMainMenu; |
2657 |
menu.ReleaseAdorner(); |
2658 |
if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true) |
2659 |
{ |
2660 |
(Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu); |
2661 |
} |
2662 |
else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID) |
2663 |
{ |
2664 |
|
2665 |
} |
2666 |
else |
2667 |
{ |
2668 |
(Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu); |
2669 |
} |
2670 |
}*/ |
2671 |
|
2672 |
//Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).ID; |
2673 |
//Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Image).DataContext as Customer).ID; |
2674 |
//Common.ViewerDataModel.Instance.PageNumber = ((e.Source as Image).DataContext as Customer).PAGENUMBER; |
2675 |
Application.Current.MainWindow.Focus(); |
2676 |
Common.ViewerDataModel.Instance.Capture_Opacity = 0.49; |
2677 |
(Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture; |
2678 |
break; |
2679 |
#endregion |
2680 |
#region Cad |
2681 |
case "Inside": |
2682 |
//instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing; |
2683 |
//instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false; |
2684 |
Common.ViewerDataModel.Instance.SelectedControl = "InsideWhite"; |
2685 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.InsideWhite; |
2686 |
break; |
2687 |
case "Overlap": |
2688 |
//instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing; |
2689 |
//instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false; |
2690 |
Common.ViewerDataModel.Instance.SelectedControl = "OverlapWhite"; |
2691 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.OverlapWhite; |
2692 |
break; |
2693 |
case "Clip": |
2694 |
//instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing; |
2695 |
//instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false; |
2696 |
Common.ViewerDataModel.Instance.SelectedControl = "ClipWhite"; |
2697 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ClipWhite; |
2698 |
break; |
2699 |
case "CadExport": |
2700 |
//if (isClosed) |
2701 |
//{ |
2702 |
// //토글 및 마우스 상태 초기화 |
2703 |
// var toggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>(); |
2704 |
// foreach (var togle in toggleList) |
2705 |
// { |
2706 |
// togle.IsChecked = false; |
2707 |
// } |
2708 |
// this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2709 |
|
2710 |
// isClosed = false; |
2711 |
// //Control 파일 먼저 생성 |
2712 |
// CollapsedButton_Click(); |
2713 |
// CadViewer check = new CadViewer(); |
2714 |
// check.WindowStartupLocation = WindowStartupLocation.CenterScreen; |
2715 |
// check.Title = "Export Viewer"; |
2716 |
// //check.Topmost = true; |
2717 |
// check.Show(); |
2718 |
// check.Closed += Check_Closed; |
2719 |
// instanceToggle.IsChecked = false; |
2720 |
//} |
2721 |
//break; |
2722 |
case "CadViewer": |
2723 |
//if (isClosed) |
2724 |
//{ |
2725 |
// //토글 및 마우스 상태 초기화 |
2726 |
// var toggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>(); |
2727 |
// foreach (var togle in toggleList) |
2728 |
// { |
2729 |
// togle.IsChecked = false; |
2730 |
// } |
2731 |
// this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2732 |
|
2733 |
// isClosed = false; |
2734 |
// CadResultViewer check = new CadResultViewer(); |
2735 |
// check.WindowStartupLocation = WindowStartupLocation.CenterScreen; |
2736 |
// check.Title = "Viewer"; |
2737 |
// check.Show(); |
2738 |
|
2739 |
// check.Closed += Check_Closed; |
2740 |
|
2741 |
//} |
2742 |
break; |
2743 |
#endregion |
2744 |
default: |
2745 |
break; |
2746 |
} |
2747 |
#endregion |
2748 |
} |
2749 |
else |
2750 |
{ |
2751 |
if (Common.ViewerDataModel.Instance.IsMacroCommand) |
2752 |
{ |
2753 |
MacroHelper.Clear(); |
2754 |
} |
2755 |
|
2756 |
if (!instanceMain.dzMainMenu.IsFreeSelectionMode) |
2757 |
{ |
2758 |
instanceMain.dzMainMenu.IsSwingMode = false; |
2759 |
Common.ViewerDataModel.Instance.SelectedControl = ""; |
2760 |
Common.ViewerDataModel.Instance.ControlTag = null; |
2761 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2762 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2763 |
} |
2764 |
} |
2765 |
|
2766 |
} |
2767 |
|
2768 |
private void SyncInit() |
2769 |
{ |
2770 |
try |
2771 |
{ |
2772 |
if (!ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden) |
2773 |
{ |
2774 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden = true; |
2775 |
ViewerDataModel.Instance.PageBalanceMode = false; |
2776 |
ViewerDataModel.Instance.PageBalanceNumber = 0; |
2777 |
ViewerDataModel.Instance.SyncPageNumber = 0; |
2778 |
ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
2779 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewRevMarkup.Visibility = Visibility.Collapsed; |
2780 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.UserList.IsChecked = false; |
2781 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.BalanceMode.IsChecked = false; |
2782 |
} |
2783 |
} |
2784 |
catch (Exception ex) |
2785 |
{ |
2786 |
//Logger.sendResLog("SyncInit", ex.Message, 0); |
2787 |
} |
2788 |
|
2789 |
} |
2790 |
|
2791 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
2792 |
CommentUserInfo currentControl { get; set; } |
2793 |
private void Check_Closed(object sender, EventArgs e) |
2794 |
{ |
2795 |
isClosed = true; |
2796 |
//this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true; |
2797 |
//토글 및 마우스 상태 초기화 |
2798 |
var toggleList = this.Parent.ChildrenOfType<RadToggleButton>(); |
2799 |
foreach (var togle in toggleList) |
2800 |
{ |
2801 |
togle.IsChecked = false; |
2802 |
} |
2803 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2804 |
ViewerDataModel.Instance.Capture_Opacity = 0; |
2805 |
|
2806 |
} |
2807 |
|
2808 |
/* public class test |
2809 |
{ |
2810 |
public double width { get; set; } |
2811 |
public double height { get; set; } |
2812 |
} |
2813 |
*/ |
2814 |
private async void CollapsedButton_Click() |
2815 |
{ |
2816 |
this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); // 저장하지 못한 데이터가 있다면 저장 |
2817 |
|
2818 |
string[] data = new string[0]; |
2819 |
|
2820 |
int cnt = 0; |
2821 |
var menu = this.ParentOfType<MainWindow>().dzMainMenu; |
2822 |
|
2823 |
List<MarkupInfoItem> gridSelectionItem = menu.gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
2824 |
|
2825 |
foreach (var item in gridSelectionItem) |
2826 |
{ |
2827 |
if ((item.UserID == App.ViewInfo.UserID) && (ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage != null)) |
2828 |
{ |
2829 |
var instance = ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber && |
2830 |
d.MarkupInfoID == item.MarkupInfoID).ToList(); |
2831 |
data = new string[instance.Count]; |
2832 |
foreach (var markup in instance) |
2833 |
{ |
2834 |
data[cnt++] = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(markup.Data,ViewerDataModel.Instance.NewMarkupCancelToken()); |
2835 |
} |
2836 |
} |
2837 |
} |
2838 |
|
2839 |
if (data != null && KCOM.Properties.Settings.Default.cad == 1) |
2840 |
{ |
2841 |
string FilePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Cad"); |
2842 |
string FileName = FilePath + "\\commentstring.json"; // Default file name |
2843 |
if (!File.Exists(FilePath)) |
2844 |
{ |
2845 |
Directory.CreateDirectory(FilePath); |
2846 |
} |
2847 |
|
2848 |
if (!string.IsNullOrEmpty(FileName)) |
2849 |
{ |
2850 |
// File.WriteAllText(SaveDig.FileName, data); |
2851 |
File.WriteAllLines(FileName, data); |
2852 |
} |
2853 |
} |
2854 |
} |
2855 |
|
2856 |
private double minHeight; |
2857 |
private double minWidth; |
2858 |
|
2859 |
private double maxHeight; |
2860 |
private double maxWidth; |
2861 |
|
2862 |
public bool CanVResize { get; private set; } |
2863 |
public bool CanHResize { get; private set; } |
2864 |
|
2865 |
public void DesignerComponent(FrameworkElement content) |
2866 |
{ |
2867 |
this.InitializeComponent(); |
2868 |
|
2869 |
if (!double.IsNaN(content.Width)) |
2870 |
{ |
2871 |
CanHResize = false; |
2872 |
this.Width = content.Width; |
2873 |
} |
2874 |
else |
2875 |
{ |
2876 |
CanHResize = true; |
2877 |
this.Width = 23.0; |
2878 |
} |
2879 |
if (!double.IsNaN(content.Height)) |
2880 |
{ |
2881 |
CanVResize = false; |
2882 |
this.Height = content.Height; ; |
2883 |
} |
2884 |
else |
2885 |
{ |
2886 |
CanVResize = true; |
2887 |
this.Height = 23.0; |
2888 |
} |
2889 |
|
2890 |
minWidth = content.MinWidth < 10.0 ? 10.0 : content.MinWidth; |
2891 |
minHeight = content.MinHeight < 10.0 ? 10.0 : content.MinHeight; |
2892 |
maxWidth = content.MaxWidth; |
2893 |
maxHeight = content.MaxHeight; |
2894 |
|
2895 |
double top = (double)content.GetValue(Canvas.TopProperty); |
2896 |
if (double.IsNaN(top)) |
2897 |
top = 0.0; |
2898 |
double left = (double)content.GetValue(Canvas.LeftProperty); |
2899 |
if (double.IsNaN(left)) |
2900 |
left = 0.0; |
2901 |
SetValue(Canvas.TopProperty, top); |
2902 |
SetValue(Canvas.LeftProperty, left); |
2903 |
|
2904 |
//Set the actual content. Note that "Content" property is a new property. See below |
2905 |
this.Content = content; |
2906 |
} |
2907 |
private void Thumb_DragDelta(object sender, DragDeltaEventArgs e) |
2908 |
{ |
2909 |
string name = ((Thumb)sender).Name; |
2910 |
if (name.Contains("Top")) |
2911 |
{ |
2912 |
double newHeight = this.Height - e.VerticalChange; |
2913 |
if (newHeight >= minHeight && newHeight <= maxHeight) |
2914 |
{ |
2915 |
this.Height = newHeight; |
2916 |
SetValue(Canvas.TopProperty, |
2917 |
(double)GetValue(Canvas.TopProperty) + e.VerticalChange); |
2918 |
} |
2919 |
} |
2920 |
if (name.Contains("Right")) |
2921 |
{ |
2922 |
double newWidth = this.Width + e.HorizontalChange; |
2923 |
if (newWidth >= minWidth && newWidth <= maxWidth) |
2924 |
this.Width = newWidth; |
2925 |
} |
2926 |
if (name.Contains("Bottom")) |
2927 |
{ |
2928 |
double newHeight = this.Height + e.VerticalChange; |
2929 |
if (newHeight >= minHeight && newHeight <= maxHeight) |
2930 |
this.Height = newHeight; |
2931 |
} |
2932 |
if (name.Contains("Left")) |
2933 |
{ |
2934 |
double newWidth = this.Width - e.HorizontalChange; |
2935 |
if (newWidth >= minWidth && newWidth <= maxWidth) |
2936 |
{ |
2937 |
this.Width = newWidth; |
2938 |
SetValue(Canvas.LeftProperty, |
2939 |
(double)GetValue(Canvas.LeftProperty) + e.HorizontalChange); |
2940 |
} |
2941 |
} |
2942 |
} |
2943 |
|
2944 |
private void drawControlBorder(object sender) |
2945 |
{ |
2946 |
System.Windows.Controls.Control control = (System.Windows.Controls.Control)sender; |
2947 |
} |
2948 |
|
2949 |
private void ResizeThumb_DragDelta(object sender, MouseButtonEventArgs e) |
2950 |
{ |
2951 |
System.Windows.Controls.Control designerItem = (System.Windows.Controls.Control)sender; |
2952 |
if (designerItem != null) |
2953 |
{ |
2954 |
double deltaVertical, deltaHorizontal; |
2955 |
|
2956 |
switch (VerticalAlignment) |
2957 |
{ |
2958 |
case VerticalAlignment.Bottom: |
2959 |
deltaVertical = designerItem.ActualHeight - designerItem.MinHeight; |
2960 |
designerItem.Height -= deltaVertical; |
2961 |
break; |
2962 |
case VerticalAlignment.Top: |
2963 |
deltaVertical = designerItem.ActualHeight - designerItem.MinHeight; |
2964 |
Canvas.SetTop(designerItem, Canvas.GetTop(designerItem) + deltaVertical); |
2965 |
designerItem.Height -= deltaVertical; |
2966 |
break; |
2967 |
default: |
2968 |
break; |
2969 |
} |
2970 |
|
2971 |
switch (HorizontalAlignment) |
2972 |
{ |
2973 |
case HorizontalAlignment.Left: |
2974 |
deltaHorizontal = designerItem.ActualWidth - designerItem.MinWidth; |
2975 |
Canvas.SetLeft(designerItem, Canvas.GetLeft(designerItem) + deltaHorizontal); |
2976 |
designerItem.Width -= deltaHorizontal; |
2977 |
break; |
2978 |
case HorizontalAlignment.Right: |
2979 |
deltaHorizontal = designerItem.ActualWidth - designerItem.MinWidth; |
2980 |
designerItem.Width -= deltaHorizontal; |
2981 |
break; |
2982 |
default: |
2983 |
break; |
2984 |
} |
2985 |
} |
2986 |
e.Handled = true; |
2987 |
} |
2988 |
|
2989 |
SaveFileDialog SaveDig = new SaveFileDialog(); //파일 세이브 다이얼로그 |
2990 |
|
2991 |
void ExportMethod() |
2992 |
{ |
2993 |
//FileDialogFilter filterImage = new FileDialogFilter("Image Files", "*.jpg", "*.png"); |
2994 |
SaveDig.Filter = "PDF file format|*.pdf"; |
2995 |
SaveDig.Title = "Save an DWG File"; |
2996 |
SaveDig.ShowDialog(); |
2997 |
} |
2998 |
|
2999 |
private void cbAutoSave_Checked(object sender, RoutedEventArgs e) |
3000 |
{ |
3001 |
if (cbAutoSave.IsChecked == true) |
3002 |
{ |
3003 |
SaveTime(true, (int)cbSaveInterval.Value); |
3004 |
} |
3005 |
else |
3006 |
{ |
3007 |
SaveTime(false, (int)cbSaveInterval.Value); |
3008 |
} |
3009 |
} |
3010 |
private void cbSaveInterval_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
3011 |
{ |
3012 |
if(string.IsNullOrEmpty(cbSaveInterval.Value.ToString())) |
3013 |
{ |
3014 |
cbSaveInterval.Value = cbSaveInterval.Minimum; |
3015 |
} |
3016 |
if (cbAutoSave.IsChecked == true) |
3017 |
{ |
3018 |
SaveTime(true, (int)cbSaveInterval.Value); |
3019 |
} |
3020 |
|
3021 |
KCOM.Properties.Settings.Default.SaveInterval = (double)cbSaveInterval.Value; |
3022 |
Properties.Settings.Default.Save(); |
3023 |
} |
3024 |
//강인구 자동 저장 추가 |
3025 |
private void AutoSave(object sender, RoutedEventArgs e) |
3026 |
{ |
3027 |
RadToggleButton instanceToggle = sender as RadToggleButton; |
3028 |
|
3029 |
if(instanceToggle.IsChecked == true) |
3030 |
{ |
3031 |
SaveTime(true); |
3032 |
} |
3033 |
else |
3034 |
{ |
3035 |
SaveTime(false); |
3036 |
} |
3037 |
} |
3038 |
|
3039 |
public void Copy_Start() |
3040 |
{ |
3041 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
3042 |
{ |
3043 |
string MarkupData = ""; |
3044 |
|
3045 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
3046 |
{ |
3047 |
string id = string.Empty; |
3048 |
if (item.GetType().Name == "AdornerFinal") |
3049 |
{ |
3050 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
3051 |
|
3052 |
{ |
3053 |
if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
3054 |
{ |
3055 |
MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn res = MarkupParser.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID); |
3056 |
id = (InnerItem.Symbol_ID != null) ? "|SymbolID|" + InnerItem.Symbol_ID : ""; |
3057 |
MarkupData += "|OR|" + res.ConvertData + id; |
3058 |
} |
3059 |
} |
3060 |
|
3061 |
this.Dispatcher.Invoke(() => |
3062 |
{ |
3063 |
Clipboard.SetData(DataFormats.StringFormat, MarkupData); |
3064 |
}, DispatcherPriority.Background); |
3065 |
} |
3066 |
} |
3067 |
} |
3068 |
} |
3069 |
|
3070 |
public void Cut_Start() |
3071 |
{ |
3072 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
3073 |
{ |
3074 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
3075 |
{ |
3076 |
string MarkupData = ""; |
3077 |
|
3078 |
if (item.GetType().Name == "AdornerFinal") |
3079 |
{ |
3080 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
3081 |
{ |
3082 |
if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
3083 |
{ |
3084 |
MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn res = MarkupParser.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID); |
3085 |
MarkupData += "|OR|" + res.ConvertData; |
3086 |
} |
3087 |
} |
3088 |
//클립보드에 넣음 |
3089 |
Clipboard.SetDataObject(MarkupData); |
3090 |
} |
3091 |
} |
3092 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear(); |
3093 |
} |
3094 |
} |
3095 |
|
3096 |
public async void Paste_Start() |
3097 |
{ |
3098 |
//마크업 붙여넣기 |
3099 |
|
3100 |
var markupData = Clipboard.GetData(DataFormats.StringFormat); |
3101 |
|
3102 |
if (markupData.GetType() == typeof(string) && markupData.ToString().Contains("|OR||DZ|")) |
3103 |
{ |
3104 |
List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
3105 |
|
3106 |
string[] delimiterChars = { "|OR|" }; |
3107 |
string[] data = markupData.ToString().Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries); |
3108 |
|
3109 |
SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu); |
3110 |
|
3111 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
3112 |
|
3113 |
//강인구 Undo/Redo 보류 |
3114 |
MarkupToPDF.Common.Undo_data UndoData = new Undo_data() |
3115 |
{ |
3116 |
IsUndo = false, |
3117 |
Event = Event_Type.Create, |
3118 |
EventTime = DateTime.Now, |
3119 |
Markup_List = new List<Multi_Undo_data>() |
3120 |
}; |
3121 |
|
3122 |
ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i => |
3123 |
{ |
3124 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
3125 |
}); |
3126 |
|
3127 |
foreach (string parse in data) |
3128 |
{ |
3129 |
if (parse != "") |
3130 |
{ |
3131 |
System.Windows.Controls.Control item = await MarkupParser.ParseExAsync(App.BaseAddress,ViewerDataModel.Instance.NewMarkupCancelToken(),App.ViewInfo.ProjectNO, parse, ViewerDataModel.Instance.MarkupControls_USER, ViewerDataModel.Instance.PageAngle, string.Empty, string.Empty); |
3132 |
(item as MarkupToPDF.Common.CommentUserInfo).CommentID = Commons.shortGuid(); |
3133 |
|
3134 |
ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
3135 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
3136 |
|
3137 |
adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo); |
3138 |
|
3139 |
multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo); |
3140 |
|
3141 |
UndoData.Markup_List.Add(multi_Undo_Data); |
3142 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
3143 |
} |
3144 |
} |
3145 |
Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet); |
3146 |
|
3147 |
if(this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X < 0) |
3148 |
{ |
3149 |
Canvas.SetLeft(final, 0); |
3150 |
Canvas.SetTop(final, 0); |
3151 |
} |
3152 |
else |
3153 |
{ |
3154 |
double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
3155 |
double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
3156 |
final.TranslateItems(realPointX, realPointY); |
3157 |
|
3158 |
if (final.Members.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null) |
3159 |
{ |
3160 |
final.TranslateItems(0.001, 0.001); //dummy |
3161 |
} |
3162 |
} |
3163 |
|
3164 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final); |
3165 |
} |
3166 |
//외부 이미지 붙여넣기 |
3167 |
else if (Clipboard.GetImage() != null) |
3168 |
{ |
3169 |
try |
3170 |
{ |
3171 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
3172 |
|
3173 |
//강인구 Undo/Redo 보류 |
3174 |
MarkupToPDF.Common.Undo_data UndoData = new Undo_data() |
3175 |
{ |
3176 |
IsUndo = false, |
3177 |
Event = Event_Type.Create, |
3178 |
EventTime = DateTime.Now, |
3179 |
Markup_List = new List<Multi_Undo_data>() |
3180 |
}; |
3181 |
|
3182 |
|
3183 |
string temppath = System.IO.Path.GetTempPath(); |
3184 |
//string filename = KCOM.Events.Save.shortCommentKey(); |
3185 |
string filename = Commons.shortFileKey(); |
3186 |
|
3187 |
System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage(); |
3188 |
clipboardImage.Save(temppath + "\\" + filename); |
3189 |
|
3190 |
System.IO.FileInfo fileInfo = new System.IO.FileInfo(temppath + "\\" + filename); |
3191 |
String strFile = System.IO.Path.GetFileName(fileInfo.FullName); |
3192 |
long numByte = fileInfo.Length; |
3193 |
double dLen = Convert.ToDouble(fileInfo.Length / 1000000); |
3194 |
kr.co.devdoftech.cloud.FileUpload fileUploader = App.FileUploader; |
3195 |
|
3196 |
if (dLen < 4) |
3197 |
{ |
3198 |
System.IO.FileStream fStream = new System.IO.FileStream(fileInfo.FullName, |
3199 |
System.IO.FileMode.Open, System.IO.FileAccess.Read,FileShare.Read); |
3200 |
System.IO.BinaryReader br = new System.IO.BinaryReader(fStream); |
3201 |
byte[] data = br.ReadBytes((int)numByte); |
3202 |
|
3203 |
filename = fileUploader.Run(App.ViewInfo.ProjectNO, this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile + ".png", data); |
3204 |
Check_Uri.UriCheck(filename); |
3205 |
br.Close(); |
3206 |
fStream.Close(); |
3207 |
fStream.Dispose(); |
3208 |
} |
3209 |
else |
3210 |
{ |
3211 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert"); |
3212 |
return; |
3213 |
} |
3214 |
|
3215 |
fileInfo.Delete(); |
3216 |
|
3217 |
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(clipboardImage); |
3218 |
IntPtr hBitmap = bmp.GetHbitmap(); |
3219 |
System.Windows.Media.ImageSource WpfBitmap = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions()); |
3220 |
Image img = new Image(); |
3221 |
if (filename.Contains(".svg")) |
3222 |
{ |
3223 |
SharpVectors.Converters.SvgImageExtension svgImage = new SharpVectors.Converters.SvgImageExtension(filename); |
3224 |
img.Source = (DrawingImage)svgImage.ProvideValue(null); |
3225 |
} |
3226 |
else |
3227 |
{ |
3228 |
img.Source = new BitmapImage(new Uri(filename)); |
3229 |
} |
3230 |
|
3231 |
var currentControl = new MarkupToPDF.Controls.Etc.ImgControl |
3232 |
{ |
3233 |
PointSet = new List<Point>(), |
3234 |
FilePath = filename, |
3235 |
ImageData = img.Source, |
3236 |
StartPoint = new Point(100, 100), |
3237 |
EndPoint = new Point(200, 200), |
3238 |
TopRightPoint = new Point(100, 200), |
3239 |
LeftBottomPoint = new Point(200, 100) |
3240 |
}; |
3241 |
|
3242 |
currentControl.TopRightPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y); |
3243 |
currentControl.LeftBottomPoint = new Point(currentControl.StartPoint.X, currentControl.StartPoint.Y + clipboardImage.Height); |
3244 |
currentControl.EndPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y + clipboardImage.Height); |
3245 |
|
3246 |
currentControl.PointSet = new List<Point> |
3247 |
{ |
3248 |
currentControl.StartPoint, |
3249 |
currentControl.LeftBottomPoint, |
3250 |
currentControl.EndPoint, |
3251 |
currentControl.TopRightPoint, |
3252 |
}; |
3253 |
|
3254 |
multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
3255 |
UndoData.Markup_List.Add(multi_Undo_Data); |
3256 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
3257 |
|
3258 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo); |
3259 |
currentControl.CommentID = Commons.shortGuid(); |
3260 |
|
3261 |
currentControl.ApplyTemplate(); |
3262 |
currentControl.SetImage(); |
3263 |
|
3264 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo); |
3265 |
Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo); |
3266 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final); |
3267 |
|
3268 |
double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
3269 |
double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
3270 |
final.TranslateItems(realPointX, realPointY); |
3271 |
} |
3272 |
catch(Exception ex) |
3273 |
{ |
3274 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("" + ex, "Alert"); |
3275 |
} |
3276 |
} |
3277 |
} |
3278 |
} |
3279 |
} |