프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / Events / Implementation / TopMenuEvent.cs @ 5822e146

이력 | 보기 | 이력해설 | 다운로드 (117 KB)

1 787a4489 KangIngu
using KCOM.Common;
2
using KCOM.Common.Converter;
3
using KCOM.Controls;
4
using KCOM.Events;
5
using MarkupToPDF.Common;
6
using System;
7
using System.Collections.Generic;
8
using System.Linq;
9
using System.Text;
10
using System.Windows;
11
using System.Windows.Controls;
12
using System.Windows.Input;
13
using System.Windows.Media;
14
using Telerik.Windows.Controls;
15
16
namespace KCOM.Views
17
{
18
    public partial class TopMenu : UserControl
19
    {
20
        public int rotateOffSet = 0;
21
        private double[] rotateValue = { 0, 90, 180, 270 };
22
        public System.Windows.Threading.DispatcherTimer SaveTimer { get; set; }
23
        public bool isClosed = true;
24
        public RadWindow CheckPop;
25 d4b0c723 KangIngu
        public MarkupToPDF.Common.Undo_data UndoData;
26
        MarkupToPDF.Controls.Parsing.LayerControl.MarkupReturn markupReturn = new MarkupToPDF.Controls.Parsing.LayerControl.MarkupReturn();
27
        MarkupToPDF.Controls.Parsing.LayerControl layer = new MarkupToPDF.Controls.Parsing.LayerControl();
28 787a4489 KangIngu
29 ccf944bb ljiyeon
        //임시파일
30
        TempFile temp = new TempFile();
31 787a4489 KangIngu
        /// <summary>
32
        /// TaskBar에 메시지를 입력합니다
33
        /// </summary>
34
        /// <param name="message"></param>
35
        /// <param name="type"></param>
36
        public void TaskMessage(string message, TaskMessageType type)
37
        {
38
            //if (taskBar != null)
39
            //{
40
            //    string color = "";
41
            //    taskBar.Content = message;
42
            //    DicTaskMessage.TryGetValue(type, out color);
43
            //    taskBar.Foreground = new SolidColorBrush(StringToColorConverter.Parse(color));
44
            //}
45
        }
46
47
        /// <summary>
48
        /// Task Type명을 Key값으로 지정합니다
49
        /// </summary>
50
        public enum TaskMessageType
51
        {
52
            Normal,
53
            Caption,
54
            Error,
55
        }
56
57
        private void CheckShapeState()
58
        {
59
60
61
            if (cbHatchShape.IsChecked == true)
62
            {
63
                cbFillShape.IsChecked = false;
64
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch;
65
            }
66
            else if(cbFillShape.IsChecked == true)
67
            {
68
                cbHatchShape.IsChecked = false;
69
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill;
70
            }
71
            else
72
            {
73
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;
74
            }
75
        }
76
77
        //강인구 추가(Undo End)
78
        private void SetPaintEvent()
79
        {
80
            List<AdornerMember> AdonerList = GetAdornerItem();
81
82
            if (AdonerList.Count > 0)
83
            {
84
                Undo_data UndoData = new Undo_data()
85
                {
86
                    IsUndo = false,
87
                    Event = Event_Type.Option,
88
                    EventTime = DateTime.Now,
89
                    paint = ViewerDataModel.Instance.paintSet,
90
                    Markup_List = new List<Multi_Undo_data>()
91
                };
92
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
93
94
                foreach (AdornerMember InnerItem in AdonerList)
95
                {
96
                    multi_Undo_Data.PointSet = new List<Point>();
97
98
                    if ((InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl) != null)
99
                    {
100
                        (InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl).Paint = ViewerDataModel.Instance.paintSet;
101
                    }
102
103
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
104
                    UndoData.Markup_List.Add(multi_Undo_Data);
105
                    multi_Undo_Data = new Multi_Undo_data();
106
                }
107
108
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
109
                {
110 ccf944bb ljiyeon
                    ViewerDataModel.Instance.UndoDataList.Remove(i);                    
111 787a4489 KangIngu
                });
112
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
113 ccf944bb ljiyeon
                
114
115 787a4489 KangIngu
            }
116
117
        }
118
119
        private void SetHighlightEvent()
120
        {
121
            List<AdornerMember> AdonerList = GetAdornerItem();
122
123
            if (AdonerList.Count > 0)
124
            {
125
                foreach (AdornerMember InnerItem in AdonerList)
126
                {
127
                    switch (InnerItem.DrawingData.GetType().Name)
128
                    {
129
                        case ("TextControl"):
130
                            {
131
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape;
132
                            }
133
                            break;
134
                        case ("ArrowTextControl"):
135
                            {
136
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape;
137
                            }
138
                            break;
139
                    }
140
                }
141
            }
142
143
        }
144
145
        private void FillShapeEvent(object sender, RoutedEventArgs e)
146
        {
147
            #region 주석
148
            //if ((sender as CheckBox).IsChecked.Value)
149
            //{
150
            //    cbHatchShape.IsChecked = false;
151
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Fill.png", UriKind.Relative));
152
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Fill.png", UriKind.Relative));
153
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle_Fill.png", UriKind.Relative));
154
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon.png", UriKind.Relative));
155
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon.png", UriKind.Relative));
156
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_Fill.png", UriKind.Relative));
157
            //    TaskMessage("채우기 옵션이 적용되었습니다", TaskMessageType.Normal);
158
            //}
159
            //else
160
            //{
161
162
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative));
163
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative));
164
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative));
165
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative));
166
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative));
167
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative));
168
            //    TaskMessage("채우기 옵션이 해제되었습니다", TaskMessageType.Caption);
169
            //}
170
            #endregion
171
            ViewerDataModel.Instance.checkFillShape = (sender as CheckBox).IsChecked.Value;
172
173
            if (ViewerDataModel.Instance.checkFillShape)
174
            {
175
                cbHatchShape.IsChecked = false;
176
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill;
177
            }
178
            else
179
            {
180
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;
181
            }
182
            SetPaintEvent();
183
        }
184
185
        /// <summary>
186
        /// 도형 빗금 처리
187
        /// </summary>
188
        /// <param name="sender"></param>
189
        /// <param name="e"></param>
190
        private void HatchShapeEvent(object sender, RoutedEventArgs e)
191
        {
192
			#region 주석
193
            //if ((sender as CheckBox).IsChecked.Value)
194
            //{
195
            //    cbFillShape.IsChecked = false;
196
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Hatch.png", UriKind.Relative));
197
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Hatch.png", UriKind.Relative));
198
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/rectangle-icon_Hatch.png", UriKind.Relative));
199
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_Hatch.png", UriKind.Relative));
200
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_Hatch.png", UriKind.Relative));
201
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_hatch.png", UriKind.Relative));
202
            //    TaskMessage("무늬 옵션이 적용되었습니다", TaskMessageType.Normal);
203
            //}
204
            //else
205
            //{
206
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative));
207
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative));
208
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative));
209
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative));
210
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative));
211
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative));
212
            //    TaskMessage("무늬 옵션이 해제되었습니다", TaskMessageType.Caption);
213
            //} 
214
            #endregion
215
216
            //강인구 추가
217
            ViewerDataModel.Instance.checkHatchShape = (sender as CheckBox).IsChecked.Value;
218
            if (ViewerDataModel.Instance.checkHatchShape)
219
            {
220
                cbFillShape.IsChecked = false;
221
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch;
222
            }
223
            else
224
            {
225
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;  
226
            }
227
            SetPaintEvent();
228
        }
229
230
 		//강인구 추가
231
        private string SetColor(string ID)
232
        {
233
            try
234
            {
235
                return ViewerDataModel.Instance._markupInfoList.Where(info => info.MarkupInfoID == ID).First().DisplayColor;
236
            }
237
            catch (Exception)
238
            {
239
                return "#FFFFFF";
240
            }
241
        }
242
243
        void SaveTimer_Tick(object sender, EventArgs e)
244
        {
245
            //if (this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode != IKCOM.MouseHandlingMode.Drawing)
246
            if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl == null && this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count == 0)
247
            {
248
                SaveEvent(null, null);
249
            }
250
251
        }
252
253
        private void SaveTime(bool IsRun)
254
        {
255
            if(SaveTimer == null)
256
            {
257
                SaveTimer = new System.Windows.Threading.DispatcherTimer();
258
                SaveTimer.Interval = new TimeSpan(0, 0, 5);
259
                SaveTimer.Tick += new EventHandler(SaveTimer_Tick);
260
            }
261
262
            if (IsRun)
263
            {
264
                SaveTimer.Start();
265
            }
266
            else
267
            {
268
                SaveTimer.Stop();
269
            }
270
        }
271 537f4cd8 djkim
        private void SaveTime(bool IsRun,int timeinterval)
272
        {
273
            if (SaveTimer == null)
274
            {
275
                SaveTimer = new System.Windows.Threading.DispatcherTimer();
276
                SaveTimer.Interval = new TimeSpan(0, timeinterval, 0);
277
                SaveTimer.Tick += new EventHandler(SaveTimer_Tick);
278
            }
279
            else
280
            {
281
                SaveTimer.Stop();
282
                SaveTimer.Interval = new TimeSpan(0, timeinterval, 0);
283
            }
284 787a4489 KangIngu
285 537f4cd8 djkim
            if (IsRun)
286
            {
287
                SaveTimer.Start();
288
            }
289
            else
290
            {
291
                SaveTimer.Stop();
292
            }
293
        }
294 532d83ef humkyung
        /// <summary>
295
        /// enable busy indicator and then call _SaveEvent method.
296
        /// </summary>
297
        /// <param name="sender"></param>
298
        /// <param name="e"></param>
299 787a4489 KangIngu
        public void SaveEvent(object sender, RoutedEventArgs e)
300
        {
301 23a96932 djkim
            this.ParentOfType<MainWindow>().dzMainMenu.EmptyControlCheck();
302
303 532d83ef humkyung
            if (this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy == true) return;
304 787a4489 KangIngu
305 532d83ef humkyung
            this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = true;
306 787a4489 KangIngu
307 532d83ef humkyung
            System.Threading.Tasks.Task SaveTask = System.Threading.Tasks.Task.Factory.StartNew(() =>
308
            {
309
                Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action<object, RoutedEventArgs>(_SaveEvent), sender, e);
310
            }).ContinueWith(task =>
311
            {
312
                Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate () { this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = false; }));
