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