313
            });
314
        }
315 787a4489 KangIngu
316 532d83ef humkyung
        /// <summary>
317
        /// save document
318
        /// </summary>
319
        /// <param name="sender"></param>
320
        /// <param name="e"></param>
321
        public void _SaveEvent(object sender, RoutedEventArgs e)
322
        {
323
            try
324 787a4489 KangIngu
            {
325 532d83ef humkyung
                this.ParentOfType<MainWindow>().dzMainMenu.ReleaseAdorner();
326 787a4489 KangIngu
327 532d83ef humkyung
                this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
328 787a4489 KangIngu
329 532d83ef humkyung
                var menu = this.ParentOfType<MainWindow>().dzMainMenu;
330
331
                //콘솔리 데잇일 경우 
332
                //if (ViewerDataModel.Instance.IsConsolidate && menu.gridViewMarkup.SelectedItems.Count > 1)
333 7b312426 KangIngu
                //if (ViewerDataModel.Instance.IsConsolidate)
334
                //{
335
                //    ViewerDataModel.Instance.IsConsolidate = false;
336
                //    return;
337
                //}
338 532d83ef humkyung
339
                //코멘트가 없을 경우
340
                //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0)
341
                //{
342
                //    foreach (var item in menu.gridViewMarkup.SelectedItems)
343
                //    {
344
                //        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
345
                //        {
346
                //            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
347
                //            return;
348
                //        }
349
                //    }
350
                //}
351
352
                //코멘트가 없을 경우
353
                if (ViewerDataModel.Instance.MarkupList_USER.Count == 0)
354
                {
355
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
356 787a4489 KangIngu
                    {
357 532d83ef humkyung
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
358
                        {
359
                            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
360
                            return;
361
                        }
362 787a4489 KangIngu
                    }
363
                }
364
365 ccf944bb ljiyeon
                if (ViewerDataModel.Instance.MarkupList_USER.Count > 0)
366
                {
367
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
368
                    {
369
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
370
                        {
371
                            /*
372
                            if (menu.UndoData.Markup_List[0].Markup..GetType().Name == "TextControl" && ((MarkupToPDF.Controls.Text.TextControl)(item as IKCOM.MarkupInfoItem).MarkupList[0].).OverViewText == null)
373
                            {
374
                            }
375 787a4489 KangIngu
376 ccf944bb ljiyeon
                            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
377
                            return;*/
378
                        }
379
                    }
380
                }
381
                
382
383
                    //코멘트가 없을 경우
384
                    //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0)
385
                    //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0 && menu.gridViewMarkup.SelectedItems.Count == 0)
386
                    //{
387
                    //    foreach (var item in menu.gridViewMarkup.SelectedItems)
388
                    //    {
389
                    //        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
390
                    //        {
391
                    //            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
392
                    //            return;
393
                    //        }
394
                    //    }
395
                    //}
396
397
                    menu.ChangeCommentReact();
398 787a4489 KangIngu
399 532d83ef humkyung
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
400
                {
401
                    RefactoryCommentReact(menu);
402
                }
403
                else if (menu.gridViewMarkup.SelectedItems.Count == 0)
404 787a4489 KangIngu
                {
405 532d83ef humkyung
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
406
                    return;
407
                }
408
                //else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as  IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
409
                //{
410
                //    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
411
                //    return;
412
                //}
413 6707a5c7 ljiyeon
                // 변경
414 532d83ef humkyung
                else
415
                {
416
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
417 787a4489 KangIngu
                    {
418 532d83ef humkyung
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
419
                        {
420
                            RefactoryCommentReact(menu);
421
                            ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now;
422 992a98b4 KangIngu
423 7b312426 KangIngu
                            if (ViewerDataModel.Instance.IsConsolidate)
424
                            {
425
                                return;
426
                            }
427 532d83ef humkyung
                            menu.gridViewMarkup.ItemsSource = null;
428
                            menu.gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList;
429
                            menu.gridViewMarkup.SelectedItem = item;
430 992a98b4 KangIngu
431 532d83ef humkyung
                            if (sender != null)
432
                            {
433 4c8bb207 djkim
                                if (ViewerDataModel.Instance.IsPressCtrl)
434
                                {
435
                                    ViewerDataModel.Instance.IsPressCtrl = false;
436
                                }
437 532d83ef humkyung
                                this.ParentOfType<MainWindow>().DialogMessage_Alert("Save 가 완료되었습니다.", "Alert");
438
                            }
439
                            return;
440 316d0f5c KangIngu
                        }
441 787a4489 KangIngu
                    }
442 532d83ef humkyung
                    ////강인구 변경
443
                    //this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
444
                }
445
                if (sender != null)
446
                {
447 4c8bb207 djkim
                    if (ViewerDataModel.Instance.IsPressCtrl)
448
                    {
449
                        ViewerDataModel.Instance.IsPressCtrl = false;
450
                    }
451 532d83ef humkyung
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Save 가 완료되었습니다.", "Alert");
452 787a4489 KangIngu
                }
453
            }
454 532d83ef humkyung
            finally
455 316d0f5c KangIngu
            {
456
            }
457 787a4489 KangIngu
        }
458
459
		public void RefactoryCommentReact(MainMenu menu)
460
        {
461
            this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
462
463
            Save save = new Save();
464
465 6707a5c7 ljiyeon
            //추가
466 787a4489 KangIngu
            List<IKCOM.MarkupInfoItem> MySelectItem = new List<IKCOM.MarkupInfoItem>();
467
468
            foreach(var item in menu.gridViewMarkup.SelectedItems)
469
            {
470
                if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
471
                {
472
                    MySelectItem.Add(item as IKCOM.MarkupInfoItem);
473
                }
474
            }
475
476
            //MySelectItem = (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
477
478
479
            save.Project_No = App.ViewInfo.ProjectNO;
480
            save.document_id = App.ViewInfo.DocumentItemID;
481
            save.user_id = App.ViewInfo.UserID;
482
            save.page_no = Convert.ToInt32(tlcurrentPage.Text);
483
484
            try
485
            {
486
                menu.ChangeCommentReact();
487
                if (menu.PreviewUserMarkupInfoItem != null) //신규 코멘트인지(MarkupInfo가 없는 경우)
488
                {
489
                    if (menu.gridViewMarkup.SelectedItems.FirstOrDefault() != null) //복수 페이지 혹은 저장한 경우
490
                    {
491
                        foreach(var item in MySelectItem)
492
                        {
493
                            save.MarkupSave(item);
494
                        }
495
                        //save.MarkupSave(menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
496
                    }
497
                    else  //단일 페이지인 경우
498
                    {
499
                        //menu.ChangeCommentReact();
500
                        foreach (var item in MySelectItem)
501
                        {
502
                            save.MarkupSave(item);
503
                        }
504
                        //save.MarkupSave(menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
505
                    }
506
                }
507
                else //기존 코멘트에 작업하는 경우
508
                {
509
                    if (menu.gridViewMarkup.SelectedItems.FirstOrDefault() != null)
510
                    {
511
                        foreach (var item in MySelectItem)
512
                        {
513
                            save.MarkupSave(item);
514
                        }
515
                        //save.MarkupSave(menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
516
                    }
517
                }
518 2b19f5f2 djkim
                save.PageAngleSave(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.RotationDocs);
519
520 787a4489 KangIngu
            }
521
            catch (Exception ex)
522
            {
523
                this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("세이브 실패", "Alert");
524
            }
525
        }
526
527
        //강인구 추가
528
        public void Print_Start(string Type)
529
        {
530 4c8bb207 djkim
            if (ViewerDataModel.Instance.IsPressCtrl)
531
            {
532
                ViewerDataModel.Instance.IsPressCtrl = false;
533
            }
534
            if (ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
535 787a4489 KangIngu
            {
536
                var menu = this.ParentOfType<MainWindow>().dzMainMenu;
537
                menu.ReleaseAdorner();
538
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
539
                {
540
                    RefactoryCommentReact(menu);
541
                }
542
                else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
543
                {
544
545
                }
546
                else
547
                {
548
                    RefactoryCommentReact(menu);
549
                }
550
            }
551
552
            bool isprint = false;
553
            if (Type == "Print")
554
            {
555
                isprint = true;
556
            }
557
558
            RadWindow PrintWindow = new RadWindow();
559
            IKCOM.MarkupInfoItem _result = null;
560
            PrintWindow.Width = 850;
561
            PrintWindow.Height = 600;
562
            //PrintWindow.Width = 650;
563
            //PrintWindow.Height = 550;
564
            PrintWindow.Header = Type;
565
566
            List<IKCOM.MarkupInfoItem> markupinfo = new List<IKCOM.MarkupInfoItem>();
567 6c781c0c djkim
            markupinfo = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetPrintDocItemList(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID, ViewerDataModel.Instance._markupInfoList.ToList());
568
569
            var Tile_Url = string.Format(@"{0}/TileSource/{1}_Tile/{2}/{3}/",
570
                App.SystemInfo.HostName,
571
                App.ViewInfo.ProjectNO,
572
                (Convert.ToInt64(App.ViewInfo.DocumentItemID) / 100).ToString(),
573
                App.ViewInfo.DocumentItemID
574
                );
575
576
            PrintWindow.Content = new KCOM.Control.PrintControl(
577
                      Tile_Url,
578
                      App.ViewInfo.ProjectNO,
579
                      this.ParentOfType<MainWindow>().dzMainMenu._DocInfo, markupinfo,
580
                      this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber,
581
                      App.ViewInfo.DocumentItemID,
582
                      this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO,
583
                      this.ParentOfType<MainWindow>().dzMainMenu._DocItem.ORIGINAL_FILE, isprint);
584 787a4489 KangIngu
585
            //프린트 팝업 옵션
586
            //PrintWindow.BorderThickness = new Thickness(3);
587
            //PrintWindow.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 37, 160, 218));
588
            PrintWindow.ResizeMode = System.Windows.ResizeMode.NoResize;
589
            PrintWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
590
            PrintWindow.Background = new SolidColorBrush(Colors.Black);
591
            PrintWindow.Background.Opacity = 0.6;
592
593
            Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.VisualStudio2013Theme());
594
            PrintWindow.ShowDialog();
595
        }
596
597
        //강인구 추가
598
        private void PrintEvent(object sender, RoutedEventArgs e)
599
        {
600
            RadRibbonButton button = sender as RadRibbonButton;
601
            Print_Start(button.Content.ToString());
602
        }
603
604
        private List<AdornerMember> GetAdornerItem()
605
        {
606
            List<AdornerMember> AdonerList = new List<AdornerMember>();
607
608
            if (this.ParentOfType<MainWindow>() != null)
609
            {
610
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
611
                {
612
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
613
                    {
614
                        if (item.GetType().Name == "AdornerFinal")
615
                        {
616
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
617
                            {
618
                                AdonerList.Add(InnerItem);
619
                            }
620
                        }
621
                    }
622
                }
623
            }
624
            return AdonerList;
625
        }
626
        /// <summary>
627
        /// 투명도
628
        /// </summary>
629
        /// <param name="sender"></param>
630
        /// <param name="e"></param>
631
        //강인구 추가(Undo End)
632
        private void sdOpacity_ValueChanged(object sender, RoutedEventArgs e)
633
        {
634
            List<AdornerMember> AdonerList = GetAdornerItem();
635
            if(AdonerList.Count > 0)
636
            {
637
                Undo_data UndoData = new Undo_data()
638
                {
639
                    IsUndo = false,
640
                    Event = Event_Type.Option,
641
                    EventTime = DateTime.Now,
642
                    Opacity = ViewerDataModel.Instance.ControlOpacity,
643
                    Markup_List = new List<Multi_Undo_data>()
644
                };
645
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
646
647
                foreach (AdornerMember InnerItem in AdonerList)
648
                {
649
                    InnerItem.DrawingData.Opacity = ViewerDataModel.Instance.ControlOpacity;
650
                  
651
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
652
                    UndoData.Markup_List.Add(multi_Undo_Data);
653
                    multi_Undo_Data = new Multi_Undo_data();
654
                }
655
656
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
657
                {
658
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
659
                });
660
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
661
            }
662
        }
663
664
        //강인구 추가(Undo End)
665
        private void cbLineSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
666
        {
667 be04d12c djkim
            if (string.IsNullOrEmpty(cbLineSize.Value.ToString()))
668
            {
669
                cbLineSize.Value = cbLineSize.Minimum;
670
            }
671 787a4489 KangIngu
            List<AdornerMember> AdonerList = GetAdornerItem();
672
            if (AdonerList.Count > 0)
673
            {
674
                Undo_data UndoData = new Undo_data()
675
                {
676
                    IsUndo = false,
677
                    Event = Event_Type.Option,
678
                    EventTime = DateTime.Now,
679
                    LineSize = ViewerDataModel.Instance.LineSize,
680
                    Markup_List = new List<Multi_Undo_data>()
681
                };
682
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
683
684
                foreach (AdornerMember InnerItem in AdonerList)
685
                {
686
                    switch (InnerItem.DrawingData.GetType().Name)
687
                    {
688
                        case ("LineControl"):
689
                            {
690
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).LineSize = ViewerDataModel.Instance.LineSize;
691
                            }
692
                            break;
693
                        case ("ArcControl"):
694
                            {
695
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).LineSize = ViewerDataModel.Instance.LineSize;
696
                            }
697
                            break;
698
                        case ("ArrowControl_Multi"):
699
                            {
700
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).LineSize = ViewerDataModel.Instance.LineSize;
701
                            }
702
                            break;
703
                        case ("CloudControl"):
704
                            {
705
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).LineSize = ViewerDataModel.Instance.LineSize;
706
                            }
707
                            break;
708
                        case ("PolygonControl"):
709
                            {
710
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).LineSize = ViewerDataModel.Instance.LineSize;
711
                            }
712
                            break;
713
                        case ("RectangleControl"):
714
                            {
715
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).LineSize = ViewerDataModel.Instance.LineSize;
716
                            }
717
                            break;
718
                        case ("RectCloudControl"):
719
                            {
720
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).LineSize = ViewerDataModel.Instance.LineSize;
721
                            }
722
                            break;
723
                        case ("TriControl"):
724
                            {
725
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).LineSize = ViewerDataModel.Instance.LineSize;
726
                            }
727
                            break;
728
                        case ("CircleControl"):
729
                            {
730
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).LineSize = ViewerDataModel.Instance.LineSize;
731
                            }
732
                            break;
733
                    }
734
                    
735
736
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
737
                    UndoData.Markup_List.Add(multi_Undo_Data);
738
                    multi_Undo_Data = new Multi_Undo_data();
739
                }
740
741
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
742
                {
743
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
744
                });
745
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
746 5822e146 ljiyeon
747
                
748 787a4489 KangIngu
            }
749 5822e146 ljiyeon
            KCOM.Properties.Settings.Default.LineSize = (double)cbLineSize.Value;
750
            Properties.Settings.Default.Save();
751 787a4489 KangIngu
        }
752
753 5ce56a3a KangIngu
754
        private void cbIntervalSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
755
        {
756 be04d12c djkim
            if (string.IsNullOrEmpty(cbIntervalSize.Value.ToString()))
757
            {
758
                cbIntervalSize.Value = cbIntervalSize.Minimum;
759
            }
760 5ce56a3a KangIngu
            List<AdornerMember> AdonerList = GetAdornerItem();
761
            if (AdonerList.Count > 0)
762
            {
763
764
                Undo_data UndoData = new Undo_data()
765
                {
766
                    IsUndo = false,
767
                    Event = Event_Type.Option,
768
                    EventTime = DateTime.Now,
769
                    Interval = ViewerDataModel.Instance.Interval,
770
                    Markup_List = new List<Multi_Undo_data>()
771
                };
772
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
773
774
                foreach (AdornerMember InnerItem in AdonerList)
775
                {
776
                    switch (InnerItem.DrawingData.GetType().Name)
777
                    {
778
                        case ("LineControl"):
779
                            {
780
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).Interval = ViewerDataModel.Instance.Interval;
781
782
                                multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
783
                                UndoData.Markup_List.Add(multi_Undo_Data);
784
                                multi_Undo_Data = new Multi_Undo_data();
785
                            }
786
                            break;
787
                    }
788
                }
789
790
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
791
                {
792
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
793
                });
794
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
795
            }
796 5822e146 ljiyeon
            KCOM.Properties.Settings.Default.Interval = (double)cbIntervalSize.Value;
797
            Properties.Settings.Default.Save();
798 5ce56a3a KangIngu
        }
799 537f4cd8 djkim
        
800 9f473fb7 KangIngu
        private void cbArcLength_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
801
        {
802 be04d12c djkim
            if (string.IsNullOrEmpty(cbArcLength.Value.ToString()))
803
            {
804
                cbArcLength.Value = cbArcLength.Minimum;
805
            }
806 9f473fb7 KangIngu
            List<AdornerMember> AdonerList = GetAdornerItem();
807
            if (AdonerList.Count > 0)
808
            {
809
810
                //Undo_data UndoData = new Undo_data()
811
                //{
812
                //    IsUndo = false,
813
                //    Event = Event_Type.Option,
814
                //    EventTime = DateTime.Now,
815
                //    Interval = ViewerDataModel.Instance.Interval,
816
                //    Markup_List = new List<Multi_Undo_data>()
817
                //};
818
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
819
820
                foreach (AdornerMember InnerItem in AdonerList)
821
                {
822
                    switch (InnerItem.DrawingData.GetType().Name)
823
                    {
824
                        case ("RectCloudControl"):
825
                            {
826
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).ArcLength = ViewerDataModel.Instance.ArcLength;
827
828
                                //multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
829
                                //UndoData.Markup_List.Add(multi_Undo_Data);
830
                                //multi_Undo_Data = new Multi_Undo_data();
831
                            }
832
                            break;
833
                        case ("CloudControl"):
834
                            {
835
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).ArcLength = ViewerDataModel.Instance.ArcLength;
836
837
                                //multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
838
                                //UndoData.Markup_List.Add(multi_Undo_Data);
839
                                //multi_Undo_Data = new Multi_Undo_data();
840
                            }
841
                            break;
842
                    }
843
                }
844
845
                //ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
846
                //{
847
                //    ViewerDataModel.Instance.UndoDataList.Remove(i);
848
                //});
849
                //ViewerDataModel.Instance.UndoDataList.Add(UndoData);
850
            }
851 5822e146 ljiyeon
852
            KCOM.Properties.Settings.Default.ArcLength = (double)cbArcLength.Value;
853
            Properties.Settings.Default.Save();
854 9f473fb7 KangIngu
        }
855
856 787a4489 KangIngu
        //강인구 추가(Undo End)
857
        private void cbDashStyle_SelectionChanged(object sender, SelectionChangedEventArgs e)
858
        {
859
            //강인구 추가
860
            if (this.ParentOfType<MainWindow>() != null)
861
            {
862
                ViewerDataModel.Instance.DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
863
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
864
                {
865
                    Undo_data UndoData = new Undo_data()
866
                    {
867
                        IsUndo = false,
868
                        Event = Event_Type.Option,
869
                        EventTime = DateTime.Now,
870
                        DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData,
871
                        Markup_List = new List<Multi_Undo_data>()
872
                    };
873
                    Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
874
875
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
876
                    {
877
                        if (item.GetType().Name == "AdornerFinal")
878
                        {
879
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
880
                            {
881
                                switch (InnerItem.DrawingData.GetType().Name)
882
                                {
883
                                    case ("LineControl"):
884
                                        {
885
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
886
                                        }
887
                                        break;
888
                                    case ("ArcControl"):
889
                                        {
890
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
891
                                        }
892
                                        break;
893
                                    case ("ArrowControl_Multi"):
894
                                        {
895
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
896
                                        }
897
                                        break;
898
                                    case ("CloudControl"):
899
                                        {
900
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
901
                                        }
902
                                        break;
903
                                    case ("PolygonControl"):
904
                                        {
905
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
906
                                        }
907
                                        break;
908
                                    case ("RectangleControl"):
909
                                        {
910
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
911
                                        }
912
                                        break;
913
                                    case ("RectCloudControl"):
914
                                        {
915
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
916
                                        }
917
                                        break;
918
                                    case ("TriControl"):
919
                                        {
920
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
921
                                        }
922
                                        break;
923
                                    case ("CircleControl"):
924
                                        {
925
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
926
                                        }
927
                                        break;
928
                                }
929
930
                                multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
931
                                UndoData.Markup_List.Add(multi_Undo_Data);
932
                                multi_Undo_Data = new Multi_Undo_data();
933
                            }
934
935
                            ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
936
                            {
937
                                ViewerDataModel.Instance.UndoDataList.Remove(i);
938
                            });
939
                            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
940
                        }
941
                    }
942
                }
943
            }
944
        }
945
946
        //강인구 추가
947
        private void comboFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
948
        {
949 d4b0c723 KangIngu
            //if (this.ParentOfType<MainWindow>() != null)
950
            //{
951
            //    if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
952
            //    {
953
            //        foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
954
            //        {
955
            //            if (item.GetType().Name == "AdornerFinal")
956
            //            {
957
            //                foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
958
            //                {
959
            //                    switch (InnerItem.DrawingData.GetType().Name)
960
            //                    {
961
            //                        case ("TextControl"):
962
            //                            {
963
            //                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Text);
964
            //                            }
965
            //                            break;
966
            //                        case ("ArrowTextControl"):
967
            //                            {
968
            //                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Text);
969
            //                            }
970
            //                            break;
971
            //                    }
972
            //                }
973
            //            }
974
            //        }
975
            //    }
976
            //}
977 787a4489 KangIngu
        }
978
979
        //강인구 추가
980
        private void btnBold_Checked(object sender, RoutedEventArgs e)
981
        {
982
            if (this.ParentOfType<MainWindow>() != null)
983
            {
984
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
985
                {
986
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
987
                    {
988
                        if (item.GetType().Name == "AdornerFinal")
989
                        {
990
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
991
                            {
992
                                switch (InnerItem.DrawingData.GetType().Name)
993
                                {
994
                                    case ("TextControl"):
995
                                        {
996 d4b0c723 KangIngu
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight == FontWeights.Bold)
997 787a4489 KangIngu
                                            {
998
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Normal;
999
                                            }
1000
                                            else
1001
                                            {
1002 d4b0c723 KangIngu
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Bold;
1003 787a4489 KangIngu
                                            }
1004
1005
                                        }
1006
                                        break;
1007
                                    case ("ArrowTextControl"):
1008
                                        {
1009 d4b0c723 KangIngu
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight == FontWeights.Bold)
1010 787a4489 KangIngu
                                            {
1011
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Normal;
1012
                                            }
1013
                                            else
1014
                                            {
1015 d4b0c723 KangIngu
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Bold;
1016 787a4489 KangIngu
                                            }
1017
                                        }
1018
                                        break;
1019
                                }
1020
                            }
1021
                        }
1022
                    }
1023
                }
1024
            }
1025
        }
1026
1027
        //강인구 추가
1028
        private void btnItalic_Checked(object sender, RoutedEventArgs e)
1029
        {
1030
            if (this.ParentOfType<MainWindow>() != null)
1031
            {
1032
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1033
                {
1034
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1035
                    {
1036
                        if (item.GetType().Name == "AdornerFinal")
1037
                        {
1038
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1039
                            {
1040
                                switch (InnerItem.DrawingData.GetType().Name)
1041
                                {
1042
                                    case ("TextControl"):
1043
                                        {
1044
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle == FontStyles.Italic)
1045
                                            {
1046
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = System.Windows.FontStyles.Normal;
1047
                                            }
1048
                                            else
1049
                                            {
1050
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = FontStyles.Italic;
1051
                                            }
1052
1053
                                        }
1054
                                        break;
1055
                                    case ("ArrowTextControl"):
1056
                                        {
1057
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle == FontStyles.Italic)
1058
                                            {
1059
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Normal;
1060
                                            }
1061
                                            else
1062
                                            {
1063
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Italic;
1064
                                            }
1065
                                        }
1066
                                        break;
1067
                                }
1068
                            }
1069
                        }
1070
                    }
1071
                }
1072
            }
1073
        }
1074
1075
        //강인구 추가
1076
        private void btnUnderLine_Checked(object sender, RoutedEventArgs e)
1077
        {
1078
            if (this.ParentOfType<MainWindow>() != null)
1079
            {
1080
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1081
                {
1082
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1083
                    {
1084
                        if (item.GetType().Name == "AdornerFinal")
1085
                        {
1086
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1087
                            {
1088
                                switch (InnerItem.DrawingData.GetType().Name)
1089
                                {
1090
                                    case ("TextControl"):
1091
                                        {
1092
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine == TextDecorations.Underline)
1093
                                            {
1094
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = null;
1095
                                            }
1096
                                            else
1097
                                            {
1098
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
1099
                                            }
1100
                                        }
1101
                                        break;
1102
                                    case ("ArrowTextControl"):
1103
                                        {
1104
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
1105
                                            {
1106
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
1107
                                            }
1108
                                            else
1109
                                            {
1110
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
1111
                                            }
1112
                                        }
1113
                                        break;
1114
                                }
1115
                            }
1116
                        }
1117
                    }
1118
                }
1119
            }
1120
        }
1121 5ce56a3a KangIngu
1122
        private void AxisLockEvent(object sender, RoutedEventArgs e)
1123
        {
1124
            ViewerDataModel.Instance.checkAxis = cbAxisLock.IsChecked.Value;
1125
        }
1126
1127 d4b0c723 KangIngu
        private void comboFontSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
1128
        {
1129 be04d12c djkim
            if (string.IsNullOrEmpty(comboFontSize.Value.ToString()))
1130
            {
1131
                comboFontSize.Value = comboFontSize.Minimum;
1132
            }
1133 d4b0c723 KangIngu
            if (this.ParentOfType<MainWindow>() != null)
1134
            {
1135
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1136
                {
1137
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1138
                    {
1139
                        if (item.GetType().Name == "AdornerFinal")
1140
                        {
1141
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1142
                            {
1143
                                switch (InnerItem.DrawingData.GetType().Name)
1144
                                {
1145
                                    case ("TextControl"):
1146
                                        {
1147
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Value.ToString());
1148
                                        }
1149
                                        break;
1150
                                    case ("ArrowTextControl"):
1151
                                        {
1152
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Value.ToString());
1153
                                        }
1154
                                        break;
1155
                                }
1156
                            }
1157
                        }
1158
                    }
1159
                }
1160
            }
1161 5822e146 ljiyeon
            KCOM.Properties.Settings.Default.TextSize = (double)comboFontSize.Value;
1162
            Properties.Settings.Default.Save();
1163 d4b0c723 KangIngu
        }
1164
1165 787a4489 KangIngu
        //강인구 추가
1166
        private void RadRibbonComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
1167
        {
1168
            if (this.ParentOfType<MainWindow>() != null)
1169
            {
1170
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1171
                {
1172
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1173
                    {
1174
                        if (item.GetType().Name == "AdornerFinal")
1175
                        {
1176
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1177
                            {
1178
                                switch (InnerItem.DrawingData.GetType().Name)
1179
                                {
1180
                                    case ("TextControl"):
1181
                                        {
1182
                                            //if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily == TextDecorations.Underline)
1183
                                            //{
1184
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily = new FontFamily(comboFontFamily.Text);
1185
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBlock.FontFamily = new FontFamily(comboFontFamily.Text);
1186
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBox.FontFamily = new FontFamily(comboFontFamily.Text);
1187
                                            //}
1188
                                            //else
1189
                                            //{
1190
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
1191
                                            //}
1192
                                        }
1193
                                        break;
1194
                                    case ("ArrowTextControl"):
1195
                                        {
1196
                                            //if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
1197
                                            //{
1198
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
1199
                                            //}
1200
                                            //else
1201
                                            //{
1202
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
1203
                                            //}
1204
                                        }
1205
                                        break;
1206
                                }
1207
                            }
1208
                        }
1209
                    }
1210
                }
1211
            }
1212
        }
1213
1214
        /// <summary>
1215
        /// 텍스트 컨트롤 하일라이트 처리
1216
        /// </summary>
1217
        /// <param name="sender"></param>
1218
        /// <param name="e"></param>
1219
        private void HighlightEvent(object sender, RoutedEventArgs e)
1220
        {
1221
1222
            ViewerDataModel.Instance.checkHighShape = (sender as CheckBox).IsChecked.Value;
1223
            SetHighlightEvent();
1224
            //if ((sender as CheckBox).IsChecked.Value)
1225
            //{
1226
            //    TaskMessage("HighLight가 설정되었습니다", TaskMessageType.Normal);
1227
            //}
1228
            //else
1229
            //{
1230
            //    TaskMessage("HighLight가 해제되었습니다", TaskMessageType.Caption);
1231
            //}
1232
            //if (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl != null)
1233
            //{
1234
            //    MarkupToPDF.Controls.Text.TextControl instance = (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl);
1235
            //    instance.IsHighLight = ViewerDataModel.Instance.checkHighShape;
1236
            //    instance.SetText();
1237
            //}
1238
        }
1239
1240
        //강인구 추가페이지 이동 엔터
1241
        private void tlcurrentPage_KeyDown(object sender, KeyEventArgs e)
1242
        {
1243
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1244
            if (e.Key == Key.Enter)
1245
            {
1246
                try
1247
                {
1248
                    var instanceMain = this.ParentOfType<MainWindow>();
1249
                    instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text));
1250
                }
1251
                catch (Exception)
1252
                {
1253
                    RadWindow.Alert(new DialogParameters
1254
                    {
1255
                        Theme = new VisualStudio2013Theme(),
1256
                        Header = "안내",
1257
                        Content = "페이지 번호를 정확하게 입력해 주세요",
1258
                    });
1259
                }
1260
                
1261
            }
1262
        }
1263
1264
        public event EventHandler<WindowClosedEventArgs> Closed;
1265
1266
        //private void CheckEvent(object sender, RoutedEventArgs e)
1267
        //{
1268
        //    RadWindow CheckPop = new RadWindow();
1269
        //    test check = new test();
1270
1271
        //    CheckPop = new RadWindow
1272
        //    {
1273
        //        Width = 1700,
1274
        //        Height = 510,
1275
        //        Header = "My Check List",
1276
        //        Content = check,
1277
        //        Owner = this,
1278
        //        ResizeMode = System.Windows.ResizeMode.NoResize,
1279
        //        WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1280
        //    };
1281
        //    StyleManager.SetTheme(CheckPop, new VisualStudio2013Theme());
1282
1283
        //    CheckPop.Closed += CheckPop_Closed;
1284
        //    CheckPop.ShowDialog();
1285
        //}
1286
1287
        private void PanoramaEvent(object sender, RoutedEventArgs e)
1288
        {
1289
            PanoramaShow();
1290
        }
1291
1292
        public void PanoramaShow()
1293
        {
1294
            Panorama check = new Panorama();
1295
            double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
1296
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
1297
            //double windowWidth = this.Width;
1298
            //double windowHeight = this.Height;
1299
1300
            var PanoramaPop = new RadWindow
1301
            {
1302
                //MinWidth = 600,
1303
                //MinHeight = 400,
1304
                //Header = "My Check List",
1305
                Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1306
                Content = check,
1307
                Owner = this,
1308
                ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1309
                //ResizeMode = System.Windows.ResizeMode.NoResize,
1310
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1311
                IsTopmost = false,
1312
                //Left = (screenWidth / 2) - (windowWidth / 2),
1313
                //Top = (screenHeight / 2) - (windowHeight / 2),
1314
                //Left = (screenWidth / 2),
1315
                //Top = (screenHeight / 2),
1316
                Width = screenWidth * 0.4,
1317
                Height = screenHeight * 0.4,
1318
            };
1319
            StyleManager.SetTheme(PanoramaPop, new VisualStudio2013Theme());
1320
            //CheckPop.ShowDialog();
1321
            PanoramaPop.Show();
1322
        }
1323 d4b0c723 KangIngu
1324 787a4489 KangIngu
        private void CheckEvent(object sender, RoutedEventArgs e)
1325
        {
1326
            //창이 떠있을 경우 재 실행 방지
1327
            if (isClosed)
1328
            {
1329
                //토글 및 마우스 상태 초기화
1330
                var toggleList = this.Parent.ChildrenOfType<RadToggleButton>();
1331
                foreach(var togle in toggleList)
1332
                {
1333
                    togle.IsChecked = false;
1334
                }
1335
                this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1336
1337
                isClosed = false;
1338
1339
                
1340
                CheckList check = new CheckList();
1341
1342
                CheckPop = new RadWindow
1343
                {
1344
                    MinWidth = 1200,
1345
                    MinHeight = 500,
1346
                    //Header = "My Check List",
1347
                    Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1348
                    Content = check,
1349
                    //Owner = this,
1350
                    //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1351
                    ResizeMode = System.Windows.ResizeMode.NoResize,
1352
                    WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1353
                    IsTopmost = true,
1354
                };
1355
                StyleManager.SetTheme(CheckPop, new Office2013Theme());
1356
                CheckPop.Closed += CheckPop_Closed;
1357
                
1358
                //CheckPop.ShowDialog();
1359
                CheckPop.Show();
1360
            }
1361
        }
1362
1363
        private void CheckPop_Closed(object sender, WindowClosedEventArgs e)
1364
        {
1365
            isClosed = true;
1366
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
1367
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1368
            ViewerDataModel.Instance.Capture_Opacity = 0;
1369
        }
1370
1371 64f6713a humkyung
        /// <summary>
1372
        /// 사용자가 선택한 페이지로 이동(썸네일 동기화 시킴)
1373
        /// </summary>
1374
        /// <param name="sender"></param>
1375
        /// <param name="e"></param>
1376 787a4489 KangIngu
        private void PageGoEvent(object sender, RoutedEventArgs e)
1377
        {
1378
            RadButton button = sender as RadButton;
1379
            var instanceMain = this.ParentOfType<MainWindow>();
1380
            
1381
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1382
            try
1383
            {
1384
                switch (button.CommandParameter.ToString())
1385
                {
1386
                    case "Down":
1387
                        {
1388
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) + 1);
1389
                        }
1390
                        break;
1391
                    case "Up":
1392
                        {
1393
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) - 1);
1394
                        }
1395
                        break;
1396
                }
1397
            }
1398
            catch (Exception)
1399
            {
1400
                RadWindow.Alert(new DialogParameters
1401
                {
1402
                    Theme = new VisualStudio2013Theme(),
1403
                    Header = "안내",
1404
                    Content = "페이지 번호를 정확하게 입력해 주세요",
1405
                });
1406
            }
1407
        }
1408
1409
        private void viewEvent(object sender, RoutedEventArgs e)
1410
        {
1411 9f473fb7 KangIngu
            RadRibbonToggleButton viewButton = sender as RadRibbonToggleButton;
1412 787a4489 KangIngu
            var instanceMain = this.ParentOfType<MainWindow>();
1413
1414
            Point point = new Point(instanceMain.dzMainMenu.zoomAndPanCanvas.Width / 2, instanceMain.dzMainMenu.zoomAndPanCanvas.Height / 2);
1415
1416 9f473fb7 KangIngu
            //if ((sender as RadRibbonToggleButton) != null)
1417
            //{
1418
            //    Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString();
1419
            //    instanceToggle = (sender as RadRibbonToggleButton);
1420
            //}
1421
1422
            //instanceToggle.IsChecked = false;
1423
1424 787a4489 KangIngu
            switch (viewButton.CommandParameter.ToString())
1425
            {
1426
                case "zoomout":
1427
                    {
1428
                        //장원
1429
                        //instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(new Rect(0, 0, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualWidth, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualHeight));
1430
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale -= 0.1, point);
1431 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1432 787a4489 KangIngu
                        //Common.ViewerDataModel.Instance.zom
1433
                    }
1434
                    break;
1435
                case "zoomin":
1436
                    {
1437
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale += 0.1, point);
1438 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1439 787a4489 KangIngu
                    }
1440
                    break;
1441
                case "fullscreen":
1442
                    {
1443
                        instanceMain.WindowState = WindowState.Maximized;
1444
                        //Sizemode 대기(강인구)
1445
                        //instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit;
1446
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1447 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1448 787a4489 KangIngu
                    }
1449
                    break;
1450
                case "fitWidth":
1451
                    {
1452
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1453 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1454 787a4489 KangIngu
                    }
1455
                    break;
1456
                case "fitHeight":
1457
                    {
1458
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1459 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1460 787a4489 KangIngu
                    }
1461
                    break;
1462
                case "boundzoom":
1463
                    {
1464 9f473fb7 KangIngu
1465 787a4489 KangIngu
                    }
1466
                    break;
1467
                case "Rotate_M":
1468
                    {
1469
                        drawingPannelRotate(false);
1470 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1471 787a4489 KangIngu
                    }
1472
                    break;
1473
                case "Rotate_P":
1474
                    {
1475
                        drawingPannelRotate(true);
1476 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1477 787a4489 KangIngu
                    }
1478
                    break;
1479
                case "Rotate_half":
1480
                    {
1481
                        drawingPannelRotate(true);
1482
                        drawingPannelRotate(true);
1483 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1484 787a4489 KangIngu
                    }
1485
                    break;
1486
            }
1487
        }
1488
1489 d4b0c723 KangIngu
        private void Control_Event(object sender, RoutedEventArgs e)
1490
        {
1491
1492
        }
1493
1494 787a4489 KangIngu
        #region 대기
1495
1496
        public void drawingPannelRotate(bool Flag)
1497
        {
1498
            var instanceMain = this.ParentOfType<MainWindow>();
1499
1500
            //if (rotateOffSet > 3)
1501
            //    rotateOffSet = 0;
1502
1503
            //if (rotateOffSet < 0)
1504
            //    rotateOffSet = 3;
1505
1506
            if(Flag)
1507
            {
1508
                if (instanceMain.dzMainMenu.rotate.Angle == 270)
1509
                {
1510
                    instanceMain.dzMainMenu.rotate.Angle = 0;
1511
                }
1512
                else
1513
                {
1514
                    instanceMain.dzMainMenu.rotate.Angle += 90;
1515
                }
1516
            }
1517
            else
1518
            {
1519
                if(instanceMain.dzMainMenu.rotate.Angle == 0)
1520
                {
1521
                    instanceMain.dzMainMenu.rotate.Angle = 270;
1522
                }
1523
                else
1524
                {
1525
                    instanceMain.dzMainMenu.rotate.Angle -= 90;
1526
                }
1527
            }
1528
            //double angle = (double)rotateValue.GetValue(rotateOffSet);
1529
            //instanceMain.dzMainMenu.rotate.Angle = angle;
1530
            var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90));
1531
1532
            if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth)
1533
            {
1534
                double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1535
                instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1536
                instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize;
1537
            }
1538
            if (instanceMain.dzMainMenu.rotate.Angle == 0)
1539
            {
1540
                instanceMain.dzMainMenu.translate.X = 0;
1541
                instanceMain.dzMainMenu.translate.Y = 0;
1542
            }
1543
            else if (instanceMain.dzMainMenu.rotate.Angle == 90)
1544
            {
1545
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1546
                instanceMain.dzMainMenu.translate.Y = 0;
1547
            }
1548
            else if (instanceMain.dzMainMenu.rotate.Angle == 180)
1549
            {
1550
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1551
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1552
            }
1553
            else
1554
            {
1555
                instanceMain.dzMainMenu.translate.X = 0;
1556
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1557
            }
1558
1559
            //instanceMain.dzMainMenu.zoomAndPanControl.RenderTransformOrigin = new Point(0.5, 0.5);
1560
            instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle;
1561
            //대기(강인구)
1562
            //instanceMain.dzMainMenu.imageViewer.RotateAngle = instanceMain.dzMainMenu.rotate.Angle;
1563
1564
1565
            //instanceMain.dzMainMenu.imageViewer.RenderTransformOrigin = new Point(0.5, 0.5);
1566
            //RotateTransform rotateTransform = new RotateTransform(instanceMain.dzMainMenu.rotate.Angle);
1567
            //instanceMain.dzMainMenu.imageViewer.RenderTransform = rotateTransform;
1568
1569
1570
            ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1571
            ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1572
            ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X;
1573
            ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y;
1574
            ViewerDataModel.Instance.Angle = instanceMain.dzMainMenu.rotate.Angle;
1575
            //ViewerDataModel.Instance.Document_Info.Clear();
1576
            //ViewerDataModel.Instance.Document_Info.Where(i => i.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(value =>
1577
            //{
1578
            //    value.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1579
            //});
1580
1581
1582
            //이미지 각도 변경 시 실시간 Thumbnail 각도 변경(강인구 추가)
1583
            instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Where(info => info.PageNumber == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(data =>
1584
            {
1585
                data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1586
1587
                instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems;
1588
                var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault();
1589
                instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1590
1591
                instanceMain.dzMainMenu.pageNavigator.setPageChange(data);
1592 2b19f5f2 djkim
1593
                //rotation page add or update
1594
                var rotationdoc = ViewerDataModel.Instance.RotationDocs.Where(d => d.ID == instance.ID).FirstOrDefault();
1595
                if (rotationdoc != null)
1596
                {
1597
                    rotationdoc.PAGE_ANGLE = instance.PAGE_ANGLE;
1598
                }
1599
                else
1600
                {
1601
                    ViewerDataModel.Instance.RotationDocs.Add(instance);
1602
                }
1603 787a4489 KangIngu
            });
1604
        }
1605
        #endregion
1606
1607
        private void ImageConverter()
1608
        {
1609
            var instanceMain = this.ParentOfType<MainWindow>();
1610
            //http://cloud.devdoftech.co.kr:5977/ImageUpload/FileUpload.asmx
1611
1612
1613
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
1614
            dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png";
1615
            Nullable<bool> result = dlg.ShowDialog();
1616
            if (result == true)
1617
            {
1618
                instanceMain.dzMainMenu.filename = dlg.FileName;
1619
                instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1620
1621
                System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename);
1622
                String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename);
1623
                long numByte = fileInfo.Length;
1624
                double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
1625
                kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
1626
1627
                if (dLen < 4)
1628
                {
1629
                    System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
1630
                    System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
1631
                    byte[] data = br.ReadBytes((int)numByte);
1632
                    br.Close();
1633
1634
                    instanceMain.dzMainMenu.filename = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data);
1635
                    fStream.Close();
1636
                    fStream.Dispose();
1637
                }
1638
                else
1639
                {
1640
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert");
1641
                }
1642
            }
1643
        }
1644
1645 d4b0c723 KangIngu
        private void Control_Init(RadToggleButton instanceToggle, object sender)
1646
        {
1647
1648
        }
1649
1650 787a4489 KangIngu
        private void ControlEvent(object sender, RoutedEventArgs e)
1651
        {
1652
            RadToggleButton instanceToggle = sender as RadToggleButton;
1653
            var instanceMain = this.ParentOfType<MainWindow>();
1654
1655
            #region Ctrl + A 눌렀을 때 대처 방법 
1656
            //원인 : Ctrl + A를 누르면 UIElementSet에 등록을 시키지 않는다(이유는 한꺼번에 많은 양의 컨트롤의 동작이 유입되기 때문에
1657
            //       시스템의 성능저하를 불러올 수 있기 때문이다. 그래서 선택 후 다른 컨트롤을 누르면 등록되지 않은 컨트롤이기 때문에 삭제된다
1658
            //       이를 대처하는 방법으로 아래 코드를 사용한다.
1659
            if (Common.ViewerDataModel.Instance.MarkupControls.Count == 0 && Common.ViewerDataModel.Instance.MarkupControls.Count >= 1)
1660
            {
1661
                //var lstItem = instanceMain.DeepLayer._SelectLayer.ChildrenOfType<AdornerFinal>().ToList();
1662
                //foreach (var item in lstItem)
1663
                //{
1664
                //    foreach (var member in item.MemberSet)
1665
                //    {
1666
                //        if (!instanceMain.DeepLayer.UIElementSet.Contains(member.DrawingData))
1667
                //        {
1668
                //            instanceMain.DeepLayer.UIElementSet.Add(member.DrawingData);
1669
                //        }
1670
                //    }
1671
                //}
1672
            }
1673
            #endregion
1674
1675
            //if (!instanceMain.IsFreeSelectionMode)
1676
            //{
1677
            //    instanceMain.IsSwingMode = true;
1678
            //}
1679
1680 d4b0c723 KangIngu
            #region 다른 컨트롤 버튼 선택 해제
1681
            System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.SelectedControl).Subscribe(ControlState =>
1682
            {
1683
                if (ControlState == null)
1684
                {
1685
                    instanceToggle.IsChecked = false;
1686
                    HiddenControlHide();
1687
                }
1688
            });
1689
            #endregion
1690
1691 787a4489 KangIngu
            Release_ToggleButton(sender); //-> 해당 컨트롤을 제외한 모든 컨트롤에 대해 해제 처리
1692 d4b0c723 KangIngu
1693 787a4489 KangIngu
            if (instanceToggle != null)
1694
            {
1695
                Common.ViewerDataModel.Instance.ControlTag = instanceToggle.Tag.ToString();
1696
            }
1697
            else if ((sender as RadRibbonToggleButton) != null)
1698
            {
1699
                Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString();
1700
                instanceToggle = (sender as RadRibbonToggleButton);
1701
            }
1702
            else if ((sender as RadRibbonButton) != null)
1703
            {
1704
                RadRibbonButton instanceButton = sender as RadRibbonButton;
1705
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1706
            }
1707
            else
1708
            {
1709
                RadButton instanceButton = sender as RadButton;
1710
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1711
            }
1712
1713
1714
1715
            System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleVisibility).Subscribe(isSee =>
1716
            {
1717
                instanceMain.dzMainMenu.MainAngle.Visibility = isSee;
1718
                System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleValue).Subscribe(p =>
1719
                {
1720
                    instanceMain.dzMainMenu.MainAngle.AngleValue = p;
1721
                });
1722
            });
1723
            instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
1724
1725
            instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
1726
1727
            if (instanceToggle.IsChecked != false)
1728
            {
1729
                #region 컨트롤이 체크되었다면
1730
                switch (instanceToggle.CommandParameter.ToString())
1731
                {
1732
                    #region Line
1733
                    case "Line":
1734
                        Common.ViewerDataModel.Instance.SelectedControl = "Line";
1735
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1736
                        if (instanceToggle.Tag.ToString() == "LineDelete")
1737
                        {
1738
                            //HiddenInterval.Visibility = Visibility.Visible;
1739
                        }
1740
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.SingleLine;
1741
                        break;
1742
                    #endregion
1743
                    #region ChainLine
1744
                    case "ChainLine":
1745
                        Common.ViewerDataModel.Instance.SelectedControl = "ChainLine";
1746
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1747
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ChainLine;
1748
                        break;
1749
                    #endregion
1750
                    #region DimLine
1751
                    case "DimLine":
1752
                        Common.ViewerDataModel.Instance.SelectedControl = "DimLine";
1753
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1754
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.DimLine;
1755
                        break;
1756
                    #endregion
1757
                    #region TwinLine
1758
                    case "TwinLine":
1759
                        Common.ViewerDataModel.Instance.SelectedControl = "TwinLine";
1760
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1761
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TwinLine;
1762
                        break;
1763
                    #endregion
1764
                    #region CancelLine
1765
                    case "CancelLine":
1766
                        Common.ViewerDataModel.Instance.SelectedControl = "CancelLine";
1767
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1768
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.CancelLine;
1769
                        break;
1770
                    #endregion
1771
                    #region PolygonCloud
1772
                    case "PolygonCloud":
1773
                        Common.ViewerDataModel.Instance.SelectedControl = "PolygonCloud";
1774
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1775
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonCloud;
1776
                        break;
1777
                    #endregion
1778
                    #region RectCloud
1779
                    case "RectCloud":
1780
                        Common.ViewerDataModel.Instance.SelectedControl = "RectCloud";
1781
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1782
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.RectCloud;
1783
                        break;
1784
                    #endregion
1785 4318fdeb KangIngu
                    #region Rectangle
1786 787a4489 KangIngu
                    case "Rectangle":
1787
                        Common.ViewerDataModel.Instance.SelectedControl = "Rectangle";
1788
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1789
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Rectangle;
1790
                        break;
1791
                    #endregion
1792 4318fdeb KangIngu
                    #region Triangle
1793 787a4489 KangIngu
                    case "Triangle":
1794
                        Common.ViewerDataModel.Instance.SelectedControl = "Triangle";
1795
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1796
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Triangle;
1797
                        break;
1798
                    #endregion
1799
                    #region RectCloud
1800
                    case "Circle":
1801
                        Common.ViewerDataModel.Instance.SelectedControl = "Circle";
1802
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1803
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Circle;
1804
                        break;
1805
                    #endregion
1806
                    #region Symbol
1807
                    case "Symbol":
1808
                        Common.ViewerDataModel.Instance.SelectedControl = "Symbol";
1809
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1810
                        break;
1811
                    #endregion
1812
                    #region SymbolN
1813
                    case "SymbolN":
1814
                        Common.ViewerDataModel.Instance.SelectedControl = "SymbolN";
1815
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Stamp;
1816
                        break;
1817
                    #endregion
1818
                    #region Text
1819
                    case "Text":
1820
                        Common.ViewerDataModel.Instance.SelectedControl = "Text";
1821
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1822
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextControl;
1823
                        break;
1824
                    #endregion
1825
                    #region TextBorder
1826
                    case "TextBorder":
1827
                        Common.ViewerDataModel.Instance.SelectedControl = "TextBorder";
1828
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1829
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextBorder;
1830
                        break;
1831
                    #endregion
1832
                    #region TextCloud
1833
                    case "TextCloud":
1834
                        Common.ViewerDataModel.Instance.SelectedControl = "TextCloud";
1835
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1836
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextCloud;
1837
                        break;
1838
                    #endregion
1839
                    #region Date
1840
                    case "Date":
1841
                        Common.ViewerDataModel.Instance.SelectedControl = "Date";
1842
                        TaskMessage("날짜 컨트롤을 더블 클릭하면 날짜를 변경할 수 있습니다", TaskMessageType.Normal);
1843
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Date;
1844
                        break;
1845
                    #endregion
1846
                    #region ArrowText
1847
                    case "ArrowText":
1848
                        TaskMessage("ArrowText 컨트롤은 그린 후 컨트롤을 선택하였을 시 중간점을 조정할 수 있습니다", TaskMessageType.Normal);
1849
                        if (instanceToggle.Tag.ToString() == "ArrowText_Cloud")
1850
                        {
1851
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowText_Cloud";
1852
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl;
1853
                        }
1854
                        else if (instanceToggle.Tag.ToString() == "ArrowText_Border")
1855
                        {
1856
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTextBorderControl";
1857
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl;
1858
                        }
1859
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Normal")
1860
                        {
1861
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextControl";
1862
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl;
1863
                        }
1864
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Border")
1865
                        {
1866
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextBorderControl";
1867
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl;
1868
                        }
1869
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Cloud")
1870
                        {
1871
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextCloudControl";
1872
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl;
1873
                        }
1874
                        else
1875
                        {
1876
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowText";
1877
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextControl;
1878
                            //HiddenAxisLock.Visibility = Visibility.Visible;
1879
                        }
1880
                        break;
1881
                    #endregion
1882
                    #region Arrow
1883
                    case "Arrow":
1884
                        Common.ViewerDataModel.Instance.SelectedControl = "Arrow";
1885
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1886
                        //HiddenDimSize.Visibility = Visibility.Visible;
1887
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowLine;
1888
                        break;
1889
                    #endregion
1890
                    #region Shape
1891
                    case "Shape":
1892
                        Common.ViewerDataModel.Instance.SelectedControl = "Shape";
1893
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
1894
                        break;
1895
                    #endregion
1896
                    #region Polygon
1897
                    case "Polygon":
1898
                        Common.ViewerDataModel.Instance.SelectedControl = "Polygon";
1899
                        TaskMessage("자유형 코멘트 도구는 오른쪽 마우스 클릭을 통해 그리기를 마칠 수 있습니다", TaskMessageType.Normal);
1900
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1901
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonControl;
1902
                        break;
1903
                    #endregion
1904
                    #region Arc
1905
                    case "Arc":
1906
                        Common.ViewerDataModel.Instance.SelectedControl = "Arc";
1907
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcLine;
1908
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1909
                        TaskMessage("Arc 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal);
1910
                        break;
1911
                    #endregion
1912
                    #region ArrowMulti
1913
                    case "ArrowMulti":
1914
                        Common.ViewerDataModel.Instance.SelectedControl = "ArrowMulti";
1915
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowMultiLine;
1916
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1917
                        break;
1918
                    #endregion
1919
                    #region Etc
1920
                    case "Etc":
1921
                        Common.ViewerDataModel.Instance.SelectedControl = "Etc";
1922
                        break;
1923
                    #endregion
1924
                    #region Ink
1925
                    case "Ink":
1926
                        if (instanceToggle.Tag.ToString() == "EraserClear")
1927
                        {
1928
                            TaskMessage("해당 컨트롤은 점 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal);
1929
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
1930
                            instanceMain.dzMainMenu.inkBoard.Tag = "EraseByPoint";
1931
                        }
1932
                        else if (instanceToggle.Tag.ToString() == "Eraser")
1933
                        {
1934
                            TaskMessage("해당 컨트롤은 선 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal);
1935
                            instanceMain.dzMainMenu.inkBoard.Tag = "EraseByStroke";
1936
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
1937
                        }
1938
                        else
1939
                        {
1940
                            instanceMain.dzMainMenu.inkBoard.Tag = "Ink";
1941
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.Ink;
1942
                        }
1943
1944
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = true;
1945
1946
                        Common.ViewerDataModel.Instance.SelectedControl = "Ink";
1947
                        Common.ViewerDataModel.Instance.LineSize = (double)cbLineSize.Value;
1948
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PenControl;
1949
                        break;
1950
                    #endregion
1951
                    #region Select
1952
                    case "Select":
1953 65246dc9 KangIngu
                        if(this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
1954
                        {
1955
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
1956
                            this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
1957
                        }
1958 787a4489 KangIngu
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting;
1959
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1960 9f473fb7 KangIngu
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
1961 787a4489 KangIngu
                        break;
1962
                    #endregion
1963
                    #region Image
1964
                    case "Image":
1965
                        Common.ViewerDataModel.Instance.SelectedControl = "ImgControl";
1966
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1967
                        ImageConverter();
1968
                        break;
1969
                    #endregion
1970
                    #region Sign
1971
                    case "Sign":
1972
                        Common.ViewerDataModel.Instance.SelectedControl = "Sign";
1973
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
1974
                        //강인구 추가
1975
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Sign;
1976
                        //instanceMain.BaseClient.GetUserSignCompleted += (sen, ea) =>
1977
                        //{
1978
                        //    if (ea.Result == null)
1979
                        //    {
1980
1981
                        //        this.ParentOfType<MainPage>().DialogMessage_Alert("You Don't Have Sign Data", "Alert");
1982
                        //    }
1983
                        //    else
1984
                        //    {
1985
                        //        byte[] imageBytes = System.Convert.FromBase64String(ea.Result);
1986
                        //        using (MemoryStream ms = new MemoryStream(imageBytes))
1987
                        //        {
1988
                        //            BitmapImage im = new BitmapImage();
1989
                        //            im.SetSource(ms);
1990
                        //            instanceMain.DeepLayer.SignImage = im;
1991
                        //            ms.Close();
1992
                        //        }
1993
                        //    }
1994
                        //};
1995
                        //instanceMain.BaseClient.GetUserSignAsync(instanceMain._ViewInfo.UserID);
1996
                        break;
1997
                    #endregion
1998
                    #region Check
1999
                    case "Check":
2000
                        Common.ViewerDataModel.Instance.SelectedControl = "Check";
2001
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
2002
                        //강인구 추가
2003
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Symbol;
2004
                        break;
2005
                    #endregion
2006
                    #region Batch
2007
                    case "Batch":
2008
                        Common.ViewerDataModel.Instance.SelectedControl = "Batch";
2009
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
2010
                        //강인구 추가
2011
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
2012
                        instanceMain.dzMainMenu.txtBatch.Visibility = Visibility.Visible;
2013 999c9e40 humkyung
                        instanceMain.dzMainMenu.txtBatch.Text = "Place Mark";
2014 787a4489 KangIngu
                        break;
2015 d4b0c723 KangIngu
                    #endregion
2016
                    #region Copy
2017
                    case "Copy":
2018
                        Copy_Start();
2019
                        instanceToggle.IsChecked = false;
2020
                        ViewerDataModel.Instance.SelectedControl = "";
2021
                        ViewerDataModel.Instance.ControlTag = null;
2022
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2023
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2024
                        break;
2025
                    #endregion
2026
                    #region Cut
2027
                    case "Cut":
2028
                        Cut_Start();
2029
                        instanceToggle.IsChecked = false;
2030
                        ViewerDataModel.Instance.SelectedControl = "";
2031
                        ViewerDataModel.Instance.ControlTag = null;
2032
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2033
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2034
                        break;
2035
                    #endregion
2036
                    #region Paste
2037
                    case "Paste":
2038
                        Paste_Start();
2039
                        instanceToggle.IsChecked = false;
2040
                        ViewerDataModel.Instance.SelectedControl = "";
2041
                        ViewerDataModel.Instance.ControlTag = null;
2042
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2043 ccf944bb ljiyeon
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;                        
2044 d4b0c723 KangIngu
                        break;
2045
                    #endregion
2046
                    #region Delete
2047
                    case "Delete":
2048
                        Delete_Start();
2049
                        instanceToggle.IsChecked = false;
2050
                        ViewerDataModel.Instance.SelectedControl = "";
2051
                        ViewerDataModel.Instance.ControlTag = null;
2052
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2053
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2054
                        break;
2055
                    #endregion
2056
                    #region Undo
2057
                    case "Undo":
2058
                        this.ParentOfType<MainWindow>().dzMainMenu.Undo();
2059
                        instanceToggle.IsChecked = false;
2060
                        ViewerDataModel.Instance.SelectedControl = "";
2061
                        ViewerDataModel.Instance.ControlTag = null;
2062
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2063
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2064
                        break;
2065
                    #endregion
2066
                    #region Redo
2067
                    case "Redo":
2068
                        this.ParentOfType<MainWindow>().dzMainMenu.Redo();
2069
                        instanceToggle.IsChecked = false;
2070
                        ViewerDataModel.Instance.SelectedControl = "";
2071
                        ViewerDataModel.Instance.ControlTag = null;
2072
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2073
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2074 9f473fb7 KangIngu
                        break;
2075
                    #endregion
2076
                    #region DragZoom
2077
                    case "DragZoom":
2078
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.DragZoom;
2079
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2080
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2081
                        break;
2082 d4b0c723 KangIngu
                    #endregion
2083 9f473fb7 KangIngu
2084 787a4489 KangIngu
                    default:
2085
                        break;
2086
                }
2087
                #endregion
2088
            }
2089
            else
2090
            {
2091 992a98b4 KangIngu
2092 787a4489 KangIngu
                if (!instanceMain.dzMainMenu.IsFreeSelectionMode)
2093
                {
2094
                    instanceMain.dzMainMenu.IsSwingMode = false;
2095
                    Common.ViewerDataModel.Instance.SelectedControl = "";
2096
                    Common.ViewerDataModel.Instance.ControlTag = null;
2097
                    this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2098
                    this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2099
                }
2100
            }
2101
        }
2102
2103 537f4cd8 djkim
        private void cbAutoSave_Checked(object sender, RoutedEventArgs e)
2104 be04d12c djkim
        {            
2105
            if (cbAutoSave.IsChecked == true)
2106 537f4cd8 djkim
            {
2107
                SaveTime(true, (int)cbSaveInterval.Value);
2108
            }
2109
            else
2110
            {
2111
                SaveTime(false, (int)cbSaveInterval.Value);
2112
            }
2113
        }
2114
        private void cbSaveInterval_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
2115
        {
2116 be04d12c djkim
            if(string.IsNullOrEmpty(cbSaveInterval.Value.ToString()))
2117
            {
2118
                cbSaveInterval.Value = cbSaveInterval.Minimum;
2119
            }
2120 537f4cd8 djkim
            if (cbAutoSave.IsChecked == true)
2121
            {
2122
                SaveTime(true, (int)cbSaveInterval.Value);
2123 5822e146 ljiyeon
            }
2124
2125
            KCOM.Properties.Settings.Default.SaveInterval = (double)cbSaveInterval.Value;
2126
            Properties.Settings.Default.Save();
2127 537f4cd8 djkim
        }
2128 787a4489 KangIngu
        //강인구 자동 저장 추가
2129
        private void AutoSave(object sender, RoutedEventArgs e)
2130
        {
2131
            RadToggleButton instanceToggle = sender as RadToggleButton;
2132
2133
            if(instanceToggle.IsChecked == true)
2134
            {
2135
                SaveTime(true);
2136
            }
2137
            else
2138
            {
2139
                SaveTime(false);
2140
            }
2141
        }
2142
2143 d4b0c723 KangIngu
        public void Copy_Start()
2144
        {
2145
            if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2146
            {
2147
                string MarkupData = "";
2148
2149
                foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2150
                {
2151
                    if (item.GetType().Name == "AdornerFinal")
2152
                    {
2153
                        foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2154
2155
                        {
2156
                            if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2157
                            {
2158
                                markupReturn = layer.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID);
2159
                                MarkupData += "|OR|" + markupReturn.ConvertData;
2160
                            }
2161
                        }
2162
                        Clipboard.SetText(MarkupData);
2163
                    }
2164
                }
2165
            }
2166
        }
2167
2168
        public void Cut_Start()
2169
        {
2170
            if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2171
            {
2172
                foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2173
                {
2174
                    string MarkupData = "";
2175
2176
                    if (item.GetType().Name == "AdornerFinal")
2177
                    {
2178
                        foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2179
                        {
2180
                            if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2181
                            {
2182
                                markupReturn = layer.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID);
2183
                                MarkupData += "|OR|" + markupReturn.ConvertData;
2184
                            }
2185
                        }
2186 ccf944bb ljiyeon
                        //클립보드에 넣음
2187 d4b0c723 KangIngu
                        Clipboard.SetText(MarkupData);
2188
                    }
2189
                }
2190
                this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear();
2191
            }
2192
        }
2193
2194
        public void Paste_Start()
2195
        {
2196
            //마크업 붙여넣기
2197
            //if (Clipboard.GetText().Contains("|DZ|"))
2198
            if (Clipboard.GetText().Contains("|OR||DZ|"))
2199
            {
2200
                List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>();
2201
2202
                string[] delimiterChars = { "|OR|" };
2203
                string[] data = Clipboard.GetText().Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
2204
2205
                this.ParentOfType<MainWindow>().dzMainMenu.ReleaseAdorner();
2206
2207
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
2208
2209
                //강인구 Undo/Redo 보류
2210
                UndoData = new Undo_data()
2211
                {
2212
                    IsUndo = false,
2213
                    Event = Event_Type.Create,
2214
                    EventTime = DateTime.Now,
2215
                    Markup_List = new List<Multi_Undo_data>()
2216
                };
2217
2218
                ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i =>
2219
                {
2220
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
2221
                });
2222
2223
                foreach (string parse in data)
2224
                {
2225
                    if (parse != "")
2226
                    {
2227
                        System.Windows.Controls.Control item = layer.markupParse_Paste(parse, ViewerDataModel.Instance.MarkupControls_USER);
2228
                        (item as MarkupToPDF.Common.CommentUserInfo).CommentID = Events.Save.shortGuid();
2229
2230
                        ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo);
2231
                        ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo);
2232
2233
                        adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo);
2234
2235
                        //Controls.AdornerFinal final = new Controls.AdornerFinal(item as MarkupToPDF.Common.CommentUserInfo);
2236
                        //this.dzMainMenu.SelectLayer.Children.Add(final);
2237
2238
                        multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo);
2239
2240
                        UndoData.Markup_List.Add(multi_Undo_Data);
2241 6707a5c7 ljiyeon
                        ViewerDataModel.Instance.UndoDataList.Add(UndoData);                        
2242 d4b0c723 KangIngu
                    }
2243
                }
2244
                Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet);
2245
2246
                if(this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X < 0)
2247
                {
2248
                    Canvas.SetLeft(final, 0);
2249
                    Canvas.SetTop(final, 0);
2250
                }
2251
                else
2252
                {
2253
                    double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2);
2254
                    double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2);
2255
                    final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
2256
2257
                    if (final.MemberSet.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null)
2258
                    {
2259
                        final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(0.001, 0.001)); //dummy
2260
                    }
2261 6707a5c7 ljiyeon
2262 d4b0c723 KangIngu
                }
2263
                
2264
2265
                this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final);
2266
2267
                //붙여 넣을때 원본 컨트롤과 겹치지 않도록 설정
2268
                //Canvas.SetLeft(final, 50);
2269
                //Canvas.SetTop(final, 50);
2270
            }
2271
            //외부 이미지 붙여넣기
2272
            else if (Clipboard.GetImage() != null)
2273
            {
2274
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
2275
2276
                //강인구 Undo/Redo 보류
2277
                UndoData = new Undo_data()
2278
                {
2279
                    IsUndo = false,
2280
                    Event = Event_Type.Create,
2281
                    EventTime = DateTime.Now,
2282
                    Markup_List = new List<Multi_Undo_data>()
2283
                };
2284
2285
2286
                string temppath = System.IO.Path.GetTempPath();
2287
                //string filename = KCOM.Events.Save.shortCommentKey();
2288
                string filename = KCOM.Events.Save.shortFileKey();
2289
2290
                System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage();
2291
                clipboardImage.Save(temppath + "\\" + filename);
2292
2293
                System.IO.FileInfo fileInfo = new System.IO.FileInfo(temppath + "\\" + filename);
2294
                String strFile = System.IO.Path.GetFileName(fileInfo.FullName);
2295
                long numByte = fileInfo.Length;
2296
                double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
2297
                kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
2298
2299
                if (dLen < 4)
2300
                {
2301
                    System.IO.FileStream fStream = new System.IO.FileStream(fileInfo.FullName,
2302
                    System.IO.FileMode.Open, System.IO.FileAccess.Read);
2303
                    System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
2304
                    byte[] data = br.ReadBytes((int)numByte);
2305
2306
                    filename = fileUploader.Run(App.ViewInfo.ProjectNO, this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile + ".png", data);
2307
                    br.Close();
2308
                    fStream.Close();
2309
                    fStream.Dispose();
2310
                }
2311
                else
2312
                {
2313
                    this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert");
2314
                    return;
2315
                }
2316
2317
                fileInfo.Delete();
2318
2319
                //System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage();
2320
                System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(clipboardImage);
2321
                IntPtr hBitmap = bmp.GetHbitmap();
2322
                System.Windows.Media.ImageSource WpfBitmap = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
2323
                Image img = new Image();
2324
                img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(filename));
2325
2326
2327
2328
2329
2330
                var currentControl = new MarkupToPDF.Controls.Etc.ImgControl
2331
                {
2332
                    PointSet = new List<Point>(),
2333
                    FilePath = img.Source.ToString(),
2334
                    ImageData = img.Source,
2335
                    StartPoint = new Point(100, 100),
2336
                    EndPoint = new Point(200, 200),
2337
                    TopRightPoint = new Point(100, 200),
2338
                    LeftBottomPoint = new Point(200, 100)
2339
                };
2340
2341
                currentControl.TopRightPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y);
2342
                currentControl.LeftBottomPoint = new Point(currentControl.StartPoint.X, currentControl.StartPoint.Y + clipboardImage.Height);
2343
                currentControl.EndPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y + clipboardImage.Height);
2344
2345
                currentControl.PointSet = new List<Point>
2346
                                        {
2347
                                            currentControl.StartPoint,
2348
                                            currentControl.LeftBottomPoint,
2349
                                            currentControl.EndPoint,
2350
                                            currentControl.TopRightPoint,
2351
                                        };
2352
2353
                multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo);
2354
                UndoData.Markup_List.Add(multi_Undo_Data);
2355
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
2356
2357
                ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo);
2358
                currentControl.CommentID = Events.Save.shortGuid();
2359
2360
                currentControl.ApplyTemplate();
2361
                currentControl.SetImage();
2362
2363
                ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo);
2364
                Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo);
2365
                this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final);
2366
2367
                double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2);
2368
                double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2);
2369
                final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
2370 ccf944bb ljiyeon
2371 d4b0c723 KangIngu
            }
2372
        }
2373
2374
        public void Delete_Start()
2375
        {
2376
            if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2377
            {
2378
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
2379
2380
                UndoData = new Undo_data()
2381
                {
2382
                    IsUndo = false,
2383
                    Event = Event_Type.Delete,
2384
                    EventTime = DateTime.Now,
2385
                    Markup_List = new List<Multi_Undo_data>()
2386
                };
2387
2388
                foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2389
                {
2390
                    if (item.GetType().Name == "AdornerFinal")
2391
                    {
2392
                        (item as Controls.AdornerFinal).unRegister();
2393
2394
                        foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2395
                        {
2396
                            //if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2397
                            if (!ViewerDataModel.Instance.MarkupControls_USER.Contains(InnerItem.DrawingData))
2398
                            {
2399
2400
                                multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
2401
                                UndoData.Markup_List.Add(multi_Undo_Data);
2402
                                multi_Undo_Data = new Multi_Undo_data();
2403
2404
                                ViewerDataModel.Instance.MarkupControls.Remove(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo);
2405
2406
                                var Item_ = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault();
2407
2408
                                ViewerDataModel.Instance.MarkupList_USER.Remove(Item_);
2409 ccf944bb ljiyeon
2410 6707a5c7 ljiyeon
                                //임시파일에서도 삭제한다.
2411
                                temp.DelTemp((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber.ToString());
2412
                                
2413
                            }
2414 d4b0c723 KangIngu
                        }
2415
                    }
2416
2417
                    ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
2418
                    {
2419
                        ViewerDataModel.Instance.UndoDataList.Remove(i);
2420
                    });
2421
                    ViewerDataModel.Instance.UndoDataList.Add(UndoData);
2422
                }
2423
            }
2424
            this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear();
2425
        }
2426
2427 787a4489 KangIngu
    }
2428
}
클립보드 이미지 추가 (최대 크기: 500 MB)