프로젝트

일반

사용자정보

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

markus / KCOM / Events / Implementation / TopMenuEvent.cs @ 077896be

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

1
using KCOM.Common;
2
using KCOM.Common.Converter;
3
using KCOM.Controls;
4
using KCOM.Events;
5
using KCOMDataModel.DataModel;
6
using MarkupToPDF.Common;
7
using Svg2Xaml;
8
using System;
9
using System.Collections.Generic;
10
using System.Linq;
11
using System.Text;
12
using System.Windows;
13
using System.Windows.Controls;
14
using System.Windows.Input;
15
using System.Windows.Media;
16
using System.Windows.Media.Imaging;
17
using Telerik.Windows.Controls;
18
using IKCOM;
19
using Microsoft.Win32;
20
using System.IO;
21
using System.Reflection;
22
using System.Windows.Controls.Primitives;
23
using MarkupToPDF.Controls.Parsing;
24

    
25
namespace KCOM.Views
26
{
27
    public partial class TopMenu : UserControl
28
    {
29
        public int rotateOffSet = 0;
30
        private double[] rotateValue = { 0, 90, 180, 270 };
31
        public System.Windows.Threading.DispatcherTimer SaveTimer { get; set; }
32
        public bool isClosed = true;
33
        public RadWindow CheckPop;
34
        public RadWindow OptionPop;
35
        public MarkupToPDF.Common.Undo_data UndoData;
36
        MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn markupReturn = new MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn();
37

    
38
        /// <summary>
39
        /// TaskBar에 메시지를 입력합니다
40
        /// </summary>
41
        /// <param name="message"></param>
42
        /// <param name="type"></param>
43
        public void TaskMessage(string message, TaskMessageType type)
44
        {
45
            //if (taskBar != null)
46
            //{
47
            //    string color = "";
48
            //    taskBar.Content = message;
49
            //    DicTaskMessage.TryGetValue(type, out color);
50
            //    taskBar.Foreground = new SolidColorBrush(StringToColorConverter.Parse(color));
51
            //}
52
        }
53

    
54
        /// <summary>
55
        /// Task Type명을 Key값으로 지정합니다
56
        /// </summary>
57
        public enum TaskMessageType
58
        {
59
            Normal,
60
            Caption,
61
            Error,
62
        }
63

    
64
        private void CheckShapeState()
65
        {
66

    
67

    
68
            if (cbHatchShape.IsChecked == true)
69
            {
70
                cbFillShape.IsChecked = false;
71
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch;
72
            }
73
            else if(cbFillShape.IsChecked == true)
74
            {
75
                cbHatchShape.IsChecked = false;
76
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill;
77
            }
78
            else
79
            {
80
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;
81
            }
82
        }
83

    
84
        //강인구 추가(Undo End)
85
        private void SetPaintEvent()
86
        {
87
            List<AdornerMember> AdonerList = GetAdornerItem();
88

    
89
            if (AdonerList.Count > 0)
90
            {
91
                Undo_data UndoData = new Undo_data()
92
                {
93
                    IsUndo = false,
94
                    Event = Event_Type.Option,
95
                    EventTime = DateTime.Now,
96
                    paint = ViewerDataModel.Instance.paintSet,
97
                    Markup_List = new List<Multi_Undo_data>()
98
                };
99
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
100

    
101
                foreach (AdornerMember InnerItem in AdonerList)
102
                {
103
                    multi_Undo_Data.PointSet = new List<Point>();
104

    
105
                    if ((InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl) != null)
106
                    {
107
                        (InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl).Paint = ViewerDataModel.Instance.paintSet;
108
                    }
109

    
110
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
111
                    UndoData.Markup_List.Add(multi_Undo_Data);
112
                    multi_Undo_Data = new Multi_Undo_data();
113
                }
114

    
115
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
116
                {
117
                    ViewerDataModel.Instance.UndoDataList.Remove(i);                    
118
                });
119
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
120
                
121

    
122
            }
123

    
124
        }
125

    
126
        private void SetHighlightEvent()
127
        {
128
            List<AdornerMember> AdonerList = GetAdornerItem();
129

    
130
            if (AdonerList.Count > 0)
131
            {
132
                foreach (AdornerMember InnerItem in AdonerList)
133
                {
134
                    switch (InnerItem.DrawingData.GetType().Name)
135
                    {
136
                        case ("TextControl"):
137
                            {
138
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape;
139
                            }
140
                            break;
141
                        case ("ArrowTextControl"):
142
                            {
143
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape;
144
                            }
145
                            break;
146
                    }
147
                }
148
            }
149

    
150
        }
151

    
152
        private void FillShapeEvent(object sender, RoutedEventArgs e)
153
        {
154
            #region 주석
155
            //if ((sender as CheckBox).IsChecked.Value)
156
            //{
157
            //    cbHatchShape.IsChecked = false;
158
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Fill.png", UriKind.Relative));
159
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Fill.png", UriKind.Relative));
160
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle_Fill.png", UriKind.Relative));
161
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon.png", UriKind.Relative));
162
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon.png", UriKind.Relative));
163
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_Fill.png", UriKind.Relative));
164
            //    TaskMessage("채우기 옵션이 적용되었습니다", TaskMessageType.Normal);
165
            //}
166
            //else
167
            //{
168

    
169
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative));
170
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative));
171
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative));
172
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative));
173
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative));
174
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative));
175
            //    TaskMessage("채우기 옵션이 해제되었습니다", TaskMessageType.Caption);
176
            //}
177
            #endregion
178
            ViewerDataModel.Instance.checkFillShape = (sender as CheckBox).IsChecked.Value;
179

    
180
            if (ViewerDataModel.Instance.checkFillShape)
181
            {
182
                cbHatchShape.IsChecked = false;
183
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill;
184
            }
185
            else
186
            {
187
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;
188
            }
189
            SetPaintEvent();
190
        }
191

    
192
        /// <summary>
193
        /// 도형 빗금 처리
194
        /// </summary>
195
        /// <param name="sender"></param>
196
        /// <param name="e"></param>
197
        private void HatchShapeEvent(object sender, RoutedEventArgs e)
198
        {
199
			#region 주석
200
            //if ((sender as CheckBox).IsChecked.Value)
201
            //{
202
            //    cbFillShape.IsChecked = false;
203
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Hatch.png", UriKind.Relative));
204
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Hatch.png", UriKind.Relative));
205
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/rectangle-icon_Hatch.png", UriKind.Relative));
206
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_Hatch.png", UriKind.Relative));
207
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_Hatch.png", UriKind.Relative));
208
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_hatch.png", UriKind.Relative));
209
            //    TaskMessage("무늬 옵션이 적용되었습니다", TaskMessageType.Normal);
210
            //}
211
            //else
212
            //{
213
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative));
214
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative));
215
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative));
216
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative));
217
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative));
218
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative));
219
            //    TaskMessage("무늬 옵션이 해제되었습니다", TaskMessageType.Caption);
220
            //} 
221
            #endregion
222

    
223
            //강인구 추가
224
            ViewerDataModel.Instance.checkHatchShape = (sender as CheckBox).IsChecked.Value;
225
            if (ViewerDataModel.Instance.checkHatchShape)
226
            {
227
                cbFillShape.IsChecked = false;
228
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch;
229
            }
230
            else
231
            {
232
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;  
233
            }
234
            SetPaintEvent();
235
        }
236

    
237
 		//강인구 추가
238
        private string SetColor(string ID)
239
        {
240
            try
241
            {
242
                return ViewerDataModel.Instance._markupInfoList.Where(info => info.MarkupInfoID == ID).First().DisplayColor;
243
            }
244
            catch (Exception)
245
            {
246
                return "#FFFFFF";
247
            }
248
        }
249

    
250
        void SaveTimer_Tick(object sender, EventArgs e)
251
        {
252
            //if (this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode != IKCOM.MouseHandlingMode.Drawing)
253
            if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl == null && this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count == 0)
254
            {
255
                SaveEvent(null, null);
256
            }
257

    
258
        }
259

    
260
        private void SaveTime(bool IsRun)
261
        {
262
            if(SaveTimer == null)
263
            {
264
                SaveTimer = new System.Windows.Threading.DispatcherTimer();
265
                SaveTimer.Interval = new TimeSpan(0, 0, 5);
266
                SaveTimer.Tick += new EventHandler(SaveTimer_Tick);
267
            }
268

    
269
            if (IsRun)
270
            {
271
                SaveTimer.Start();
272
            }
273
            else
274
            {
275
                SaveTimer.Stop();
276
            }
277
        }
278
        private void SaveTime(bool IsRun,int timeinterval)
279
        {
280
            if (SaveTimer == null)
281
            {
282
                SaveTimer = new System.Windows.Threading.DispatcherTimer();
283
                SaveTimer.Interval = new TimeSpan(0, timeinterval, 0);
284
                SaveTimer.Tick += new EventHandler(SaveTimer_Tick);
285
            }
286
            else
287
            {
288
                SaveTimer.Stop();
289
                SaveTimer.Interval = new TimeSpan(0, timeinterval, 0);
290
            }
291

    
292
            if (IsRun)
293
            {
294
                SaveTimer.Start();
295
            }
296
            else
297
            {
298
                SaveTimer.Stop();
299
            }
300
        }
301
        /// <summary>
302
        /// enable busy indicator and then call _SaveEvent method.
303
        /// </summary>
304
        /// <param name="sender"></param>
305
        /// <param name="e"></param>
306
        public void SaveEvent(object sender, RoutedEventArgs e)
307
        {
308
            this.ParentOfType<MainWindow>().dzMainMenu.EmptyControlCheck();
309

    
310
            if (this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy == true) return;
311

    
312
            this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = true;
313
            System.Threading.Tasks.Task SaveTask = System.Threading.Tasks.Task.Factory.StartNew(() =>
314
            {
315
                Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action<object, RoutedEventArgs>(_SaveEvent), sender, e);
316
            }).ContinueWith(task =>
317
            {
318
                Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate () { this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = false; }));
319
            });
320
        }
321

    
322
        /// <summary>
323
        /// save document
324
        /// </summary>
325
        /// <param name="sender"></param>
326
        /// <param name="e"></param>
327
        public void _SaveEvent(object sender, RoutedEventArgs e)
328
        {
329
            try
330
            {
331
                SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu);
332

    
333
                this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
334

    
335
                var menu = this.ParentOfType<MainWindow>().dzMainMenu;
336

    
337
                //콘솔리 데잇일 경우 
338
                //if (ViewerDataModel.Instance.IsConsolidate && menu.gridViewMarkup.SelectedItems.Count > 1)
339
                //if (ViewerDataModel.Instance.IsConsolidate)
340
                //{
341
                //    ViewerDataModel.Instance.IsConsolidate = false;
342
                //    return;
343
                //}
344

    
345
                //코멘트가 없을 경우
346
                //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0)
347
                //{
348
                //    foreach (var item in menu.gridViewMarkup.SelectedItems)
349
                //    {
350
                //        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
351
                //        {
352
                //            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
353
                //            return;
354
                //        }
355
                //    }
356
                //}
357

    
358
                //코멘트가 없을 경우
359
                if (ViewerDataModel.Instance.MarkupList_USER.Count == 0)
360
                {
361
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
362
                    {
363
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
364
                        {
365
                            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
366
                            return;
367
                        }
368
                    }
369
                }
370

    
371
                if (ViewerDataModel.Instance.MarkupList_USER.Count > 0)
372
                {
373
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
374
                    {
375
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
376
                        {
377
                            /*
378
                            if (menu.UndoData.Markup_List[0].Markup..GetType().Name == "TextControl" && ((MarkupToPDF.Controls.Text.TextControl)(item as IKCOM.MarkupInfoItem).MarkupList[0].).OverViewText == null)
379
                            {
380
                            }
381

    
382
                            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
383
                            return;*/
384
                        }
385
                    }
386
                }
387
                
388

    
389
                    //코멘트가 없을 경우
390
                    //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0)
391
                    //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0 && menu.gridViewMarkup.SelectedItems.Count == 0)
392
                    //{
393
                    //    foreach (var item in menu.gridViewMarkup.SelectedItems)
394
                    //    {
395
                    //        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
396
                    //        {
397
                    //            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
398
                    //            return;
399
                    //        }
400
                    //    }
401
                    //}
402

    
403
                    menu.ChangeCommentReact();
404

    
405
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
406
                {
407
                    RefactoryCommentReact(menu);
408
                }
409
                else if (menu.gridViewMarkup.SelectedItems.Count == 0 && menu.gridViewMarkup.Items.Count > 0)
410
                {
411
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
412
                    return;
413
                }
414
                //else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as  IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
415
                //{
416
                //    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
417
                //    return;
418
                //}
419
                // 변경
420
                else
421
                {
422
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
423
                    {
424
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
425
                        {
426
                            RefactoryCommentReact(menu);
427
                            ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now;
428

    
429

    
430
                            if (ViewerDataModel.Instance.IsConsolidate)
431
                            {
432
                                return;
433
                            }
434
                            menu.gridViewMarkup.ItemsSource = null;
435
                            menu.gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList;
436
                            menu.gridViewMarkup.SelectedItem = item;
437

    
438
                            if (sender != null)
439
                            {
440
                                if (ViewerDataModel.Instance.IsPressCtrl)
441
                                {
442
                                    ViewerDataModel.Instance.IsPressCtrl = false;
443
                                }
444
                                this.ParentOfType<MainWindow>().DialogMessage_Alert("Save 가 완료되었습니다.", "Alert");
445
                            }
446
                            return;
447
                        }
448
                    }
449
                    ////강인구 변경
450
                    //this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
451
                }
452
                if (sender != null)
453
                {
454
                    if (ViewerDataModel.Instance.IsPressCtrl)
455
                    {
456
                        ViewerDataModel.Instance.IsPressCtrl = false;
457
                    }
458
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Save 가 완료되었습니다.", "Alert");
459
                }
460
            }
461
            catch(Exception ex)
462
            {
463
               
464
            }
465
            finally
466
            {
467
            }
468
        }
469

    
470
		public void RefactoryCommentReact(MainMenu menu)
471
        {
472
            this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
473

    
474
            SaveCommand.Instance.Project_No = App.ViewInfo.ProjectNO;
475
            SaveCommand.Instance.document_id = App.ViewInfo.DocumentItemID;
476
            SaveCommand.Instance.user_id = App.ViewInfo.UserID;
477
            SaveCommand.Instance.page_no = Convert.ToInt32(tlcurrentPage.Text);
478

    
479
            try
480
            {
481
                List<IKCOM.MarkupInfoItem> MySelectItem = new List<IKCOM.MarkupInfoItem>();
482
                foreach (var item in menu.gridViewMarkup.SelectedItems)
483
                {
484
                    if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
485
                    {
486
                        MySelectItem.Add(item as IKCOM.MarkupInfoItem);
487
                    }
488
                }
489

    
490
                menu.ChangeCommentReact();
491
                SaveCommand.Instance.Execute(MySelectItem, SaveCommand.Instance.page_no);
492
                SaveCommand.Instance.PageAngleSave(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.RotationDocs);
493
            }
494
            catch (Exception ex)
495
            {
496
                this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(string.Format("세이브 실패:{0}", ex.Message), "Alert");
497
                throw ex;
498
            }
499
        }
500

    
501
        //강인구 추가
502
        public void Print_Start(string Type)
503
        {
504
            if (ViewerDataModel.Instance.IsPressCtrl)
505
            {
506
                ViewerDataModel.Instance.IsPressCtrl = false;
507
            }
508
            if (ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
509
            {
510
                var menu = this.ParentOfType<MainWindow>().dzMainMenu;
511
                SelectionSet.Instance.UnSelect(menu);
512
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
513
                {
514
                    RefactoryCommentReact(menu);
515
                }
516
                else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
517
                {
518

    
519
                }
520
                else
521
                {
522
                    RefactoryCommentReact(menu);
523
                }
524
            }
525

    
526
            bool isprint = false;
527
            if (Type == "Print")
528
            {
529
                isprint = true;
530
            }
531

    
532
            RadWindow PrintWindow = new RadWindow();
533
            //IKCOM.MarkupInfoItem _result = null;
534
            PrintWindow.Width = 850;
535
            PrintWindow.Height = 600;
536
            //PrintWindow.Width = 650;
537
            //PrintWindow.Height = 550;
538
            PrintWindow.Header = Type;
539

    
540
            List<IKCOM.MarkupInfoItem> markupinfo = new List<IKCOM.MarkupInfoItem>();
541

    
542
            Logger.sendReqLog("GetPrintDocItemList: ", App.ViewInfo.ProjectNO + "," + App.ViewInfo.DocumentItemID + "," + ViewerDataModel.Instance._markupInfoList.ToList(), 1);
543
            markupinfo = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetPrintDocItemList(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID, ViewerDataModel.Instance._markupInfoList.ToList());
544

    
545
            if (markupinfo.Count() > 0)
546
            {
547
                Logger.sendResLog("GetPrintDocItemList", "TRUE", 1);
548
            }
549
            else
550
            {
551
                Logger.sendResLog("GetPrintDocItemList", "FALSE", 1);
552
            }
553

    
554
            var Tile_Url = string.Format(@"{0}/TileSource/{1}_Tile/{2}/{3}/",
555
                App.SystemInfo.HostName,
556
                App.ViewInfo.ProjectNO,
557
                (Convert.ToInt64(App.ViewInfo.DocumentItemID) / 100).ToString(),
558
                App.ViewInfo.DocumentItemID
559
                );
560

    
561
            PrintWindow.Content = new KCOM.Control.PrintControl(
562
                      Tile_Url,
563
                      App.ViewInfo.ProjectNO,
564
                      this.ParentOfType<MainWindow>().dzMainMenu._DocInfo, markupinfo,
565
                      this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber,
566
                      App.ViewInfo.DocumentItemID,
567
                      this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO,
568
                      this.ParentOfType<MainWindow>().dzMainMenu._DocItem.ORIGINAL_FILE, isprint);
569

    
570
            //프린트 팝업 옵션
571
            //PrintWindow.BorderThickness = new Thickness(3);
572
            //PrintWindow.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 37, 160, 218));
573
            PrintWindow.ResizeMode = System.Windows.ResizeMode.NoResize;
574
            PrintWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
575
            PrintWindow.Background = new SolidColorBrush(Colors.Black);
576
            PrintWindow.Background.Opacity = 0.6;
577
            PrintWindow.Owner = Application.Current.MainWindow;
578
            Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.VisualStudio2013Theme());
579
            PrintWindow.ShowDialog();
580
        }
581

    
582
        //강인구 추가
583
        private void PrintEvent(object sender, RoutedEventArgs e)
584
        {
585
            RadRibbonButton button = sender as RadRibbonButton;
586
            Print_Start(button.Content.ToString());
587
        }
588

    
589
        private List<AdornerMember> GetAdornerItem()
590
        {
591
            List<AdornerMember> AdonerList = new List<AdornerMember>();
592

    
593
            if (this.ParentOfType<MainWindow>() != null)
594
            {
595
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
596
                {
597
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
598
                    {
599
                        if (item.GetType().Name == "AdornerFinal")
600
                        {
601
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
602
                            {
603
                                AdonerList.Add(InnerItem);
604
                            }
605
                        }
606
                    }
607
                }
608
            }
609
            return AdonerList;
610
        }
611
        /// <summary>
612
        /// 투명도
613
        /// </summary>
614
        /// <param name="sender"></param>
615
        /// <param name="e"></param>
616
        //강인구 추가(Undo End)
617
        private void sdOpacity_ValueChanged(object sender, RoutedEventArgs e)
618
        {
619
            List<AdornerMember> AdonerList = GetAdornerItem();
620
            if(AdonerList.Count > 0)
621
            {
622
                Undo_data UndoData = new Undo_data()
623
                {
624
                    IsUndo = false,
625
                    Event = Event_Type.Option,
626
                    EventTime = DateTime.Now,
627
                    Opacity = ViewerDataModel.Instance.ControlOpacity,
628
                    Markup_List = new List<Multi_Undo_data>()
629
                };
630
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
631

    
632
                foreach (AdornerMember InnerItem in AdonerList)
633
                {
634
                    InnerItem.DrawingData.Opacity = ViewerDataModel.Instance.ControlOpacity;
635
                  
636
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
637
                    UndoData.Markup_List.Add(multi_Undo_Data);
638
                    multi_Undo_Data = new Multi_Undo_data();
639
                }
640

    
641
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
642
                {
643
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
644
                });
645
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
646
            }
647
        }
648

    
649
        //강인구 추가(Undo End)
650
        private void cbLineSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
651
        {
652
            if (string.IsNullOrEmpty(cbLineSize.Value.ToString()))
653
            {
654
                cbLineSize.Value = cbLineSize.Minimum;
655
            }
656
            List<AdornerMember> AdonerList = GetAdornerItem();
657
            if (AdonerList.Count > 0)
658
            {
659
                Undo_data UndoData = new Undo_data()
660
                {
661
                    IsUndo = false,
662
                    Event = Event_Type.Option,
663
                    EventTime = DateTime.Now,
664
                    LineSize = ViewerDataModel.Instance.LineSize,
665
                    Markup_List = new List<Multi_Undo_data>()
666
                };
667
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
668

    
669
                foreach (AdornerMember InnerItem in AdonerList)
670
                {
671
                    switch (InnerItem.DrawingData.GetType().Name)
672
                    {
673
                        case ("LineControl"):
674
                            {
675
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).LineSize = ViewerDataModel.Instance.LineSize;
676
                            }
677
                            break;
678
                        case ("ArcControl"):
679
                            {
680
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).LineSize = ViewerDataModel.Instance.LineSize;
681
                            }
682
                            break;
683
                        case ("ArrowArcControl"):
684
                            {
685
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).LineSize = ViewerDataModel.Instance.LineSize;
686
                            }
687
                            break;
688
                        case ("ArrowControl_Multi"):
689
                            {
690
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).LineSize = ViewerDataModel.Instance.LineSize;
691
                            }
692
                            break;
693
                        case ("CloudControl"):
694
                            {
695
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).LineSize = ViewerDataModel.Instance.LineSize;
696
                            }
697
                            break;
698
                        case ("PolygonControl"):
699
                            {
700
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).LineSize = ViewerDataModel.Instance.LineSize;
701
                            }
702
                            break;
703
                        case ("RectangleControl"):
704
                            {
705
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).LineSize = ViewerDataModel.Instance.LineSize;
706
                            }
707
                            break;
708
                        case ("RectCloudControl"):
709
                            {
710
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).LineSize = ViewerDataModel.Instance.LineSize;
711
                            }
712
                            break;
713
                        case ("TriControl"):
714
                            {
715
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).LineSize = ViewerDataModel.Instance.LineSize;
716
                            }
717
                            break;
718
                        case ("CircleControl"):
719
                            {
720
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).LineSize = ViewerDataModel.Instance.LineSize;
721
                            }
722
                            break;
723
                        case ("ArrowTextControl"):
724
                            {
725
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).LineSize = ViewerDataModel.Instance.LineSize;
726
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).BorderSize = new Thickness(ViewerDataModel.Instance.LineSize);
727
                            }
728
                            break;
729
                        case ("TextControl"):
730
                            {
731
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).LineSize = new Thickness(ViewerDataModel.Instance.LineSize);
732
                            }
733
                            break;
734
                        case ("InsideWhiteControl"):
735
                            {
736
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).LineSize = ViewerDataModel.Instance.LineSize;
737
                            }
738
                            break;
739
                        case ("OverlapWhiteControl"):
740
                            {
741
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).LineSize = ViewerDataModel.Instance.LineSize;
742
                            }
743
                            break;
744
                        case ("ClipWhiteControl"):
745
                            {
746
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).LineSize = ViewerDataModel.Instance.LineSize;
747
                            }
748
                            break;
749
                        case ("CoordinateControl"):
750
                            {
751
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).LineSize = 10; //ViewerDataModel.Instance.LineSize
752
                            }
753
                            break;
754
                    }
755
                    
756

    
757
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
758
                    UndoData.Markup_List.Add(multi_Undo_Data);
759
                    multi_Undo_Data = new Multi_Undo_data();
760
                }
761

    
762
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
763
                {
764
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
765
                });
766
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
767

    
768
                
769
            }
770
            KCOM.Properties.Settings.Default.LineSize = (double)cbLineSize.Value;
771
            Properties.Settings.Default.Save();
772
        }
773

    
774

    
775
        private void cbIntervalSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
776
        {
777
            if (string.IsNullOrEmpty(cbIntervalSize.Value.ToString()))
778
            {
779
                cbIntervalSize.Value = cbIntervalSize.Minimum;
780
            }
781
            List<AdornerMember> AdonerList = GetAdornerItem();
782
            if (AdonerList.Count > 0)
783
            {
784

    
785
                Undo_data UndoData = new Undo_data()
786
                {
787
                    IsUndo = false,
788
                    Event = Event_Type.Option,
789
                    EventTime = DateTime.Now,
790
                    Interval = ViewerDataModel.Instance.Interval,
791
                    Markup_List = new List<Multi_Undo_data>()
792
                };
793
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
794

    
795
                foreach (AdornerMember InnerItem in AdonerList)
796
                {
797
                    switch (InnerItem.DrawingData.GetType().Name)
798
                    {
799
                        case ("LineControl"):
800
                            {
801
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).Interval = ViewerDataModel.Instance.Interval;
802

    
803
                                multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
804
                                UndoData.Markup_List.Add(multi_Undo_Data);
805
                                multi_Undo_Data = new Multi_Undo_data();
806
                            }
807
                            break;
808
                    }
809
                }
810

    
811
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
812
                {
813
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
814
                });
815
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
816
            }
817
            KCOM.Properties.Settings.Default.Interval = (double)cbIntervalSize.Value;
818
            Properties.Settings.Default.Save();
819
        }
820
        
821
        private void cbArcLength_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
822
        {
823
            if (string.IsNullOrEmpty(cbArcLength.Value.ToString()))
824
            {
825
                cbArcLength.Value = cbArcLength.Minimum;
826
            }
827
            List<AdornerMember> AdonerList = GetAdornerItem();
828
            if (AdonerList.Count > 0)
829
            {
830

    
831
                //Undo_data UndoData = new Undo_data()
832
                //{
833
                //    IsUndo = false,
834
                //    Event = Event_Type.Option,
835
                //    EventTime = DateTime.Now,
836
                //    Interval = ViewerDataModel.Instance.Interval,
837
                //    Markup_List = new List<Multi_Undo_data>()
838
                //};
839
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
840

    
841
                foreach (AdornerMember InnerItem in AdonerList)
842
                {
843
                    switch (InnerItem.DrawingData.GetType().Name)
844
                    {
845
                        case ("RectCloudControl"):
846
                            {
847
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).ArcLength = ViewerDataModel.Instance.ArcLength;
848

    
849
                                //multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
850
                                //UndoData.Markup_List.Add(multi_Undo_Data);
851
                                //multi_Undo_Data = new Multi_Undo_data();
852
                            }
853
                            break;
854
                        case ("CloudControl"):
855
                            {
856
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).ArcLength = ViewerDataModel.Instance.ArcLength;
857

    
858
                                //multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
859
                                //UndoData.Markup_List.Add(multi_Undo_Data);
860
                                //multi_Undo_Data = new Multi_Undo_data();
861
                            }
862
                            break;
863
                    }
864
                }
865

    
866
                //ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
867
                //{
868
                //    ViewerDataModel.Instance.UndoDataList.Remove(i);
869
                //});
870
                //ViewerDataModel.Instance.UndoDataList.Add(UndoData);
871
            }
872

    
873
            KCOM.Properties.Settings.Default.ArcLength = (double)cbArcLength.Value;
874
            Properties.Settings.Default.Save();
875
        }
876

    
877
        //강인구 추가(Undo End)
878
        private void cbDashStyle_SelectionChanged(object sender, SelectionChangedEventArgs e)
879
        {
880
            //강인구 추가
881
            if (this.ParentOfType<MainWindow>() != null)
882
            {
883
                ViewerDataModel.Instance.DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
884
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
885
                {
886
                    Undo_data UndoData = new Undo_data()
887
                    {
888
                        IsUndo = false,
889
                        Event = Event_Type.Option,
890
                        EventTime = DateTime.Now,
891
                        DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData,
892
                        Markup_List = new List<Multi_Undo_data>()
893
                    };
894
                    Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
895

    
896
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
897
                    {
898
                        if (item.GetType().Name == "AdornerFinal")
899
                        {
900
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
901
                            {
902
                                switch (InnerItem.DrawingData.GetType().Name)
903
                                {
904
                                    case ("LineControl"):
905
                                        {
906
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
907
                                        }
908
                                        break;
909
                                    case ("ArcControl"):
910
                                        {
911
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
912
                                        }
913
                                        break;
914
                                    case ("ArrowArcControl"):
915
                                        {
916
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
917
                                        }
918
                                        break;
919
                                    case ("ArrowControl_Multi"):
920
                                        {
921
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
922
                                        }
923
                                        break;
924
                                    case ("CloudControl"):
925
                                        {
926
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
927
                                        }
928
                                        break;
929
                                    case ("PolygonControl"):
930
                                        {
931
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
932
                                        }
933
                                        break;
934
                                    case ("RectangleControl"):
935
                                        {
936
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
937
                                        }
938
                                        break;
939
                                    case ("RectCloudControl"):
940
                                        {
941
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
942
                                        }
943
                                        break;
944
                                    case ("TriControl"):
945
                                        {
946
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
947
                                        }
948
                                        break;
949
                                    case ("CircleControl"):
950
                                        {
951
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
952
                                        }
953
                                        break;
954
                                    case ("InsideWhiteControl"):
955
                                        {
956
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
957
                                        }
958
                                        break;
959
                                    case ("OverlapWhiteControl"):
960
                                        {
961
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
962
                                        }
963
                                        break;
964
                                    case ("ClipWhiteControl"):
965
                                        {
966
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
967
                                        }
968
                                        break;
969
                                    case ("CoordinateControl"):
970
                                        {
971
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
972
                                        }
973
                                        break;
974
                                }
975

    
976
                                multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
977
                                UndoData.Markup_List.Add(multi_Undo_Data);
978
                                multi_Undo_Data = new Multi_Undo_data();
979
                            }
980

    
981
                            ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
982
                            {
983
                                ViewerDataModel.Instance.UndoDataList.Remove(i);
984
                            });
985
                            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
986
                        }
987
                    }
988
                }
989
            }
990
        }
991

    
992
        //강인구 추가
993
        private void comboFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
994
        {
995
            //if (this.ParentOfType<MainWindow>() != null)
996
            //{
997
            //    if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
998
            //    {
999
            //        foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1000
            //        {
1001
            //            if (item.GetType().Name == "AdornerFinal")
1002
            //            {
1003
            //                foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1004
            //                {
1005
            //                    switch (InnerItem.DrawingData.GetType().Name)
1006
            //                    {
1007
            //                        case ("TextControl"):
1008
            //                            {
1009
            //                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Text);
1010
            //                            }
1011
            //                            break;
1012
            //                        case ("ArrowTextControl"):
1013
            //                            {
1014
            //                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Text);
1015
            //                            }
1016
            //                            break;
1017
            //                    }
1018
            //                }
1019
            //            }
1020
            //        }
1021
            //    }
1022
            //}
1023
        }
1024

    
1025
        //강인구 추가
1026
        private void btnBold_Checked(object sender, RoutedEventArgs e)
1027
        {
1028
            if (this.ParentOfType<MainWindow>() != null)
1029
            {
1030
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1031
                {
1032
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1033
                    {
1034
                        if (item.GetType().Name == "AdornerFinal")
1035
                        {
1036
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1037
                            {
1038
                                switch (InnerItem.DrawingData.GetType().Name)
1039
                                {
1040
                                    case ("TextControl"):
1041
                                        {
1042
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight == FontWeights.Bold)
1043
                                            {
1044
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Normal;
1045
                                            }
1046
                                            else
1047
                                            {
1048
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Bold;
1049
                                            }
1050

    
1051
                                        }
1052
                                        break;
1053
                                    case ("ArrowTextControl"):
1054
                                        {
1055
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight == FontWeights.Bold)
1056
                                            {
1057
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Normal;
1058
                                            }
1059
                                            else
1060
                                            {
1061
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Bold;
1062
                                            }
1063
                                        }
1064
                                        break;
1065
                                }
1066
                            }
1067
                        }
1068
                    }
1069
                }
1070
            }
1071
        }
1072

    
1073
        //강인구 추가
1074
        private void btnItalic_Checked(object sender, RoutedEventArgs e)
1075
        {
1076
            if (this.ParentOfType<MainWindow>() != null)
1077
            {
1078
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1079
                {
1080
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1081
                    {
1082
                        if (item.GetType().Name == "AdornerFinal")
1083
                        {
1084
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1085
                            {
1086
                                switch (InnerItem.DrawingData.GetType().Name)
1087
                                {
1088
                                    case ("TextControl"):
1089
                                        {
1090
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle == FontStyles.Italic)
1091
                                            {
1092
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = System.Windows.FontStyles.Normal;
1093
                                            }
1094
                                            else
1095
                                            {
1096
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = FontStyles.Italic;
1097
                                            }
1098

    
1099
                                        }
1100
                                        break;
1101
                                    case ("ArrowTextControl"):
1102
                                        {
1103
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle == FontStyles.Italic)
1104
                                            {
1105
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Normal;
1106
                                            }
1107
                                            else
1108
                                            {
1109
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Italic;
1110
                                            }
1111
                                        }
1112
                                        break;
1113
                                }
1114
                            }
1115
                        }
1116
                    }
1117
                }
1118
            }
1119
        }
1120

    
1121
        //강인구 추가
1122
        private void btnUnderLine_Checked(object sender, RoutedEventArgs e)
1123
        {
1124
            if (this.ParentOfType<MainWindow>() != null)
1125
            {
1126
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1127
                {
1128
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1129
                    {
1130
                        if (item.GetType().Name == "AdornerFinal")
1131
                        {
1132
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1133
                            {
1134
                                switch (InnerItem.DrawingData.GetType().Name)
1135
                                {
1136
                                    case ("TextControl"):
1137
                                        {
1138
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine == TextDecorations.Underline)
1139
                                            {
1140
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = null;
1141
                                            }
1142
                                            else
1143
                                            {
1144
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
1145
                                            }
1146
                                        }
1147
                                        break;
1148
                                    case ("ArrowTextControl"):
1149
                                        {
1150
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
1151
                                            {
1152
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
1153
                                            }
1154
                                            else
1155
                                            {
1156
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
1157
                                            }
1158
                                        }
1159
                                        break;
1160
                                }
1161
                            }
1162
                        }
1163
                    }
1164
                }
1165
            }
1166
        }
1167

    
1168
        private void AxisLockEvent(object sender, RoutedEventArgs e)
1169
        {
1170
            ViewerDataModel.Instance.checkAxis = cbAxisLock.IsChecked.Value;
1171
        }
1172

    
1173
        private void comboFontSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
1174
        {
1175
            if (string.IsNullOrEmpty(comboFontSize.Value.ToString()))
1176
            {
1177
                comboFontSize.Value = comboFontSize.Minimum;
1178
            }
1179
            if (this.ParentOfType<MainWindow>() != null)
1180
            {
1181
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1182
                {
1183
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1184
                    {
1185
                        if (item.GetType().Name == "AdornerFinal")
1186
                        {
1187
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1188
                            {
1189
                                switch (InnerItem.DrawingData.GetType().Name)
1190
                                {
1191
                                    case ("TextControl"):
1192
                                        {
1193
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Value.ToString());
1194
                                        }
1195
                                        break;
1196
                                    case ("ArrowTextControl"):
1197
                                        {
1198
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Value.ToString());
1199
                                        }
1200
                                        break;
1201
                                }
1202
                            }
1203
                        }
1204
                    }
1205
                }
1206
            }
1207
            KCOM.Properties.Settings.Default.TextSize = (double)comboFontSize.Value;
1208
            Properties.Settings.Default.Save();
1209
        }
1210

    
1211
        //강인구 추가
1212
        private void RadRibbonComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
1213
        {
1214
            if (this.ParentOfType<MainWindow>() != null)
1215
            {
1216
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1217
                {
1218
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1219
                    {
1220
                        if (item.GetType().Name == "AdornerFinal")
1221
                        {
1222
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1223
                            {
1224
                                switch (InnerItem.DrawingData.GetType().Name)
1225
                                {
1226
                                    case ("TextControl"):
1227
                                        {
1228
                                            //if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily == TextDecorations.Underline)
1229
                                            //{
1230
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily = new FontFamily(comboFontFamily.Text);
1231
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBlock.FontFamily = new FontFamily(comboFontFamily.Text);
1232
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBox.FontFamily = new FontFamily(comboFontFamily.Text);
1233
                                            //}
1234
                                            //else
1235
                                            //{
1236
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
1237
                                            //}
1238
                                        }
1239
                                        break;
1240
                                    case ("ArrowTextControl"):
1241
                                        {
1242
                                            //if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
1243
                                            //{
1244
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
1245
                                            //}
1246
                                            //else
1247
                                            //{
1248
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
1249
                                            //}
1250
                                        }
1251
                                        break;
1252
                                }
1253
                            }
1254
                        }
1255
                    }
1256
                }
1257
            }
1258
        }
1259

    
1260
        /// <summary>
1261
        /// 텍스트 컨트롤 하일라이트 처리
1262
        /// </summary>
1263
        /// <param name="sender"></param>
1264
        /// <param name="e"></param>
1265
        private void HighlightEvent(object sender, RoutedEventArgs e)
1266
        {
1267

    
1268
            ViewerDataModel.Instance.checkHighShape = (sender as CheckBox).IsChecked.Value;
1269
            SetHighlightEvent();
1270
            //if ((sender as CheckBox).IsChecked.Value)
1271
            //{
1272
            //    TaskMessage("HighLight가 설정되었습니다", TaskMessageType.Normal);
1273
            //}
1274
            //else
1275
            //{
1276
            //    TaskMessage("HighLight가 해제되었습니다", TaskMessageType.Caption);
1277
            //}
1278
            //if (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl != null)
1279
            //{
1280
            //    MarkupToPDF.Controls.Text.TextControl instance = (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl);
1281
            //    instance.IsHighLight = ViewerDataModel.Instance.checkHighShape;
1282
            //    instance.SetText();
1283
            //}
1284
        }
1285

    
1286
        //추가페이지 이동 엔터
1287
        private void tlcurrentPage_KeyDown(object sender, KeyEventArgs e)
1288
        {
1289
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1290
            if (e.Key == Key.Enter)
1291
            {
1292
                try
1293
                {
1294
                    var instanceMain = this.ParentOfType<MainWindow>();
1295
                    instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text));
1296
                }
1297
                catch (Exception)
1298
                {
1299
                    RadWindow.Alert(new DialogParameters
1300
                    {
1301
                        Owner = Application.Current.MainWindow,
1302
                        Theme = new VisualStudio2013Theme(),
1303
                        Header = "안내",
1304
                        Content = "페이지 번호를 정확하게 입력해 주세요",
1305
                    });
1306
                }
1307
                
1308
            }
1309
        }
1310

    
1311
        private void tlcurrentPage_readonly_KeyDown(object sender, KeyEventArgs e)
1312
        {
1313
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1314
            if (e.Key == Key.Enter)
1315
            {
1316
                try
1317
                {
1318
                    var instanceMain = this.ParentOfType<MainWindow>();
1319
                    instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage_readonly.Text));
1320
                }
1321
                catch (Exception)
1322
                {
1323
                    RadWindow.Alert(new DialogParameters
1324
                    {
1325
                        Owner = Application.Current.MainWindow,
1326
                        Theme = new VisualStudio2013Theme(),
1327
                        Header = "안내",
1328
                        Content = "페이지 번호를 정확하게 입력해 주세요",
1329
                    });
1330
                }
1331

    
1332
            }
1333
        }
1334
        
1335

    
1336
        //public event EventHandler<WindowClosedEventArgs> Closed;
1337

    
1338
        //private void CheckEvent(object sender, RoutedEventArgs e)
1339
        //{
1340
        //    RadWindow CheckPop = new RadWindow();
1341
        //    test check = new test();
1342

    
1343
        //    CheckPop = new RadWindow
1344
        //    {
1345
        //        Width = 1700,
1346
        //        Height = 510,
1347
        //        Header = "My Check List",
1348
        //        Content = check,
1349
        //        Owner = this,
1350
        //        ResizeMode = System.Windows.ResizeMode.NoResize,
1351
        //        WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1352
        //    };
1353
        //    StyleManager.SetTheme(CheckPop, new VisualStudio2013Theme());
1354

    
1355
        //    CheckPop.Closed += CheckPop_Closed;
1356
        //    CheckPop.ShowDialog();
1357
        //}
1358

    
1359
        private void PanoramaEvent(object sender, RoutedEventArgs e)
1360
        {
1361
            PanoramaShow();
1362
        }
1363

    
1364
        public void PanoramaShow()
1365
        {
1366
            Panorama check = new Panorama();
1367
            double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
1368
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
1369
            //double windowWidth = this.Width;
1370
            //double windowHeight = this.Height;
1371

    
1372
            var PanoramaPop = new RadWindow
1373
            {
1374
                //MinWidth = 600,
1375
                //MinHeight = 400,
1376
                //Header = "My Check List",
1377
                Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1378
                Content = check,
1379
                Owner = this,
1380
                ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1381
                //ResizeMode = System.Windows.ResizeMode.NoResize,
1382
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1383
                IsTopmost = false,
1384
                //Left = (screenWidth / 2) - (windowWidth / 2),
1385
                //Top = (screenHeight / 2) - (windowHeight / 2),
1386
                //Left = (screenWidth / 2),
1387
                //Top = (screenHeight / 2),
1388
                Width = screenWidth * 0.4,
1389
                Height = screenHeight * 0.4,
1390
            };
1391
            StyleManager.SetTheme(PanoramaPop, new VisualStudio2013Theme());
1392
            //CheckPop.ShowDialog();
1393
            PanoramaPop.Owner = Application.Current.MainWindow;
1394
            PanoramaPop.Show();
1395
        }
1396

    
1397
        private void CheckEvent(object sender, RoutedEventArgs e)
1398
        {
1399
            //창이 떠있을 경우 재 실행 방지
1400
            if (isClosed)
1401
            {
1402
                //토글 및 마우스 상태 초기화
1403
                var toggleList = this.Parent.ChildrenOfType<RadToggleButton>();
1404
                foreach(var togle in toggleList)
1405
                {
1406
                    togle.IsChecked = false;
1407
                }
1408
                this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1409

    
1410
                isClosed = false;
1411

    
1412
                
1413
                CheckList check = new CheckList();
1414

    
1415
                CheckPop = new RadWindow
1416
                {
1417
                    MinWidth = 1200,
1418
                    MinHeight = 500,
1419
                    //Header = "My Check List",
1420
                    Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1421
                    Content = check,
1422
                    //Owner = this,
1423
                    //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1424
                    ResizeMode = System.Windows.ResizeMode.NoResize,
1425
                    WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1426
                    IsTopmost = true,
1427
                };
1428
                StyleManager.SetTheme(CheckPop, new Office2013Theme());
1429
                CheckPop.Closed += CheckPop_Closed;
1430
                
1431
                //CheckPop.ShowDialog();
1432
                CheckPop.Show();
1433
            }
1434
        }
1435

    
1436
        private void OptionPop_Closed(object sender, WindowClosedEventArgs e)
1437
        {
1438
            isClosed = true;
1439
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
1440
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1441
            ViewerDataModel.Instance.Capture_Opacity = 0;
1442
        }
1443

    
1444
        private void CheckPop_Closed(object sender, WindowClosedEventArgs e)
1445
        {
1446
            isClosed = true;
1447
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
1448
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1449
            ViewerDataModel.Instance.Capture_Opacity = 0;
1450
        }
1451

    
1452
        /// <summary>
1453
        /// 사용자가 선택한 페이지로 이동(썸네일 동기화 시킴)
1454
        /// </summary>
1455
        /// <param name="sender"></param>
1456
        /// <param name="e"></param>
1457
        private void PageGoEvent(object sender, RoutedEventArgs e)
1458
        {
1459
            RadButton button = sender as RadButton;
1460
            var instanceMain = this.ParentOfType<MainWindow>();
1461
            
1462
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1463
            try
1464
            {
1465
                switch (button.CommandParameter.ToString())
1466
                {
1467
                    case "Down":
1468
                        {
1469
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) + 1);
1470
                        }
1471
                        break;
1472
                    case "Up":
1473
                        {
1474
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) - 1);
1475
                        }
1476
                        break;
1477
                }
1478
            }
1479
            catch (Exception)
1480
            {
1481
                RadWindow.Alert(new DialogParameters
1482
                {
1483
                    Owner = Application.Current.MainWindow,
1484
                    Theme = new VisualStudio2013Theme(),
1485
                    Header = "안내",
1486
                    Content = "페이지 번호를 정확하게 입력해 주세요",
1487
                });
1488
            }
1489
        }
1490

    
1491
        private void viewEvent(object sender, RoutedEventArgs e)
1492
        {
1493
            RadRibbonToggleButton viewButton = sender as RadRibbonToggleButton;
1494
            var instanceMain = this.ParentOfType<MainWindow>();
1495

    
1496
            Point point = new Point(instanceMain.dzMainMenu.zoomAndPanCanvas.Width / 2, instanceMain.dzMainMenu.zoomAndPanCanvas.Height / 2);
1497

    
1498
            //if ((sender as RadRibbonToggleButton) != null)
1499
            //{
1500
            //    Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString();
1501
            //    instanceToggle = (sender as RadRibbonToggleButton);
1502
            //}
1503

    
1504
            //instanceToggle.IsChecked = false;
1505

    
1506
            switch (viewButton.CommandParameter.ToString())
1507
            {
1508
                case "zoomout":
1509
                    {
1510
                        //장원
1511
                        //instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(new Rect(0, 0, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualWidth, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualHeight));
1512
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale -= 0.1, point);
1513
                        viewButton.IsChecked = false;
1514
                        //Common.ViewerDataModel.Instance.zom
1515
                    }
1516
                    break;
1517
                case "zoomin":
1518
                    {
1519
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale += 0.1, point);
1520
                        viewButton.IsChecked = false;
1521
                    }
1522
                    break;
1523
                case "fullscreen":
1524
                    {
1525
                        instanceMain.WindowState = WindowState.Maximized;
1526
                        //Sizemode 대기(강인구)
1527
                        //instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit;
1528
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1529
                        viewButton.IsChecked = false;
1530
                    }
1531
                    break;
1532
                case "fitWidth":
1533
                    {
1534
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1535
                        viewButton.IsChecked = false;
1536
                    }
1537
                    break;
1538
                case "fitHeight":
1539
                    {
1540
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1541
                        viewButton.IsChecked = false;
1542
                    }
1543
                    break;
1544
                case "boundzoom":
1545
                    {
1546

    
1547
                    }
1548
                    break;
1549
                case "Rotate_M":
1550
                    {
1551
                        drawingPannelRotate(false);
1552
                        viewButton.IsChecked = false;
1553
                    }
1554
                    break;
1555
                case "Rotate_P":
1556
                    {
1557
                        drawingPannelRotate(true);
1558
                        viewButton.IsChecked = false;
1559
                    }
1560
                    break;
1561
                case "Rotate_half":
1562
                    {
1563
                        drawingPannelRotate(true);
1564
                        drawingPannelRotate(true);
1565
                        viewButton.IsChecked = false;
1566
                    }
1567
                    break;
1568
            }
1569
        }
1570

    
1571
        private void Control_Event(object sender, RoutedEventArgs e)
1572
        {
1573

    
1574
        }
1575

    
1576
        #region 대기
1577

    
1578
        public void drawingPannelRotate(bool Flag)
1579
        {
1580
            var instanceMain = this.ParentOfType<MainWindow>();
1581

    
1582
            //if (rotateOffSet > 3)
1583
            //    rotateOffSet = 0;
1584

    
1585
            //if (rotateOffSet < 0)
1586
            //    rotateOffSet = 3;
1587

    
1588
            if(Flag)
1589
            {
1590
                if (instanceMain.dzMainMenu.rotate.Angle == 270)
1591
                {
1592
                    instanceMain.dzMainMenu.rotate.Angle = 0;
1593
                }
1594
                else
1595
                {
1596
                    instanceMain.dzMainMenu.rotate.Angle += 90;
1597
                }
1598
            }
1599
            else
1600
            {
1601
                if(instanceMain.dzMainMenu.rotate.Angle == 0)
1602
                {
1603
                    instanceMain.dzMainMenu.rotate.Angle = 270;
1604
                }
1605
                else
1606
                {
1607
                    instanceMain.dzMainMenu.rotate.Angle -= 90;
1608
                }
1609
            }
1610
            //double angle = (double)rotateValue.GetValue(rotateOffSet);
1611
            //instanceMain.dzMainMenu.rotate.Angle = angle;
1612
            var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90));
1613

    
1614
            if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth)
1615
            {
1616
                double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1617
                instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1618
                instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize;
1619
            }
1620
            if (instanceMain.dzMainMenu.rotate.Angle == 0)
1621
            {
1622
                instanceMain.dzMainMenu.translate.X = 0;
1623
                instanceMain.dzMainMenu.translate.Y = 0;
1624
            }
1625
            else if (instanceMain.dzMainMenu.rotate.Angle == 90)
1626
            {
1627
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1628
                instanceMain.dzMainMenu.translate.Y = 0;
1629
            }
1630
            else if (instanceMain.dzMainMenu.rotate.Angle == 180)
1631
            {
1632
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1633
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1634
            }
1635
            else
1636
            {
1637
                instanceMain.dzMainMenu.translate.X = 0;
1638
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1639
            }
1640

    
1641
            //instanceMain.dzMainMenu.zoomAndPanControl.RenderTransformOrigin = new Point(0.5, 0.5);
1642
            instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle;
1643
            //대기(강인구)
1644
            //instanceMain.dzMainMenu.imageViewer.RotateAngle = instanceMain.dzMainMenu.rotate.Angle;
1645

    
1646

    
1647
            //instanceMain.dzMainMenu.imageViewer.RenderTransformOrigin = new Point(0.5, 0.5);
1648
            //RotateTransform rotateTransform = new RotateTransform(instanceMain.dzMainMenu.rotate.Angle);
1649
            //instanceMain.dzMainMenu.imageViewer.RenderTransform = rotateTransform;
1650

    
1651

    
1652
            ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1653
            ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1654
            ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X;
1655
            ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y;
1656
            ViewerDataModel.Instance.Angle = instanceMain.dzMainMenu.rotate.Angle;
1657
            //ViewerDataModel.Instance.Document_Info.Clear();
1658
            //ViewerDataModel.Instance.Document_Info.Where(i => i.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(value =>
1659
            //{
1660
            //    value.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1661
            //});
1662

    
1663

    
1664
            //이미지 각도 변경 시 실시간 Thumbnail 각도 변경(강인구 추가)
1665
            instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Where(info => info.PageNumber == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(data =>
1666
            {
1667
                data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1668

    
1669
                instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems;
1670
                var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault();
1671
                instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1672

    
1673
                instanceMain.dzMainMenu.pageNavigator.setPageChange(data);
1674

    
1675
                //rotation page add or update
1676
                var rotationdoc = ViewerDataModel.Instance.RotationDocs.Where(d => d.ID == instance.ID).FirstOrDefault();
1677
                if (rotationdoc != null)
1678
                {
1679
                    rotationdoc.PAGE_ANGLE = instance.PAGE_ANGLE;
1680
                }
1681
                else
1682
                {
1683
                    ViewerDataModel.Instance.RotationDocs.Add(instance);
1684
                }
1685
            });
1686
        }
1687
        #endregion
1688

    
1689
        private void ImageConverter(RadToggleButton instanceToggle)
1690
        {
1691
            try
1692
            {           
1693
                var instanceMain = this.ParentOfType<MainWindow>();
1694
                //http://cloud.devdoftech.co.kr:5977/ImageUpload/FileUpload.asmx
1695

    
1696
                Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
1697
                dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png";
1698
                Nullable<bool> result = dlg.ShowDialog();
1699
                if (result == true)
1700
                {
1701
                    instanceMain.dzMainMenu.filename = dlg.FileName;
1702
                    instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1703

    
1704
                    System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename);
1705
                    String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename);
1706
                    long numByte = fileInfo.Length;
1707
                    double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
1708
                    kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
1709

    
1710
                    if (dLen < 4)
1711
                    {
1712
                        System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
1713
                        System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
1714
                        byte[] data = br.ReadBytes((int)numByte);
1715
                        br.Close();
1716

    
1717
                        string filepath = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data);
1718

    
1719
                        Check_Uri.UriCheck(filepath);
1720

    
1721
                        instanceMain.dzMainMenu.filename = filepath;
1722

    
1723
                        fStream.Close();
1724
                        fStream.Dispose();
1725
                    }
1726
                    else
1727
                    {
1728
                        this.ParentOfType<MainWindow>().DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert");
1729
                    }
1730
                }
1731
            }
1732
            catch(Exception ex)
1733
            {
1734
                instanceToggle.IsChecked = false;
1735
                Common.ViewerDataModel.Instance.SelectedControl = "";
1736
                Common.ViewerDataModel.Instance.ControlTag = null;
1737
                this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1738
                this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1739
                this.ParentOfType<MainWindow>().DialogMessage_Alert(""+ ex , "Alert");
1740
            }
1741
        }
1742

    
1743
        private void Control_Init(RadToggleButton instanceToggle, object sender)
1744
        {
1745

    
1746
        }
1747

    
1748
        private void ControlEvent(object sender, RoutedEventArgs e)
1749
        {
1750
            RadToggleButton instanceToggle = sender as RadToggleButton;
1751
            var instanceMain = this.ParentOfType<MainWindow>();
1752

    
1753
            #region Ctrl + A 눌렀을 때 대처 방법 
1754
            //원인 : Ctrl + A를 누르면 UIElementSet에 등록을 시키지 않는다(이유는 한꺼번에 많은 양의 컨트롤의 동작이 유입되기 때문에
1755
            //       시스템의 성능저하를 불러올 수 있기 때문이다. 그래서 선택 후 다른 컨트롤을 누르면 등록되지 않은 컨트롤이기 때문에 삭제된다
1756
            //       이를 대처하는 방법으로 아래 코드를 사용한다.
1757
            if (Common.ViewerDataModel.Instance.MarkupControls.Count == 0 && Common.ViewerDataModel.Instance.MarkupControls.Count >= 1)
1758
            {
1759
                //var lstItem = instanceMain.DeepLayer._SelectLayer.ChildrenOfType<AdornerFinal>().ToList();
1760
                //foreach (var item in lstItem)
1761
                //{
1762
                //    foreach (var member in item.MemberSet)
1763
                //    {
1764
                //        if (!instanceMain.DeepLayer.UIElementSet.Contains(member.DrawingData))
1765
                //        {
1766
                //            instanceMain.DeepLayer.UIElementSet.Add(member.DrawingData);
1767
                //        }
1768
                //    }
1769
                //}
1770
            }
1771
            #endregion
1772

    
1773
            //if (!instanceMain.IsFreeSelectionMode)
1774
            //{
1775
            //    instanceMain.IsSwingMode = true;
1776
            //}
1777

    
1778
            #region 다른 컨트롤 버튼 선택 해제
1779
            System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.SelectedControl).Subscribe(ControlState =>
1780
            {
1781
                if (ControlState == null)
1782
                {
1783
                    instanceToggle.IsChecked = false;
1784
                    HiddenControlHide();
1785
                }
1786
            });
1787
            #endregion
1788

    
1789
            Release_ToggleButton(sender); //-> 해당 컨트롤을 제외한 모든 컨트롤에 대해 해제 처리
1790

    
1791
            if (instanceToggle != null)
1792
            {
1793
                Common.ViewerDataModel.Instance.ControlTag = instanceToggle.Tag.ToString();
1794
            }
1795
            else if ((sender as RadRibbonToggleButton) != null)
1796
            {
1797
                Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString();
1798
                instanceToggle = (sender as RadRibbonToggleButton);
1799
            }
1800
            else if ((sender as RadRibbonButton) != null)
1801
            {
1802
                RadRibbonButton instanceButton = sender as RadRibbonButton;
1803
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1804
            }
1805
            else
1806
            {
1807
                RadButton instanceButton = sender as RadButton;
1808
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1809
            }
1810

    
1811

    
1812

    
1813
            System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleVisibility).Subscribe(isSee =>
1814
            {
1815
                instanceMain.dzMainMenu.MainAngle.Visibility = isSee;
1816
                System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleValue).Subscribe(p =>
1817
                {
1818
                    instanceMain.dzMainMenu.MainAngle.AngleValue = p;
1819
                });
1820
            });
1821
            instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
1822

    
1823
            instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
1824

    
1825
            if (instanceToggle.IsChecked != false)
1826
            {
1827
                #region 컨트롤이 체크되었다면
1828
                switch (instanceToggle.CommandParameter.ToString())
1829
                {
1830
                    #region Line
1831
                    case "Line":
1832
                        Common.ViewerDataModel.Instance.SelectedControl = "Line";
1833
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1834
                        if (instanceToggle.Tag.ToString() == "LineDelete")
1835
                        {
1836
                            //HiddenInterval.Visibility = Visibility.Visible;
1837
                        }
1838
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.SingleLine;
1839
                        break;
1840
                    #endregion
1841
                    #region ChainLine
1842
                    case "ChainLine":
1843
                        Common.ViewerDataModel.Instance.SelectedControl = "ChainLine";
1844
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1845
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ChainLine;
1846
                        break;
1847
                    #endregion
1848
                    #region DimLine
1849
                    case "DimLine":
1850
                        Common.ViewerDataModel.Instance.SelectedControl = "DimLine";
1851
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1852
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.DimLine;
1853
                        break;
1854
                    #endregion
1855
                    #region TwinLine
1856
                    case "TwinLine":
1857
                        Common.ViewerDataModel.Instance.SelectedControl = "TwinLine";
1858
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1859
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TwinLine;
1860
                        break;
1861
                    #endregion
1862
                    #region CancelLine
1863
                    case "CancelLine":
1864
                        Common.ViewerDataModel.Instance.SelectedControl = "CancelLine";
1865
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1866
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.CancelLine;
1867
                        break;
1868
                    #endregion
1869
                    #region PolygonCloud
1870
                    case "PolygonCloud":
1871
                        Common.ViewerDataModel.Instance.SelectedControl = "PolygonCloud";
1872
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1873
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonCloud;
1874
                        break;
1875
                    #endregion
1876
                    #region RectCloud
1877
                    case "RectCloud":
1878
                        Common.ViewerDataModel.Instance.SelectedControl = "RectCloud";
1879
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1880
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.RectCloud;
1881
                        break;
1882
                    #endregion
1883
                    #region Rectangle
1884
                    case "Rectangle":
1885
                        Common.ViewerDataModel.Instance.SelectedControl = "Rectangle";
1886
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1887
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Rectangle;
1888
                        break;
1889
                    #endregion
1890
                    #region Triangle
1891
                    case "Triangle":
1892
                        Common.ViewerDataModel.Instance.SelectedControl = "Triangle";
1893
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1894
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Triangle;
1895
                        break;
1896
                    #endregion
1897
                    #region RectCloud
1898
                    case "Circle":
1899
                        Common.ViewerDataModel.Instance.SelectedControl = "Circle";
1900
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1901
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Circle;
1902
                        break;
1903
                    #endregion
1904
                    #region Symbol
1905
                    case "Symbol":
1906
                        Common.ViewerDataModel.Instance.SelectedControl = "Symbol";
1907
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1908
                        break;
1909
                    #endregion
1910
                    #region SymbolN
1911
                    case "SymbolN":
1912
                        Common.ViewerDataModel.Instance.SelectedControl = "SymbolN";
1913
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Stamp;
1914
                        break;
1915
                    #endregion
1916
                    #region Text
1917
                    case "Text":
1918
                        Common.ViewerDataModel.Instance.SelectedControl = "Text";
1919
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1920
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextControl;
1921
                        break;
1922
                    #endregion
1923
                    #region TextBorder
1924
                    case "TextBorder":
1925
                        Common.ViewerDataModel.Instance.SelectedControl = "TextBorder";
1926
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1927
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextBorder;
1928
                        break;
1929
                    #endregion
1930
                    #region TextCloud
1931
                    case "TextCloud":
1932
                        Common.ViewerDataModel.Instance.SelectedControl = "TextCloud";
1933
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1934
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextCloud;
1935
                        break;
1936
                    #endregion
1937
                    #region Date
1938
                    case "Date":
1939
                        Common.ViewerDataModel.Instance.SelectedControl = "Date";
1940
                        TaskMessage("날짜 컨트롤을 더블 클릭하면 날짜를 변경할 수 있습니다", TaskMessageType.Normal);
1941
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Date;
1942
                        break;
1943
                    #endregion
1944
                    #region ArrowText
1945
                    case "ArrowText":
1946
                        TaskMessage("ArrowText 컨트롤은 그린 후 컨트롤을 선택하였을 시 중간점을 조정할 수 있습니다", TaskMessageType.Normal);
1947
                        if (instanceToggle.Tag.ToString() == "ArrowText_Cloud")
1948
                        {
1949
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowText_Cloud";
1950
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl;
1951
                        }
1952
                        else if (instanceToggle.Tag.ToString() == "ArrowText_Border")
1953
                        {
1954
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTextBorderControl";
1955
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl;
1956
                        }
1957
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Normal")
1958
                        {
1959
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextControl";
1960
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl;
1961
                        }
1962
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Border")
1963
                        {
1964
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextBorderControl";
1965
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl;
1966
                        }
1967
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Cloud")
1968
                        {
1969
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextCloudControl";
1970
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl;
1971
                        }
1972
                        else
1973
                        {
1974
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowText";
1975
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextControl;
1976
                            //HiddenAxisLock.Visibility = Visibility.Visible;
1977
                        }
1978
                        break;
1979
                    #endregion
1980
                    #region Arrow
1981
                    case "Arrow":
1982
                        Common.ViewerDataModel.Instance.SelectedControl = "Arrow";
1983
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1984
                        //HiddenDimSize.Visibility = Visibility.Visible;
1985
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowLine;
1986
                        break;
1987
                    #endregion
1988
                    #region Shape
1989
                    case "Shape":
1990
                        Common.ViewerDataModel.Instance.SelectedControl = "Shape";
1991
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
1992
                        break;
1993
                    #endregion
1994
                    #region Polygon
1995
                    case "Polygon":
1996
                        Common.ViewerDataModel.Instance.SelectedControl = "Polygon";
1997
                        TaskMessage("자유형 코멘트 도구는 오른쪽 마우스 클릭을 통해 그리기를 마칠 수 있습니다", TaskMessageType.Normal);
1998
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1999
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonControl;
2000
                        break;
2001
                    #endregion
2002
                    #region Arc
2003
                    case "Arc":
2004
                        Common.ViewerDataModel.Instance.SelectedControl = "Arc";
2005
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcLine;
2006
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2007
                        TaskMessage("Arc 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal);
2008
                        break;
2009
                    #endregion
2010
                    #region ArrowArc
2011
                    case "ArrowArc":
2012
                        Common.ViewerDataModel.Instance.SelectedControl = "ArrowArc";
2013
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcArrow;
2014
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2015
                        TaskMessage("ArcArrow 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal);
2016
                        break;
2017
                    #endregion
2018
                    #region ArrowMulti
2019
                    case "ArrowMulti":
2020
                        Common.ViewerDataModel.Instance.SelectedControl = "ArrowMulti";
2021
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowMultiLine;
2022
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2023
                        break;
2024
                    #endregion
2025
                    #region Etc
2026
                    case "Etc":
2027
                        Common.ViewerDataModel.Instance.SelectedControl = "Etc";
2028
                        break;
2029
                    #endregion
2030
                    #region Ink
2031
                    case "Ink":
2032
                        if (instanceToggle.Tag.ToString() == "EraserClear")
2033
                        {
2034
                            TaskMessage("해당 컨트롤은 점 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal);
2035
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
2036
                            instanceMain.dzMainMenu.inkBoard.Tag = "EraseByPoint";
2037
                        }
2038
                        else if (instanceToggle.Tag.ToString() == "Eraser")
2039
                        {
2040
                            TaskMessage("해당 컨트롤은 선 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal);
2041
                            instanceMain.dzMainMenu.inkBoard.Tag = "EraseByStroke";
2042
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
2043
                        }
2044
                        else
2045
                        {
2046
                            instanceMain.dzMainMenu.inkBoard.Tag = "Ink";
2047
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.Ink;
2048
                        }
2049

    
2050
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = true;
2051

    
2052
                        Common.ViewerDataModel.Instance.SelectedControl = "Ink";
2053
                        Common.ViewerDataModel.Instance.LineSize = (double)cbLineSize.Value;
2054
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PenControl;
2055
                        break;
2056
                    #endregion
2057
                    #region Select
2058
                    case "Select":
2059
                        if(this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2060
                        {
2061
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2062
                            this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2063
                        }
2064
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting;
2065
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2066
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2067
                        break;
2068
                    #endregion
2069
                    #region Image
2070
                    case "Image":
2071
                        Common.ViewerDataModel.Instance.SelectedControl = "ImgControl";
2072
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
2073
                        ImageConverter(instanceToggle);
2074
                        break;
2075
                    #endregion
2076
                    #region Sign
2077
                    case "Sign":
2078
                        Common.ViewerDataModel.Instance.SelectedControl = "Sign";
2079
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
2080
                        //강인구 추가
2081
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Sign;
2082
                        //instanceMain.BaseClient.GetUserSignCompleted += (sen, ea) =>
2083
                        //{
2084
                        //    if (ea.Result == null)
2085
                        //    {
2086

    
2087
                        //        this.ParentOfType<MainPage>().DialogMessage_Alert("You Don't Have Sign Data", "Alert");
2088
                        //    }
2089
                        //    else
2090
                        //    {
2091
                        //        byte[] imageBytes = System.Convert.FromBase64String(ea.Result);
2092
                        //        using (MemoryStream ms = new MemoryStream(imageBytes))
2093
                        //        {
2094
                        //            BitmapImage im = new BitmapImage();
2095
                        //            im.SetSource(ms);
2096
                        //            instanceMain.DeepLayer.SignImage = im;
2097
                        //            ms.Close();
2098
                        //        }
2099
                        //    }
2100
                        //};
2101
                        //instanceMain.BaseClient.GetUserSignAsync(instanceMain._ViewInfo.UserID);
2102
                        break;
2103
                    #endregion
2104
                    #region Check
2105
                    case "Check":
2106
                        Common.ViewerDataModel.Instance.SelectedControl = "Check";
2107
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
2108
                        //강인구 추가
2109
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Symbol;
2110
                        break;
2111
                    #endregion
2112
                    #region Batch
2113
                    case "Batch":
2114
                        Common.ViewerDataModel.Instance.SelectedControl = "Batch";
2115
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
2116
                        //강인구 추가
2117
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
2118
                        instanceMain.dzMainMenu.txtBatch.Visibility = Visibility.Visible;
2119
                        instanceMain.dzMainMenu.txtBatch.Text = "Place Mark";
2120
                        break;
2121
                    #endregion
2122
                    #region Copy
2123
                    case "Copy":
2124
                        Copy_Start();
2125
                        instanceToggle.IsChecked = false;
2126
                        ViewerDataModel.Instance.SelectedControl = "";
2127
                        ViewerDataModel.Instance.ControlTag = null;
2128
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2129
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2130
                        break;
2131
                    #endregion
2132
                    #region Cut
2133
                    case "Cut":
2134
                        Cut_Start();
2135
                        instanceToggle.IsChecked = false;
2136
                        ViewerDataModel.Instance.SelectedControl = "";
2137
                        ViewerDataModel.Instance.ControlTag = null;
2138
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2139
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2140
                        break;
2141
                    #endregion
2142
                    #region Paste
2143
                    case "Paste":
2144
                        Paste_Start();
2145
                        instanceToggle.IsChecked = false;
2146
                        ViewerDataModel.Instance.SelectedControl = "";
2147
                        ViewerDataModel.Instance.ControlTag = null;
2148
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2149
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;                        
2150
                        break;
2151
                    #endregion
2152
                    #region Delete
2153
                    case "Delete":
2154
                        DeleteCommand.Instance.Execute(this.ParentOfType<MainWindow>().SelectedItems);
2155
                        this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear();
2156

    
2157
                        instanceToggle.IsChecked = false;
2158
                        ViewerDataModel.Instance.SelectedControl = "";
2159
                        ViewerDataModel.Instance.ControlTag = null;
2160
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2161
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2162
                        break;
2163
                    #endregion
2164
                    #region Undo
2165
                    case "Undo":
2166
                        this.ParentOfType<MainWindow>().dzMainMenu.Undo();
2167
                        instanceToggle.IsChecked = false;
2168
                        ViewerDataModel.Instance.SelectedControl = "";
2169
                        ViewerDataModel.Instance.ControlTag = null;
2170
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2171
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2172
                        break;
2173
                    #endregion
2174
                    #region Redo
2175
                    case "Redo":
2176
                        this.ParentOfType<MainWindow>().dzMainMenu.Redo();
2177
                        instanceToggle.IsChecked = false;
2178
                        ViewerDataModel.Instance.SelectedControl = "";
2179
                        ViewerDataModel.Instance.ControlTag = null;
2180
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2181
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2182
                        break;
2183
                    #endregion
2184
                    #region DragZoom
2185
                    case "DragZoom":
2186
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.DragZoom;
2187
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2188
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2189
                        break;
2190
                    #endregion
2191
                    #region Grouping
2192
                    case "Group":
2193
                        var GrouptoggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2194
                        foreach (var togle in GrouptoggleList)
2195
                        {
2196
                            togle.IsChecked = false;
2197
                        }
2198

    
2199
                        if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2200
                        {
2201
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2202
                            this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2203
                        }
2204
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2205
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2206
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2207
                        if (ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면
2208
                        {
2209
                            this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Please Select Controls", "Alert");
2210
                        }
2211
                        else//if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2212
                        {
2213
                            // string MarkupData = "";
2214
                            foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2215
                            {
2216
                                if (item.GetType().Name == "AdornerFinal" && (item as AdornerFinal).MemberSet.Count >= 2) // 얘가 2개 이상이여야 그룹가능 버튼도 막을거긴하지만 일단..
2217
                                {
2218
                                    //MARKUP_DATA_GROUP INSERT
2219
                                    MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP
2220
                                    {
2221
                                        SYMBOL_ID = null,//InnerItem.Symbol_ID
2222
                                        STATE = 0,
2223
                                    };
2224
                                    long group_id = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMarkupDataGroup(mARKUP_DATA_GROUP, App.ViewInfo.ProjectNO);
2225
                                    Logger.sendReqLog("AddMarkupDataGroup: ", "", 1);
2226
                                    if (group_id > 0)
2227
                                    {
2228
                                        foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2229
                                        {
2230
                                            if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2231
                                            {
2232
                                                //MARKUP_DATA UPDATE
2233
                                                //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, group_id, App.ViewInfo.ProjectNO);
2234
                                                //Logger.sendReqLog("UpdateMarkupData: ", "", 1);
2235
                                                ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = group_id;
2236
                                                ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true;
2237
                                            }
2238
                                        }
2239
                                    }
2240
                                }
2241
                            }
2242
                        }
2243
                        break;
2244
                    case "UnGroup":
2245
                        var UnGrouptoggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2246
                        foreach (var togle in UnGrouptoggleList)
2247
                        {
2248
                            togle.IsChecked = false;
2249
                        }
2250
                        if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2251
                        {
2252
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2253
                            this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2254
                        }
2255
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2256
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2257
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2258

    
2259
                        if (ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면
2260
                        {
2261
                            this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Please Select Controls", "Alert");
2262
                        }
2263
                        else//if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2264
                        {
2265
                            // string MarkupData = "";
2266
                            foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2267
                            {
2268
                                if (item.GetType().Name == "AdornerFinal" && (item as AdornerFinal).MemberSet.Count >= 1) // 1개 이상 
2269
                                {
2270
                                    //MARKUP_DATA UPDATE
2271
                                    foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2272
                                    {
2273
                                        if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2274
                                        {
2275
                                            long group_id = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault().Group_ID;
2276
                                            //MARKUP_DATA UPDATE
2277
                                            //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, 0, App.ViewInfo.ProjectNO);
2278
                                            //Logger.sendReqLog("UpdateMarkupData: ", "", 1);
2279
                                            ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = 0;
2280
                                            ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true;
2281

    
2282

    
2283
                                            //MARKUP_DATA_GROUP UPDATE
2284
                                            bool value = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupDataGroup(group_id, App.ViewInfo.ProjectNO);
2285
                                            Logger.sendReqLog("AddMarkupDataGroup: ", value.ToString(), 1);
2286
                                        }
2287
                                    }
2288
                                }
2289
                            }
2290
                        }
2291
                        break;
2292
                    #endregion
2293
                    #region Capture
2294
                    case "Capture":
2295
                        SyncInit();
2296
                        //   instanceToggle.IsChecked = false;
2297
                        var CaptureList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2298
                        foreach (var togle in CaptureList)
2299
                        {
2300
                            togle.IsChecked = false;
2301
                        }
2302

    
2303
                        if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2304
                        {
2305
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2306
                            this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2307
                        }
2308

    
2309
                        ViewerDataModel.Instance.SelectedControl = "ImgControl";
2310
                   //     ViewerDataModel.Instance.ControlTag = null;
2311
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
2312

    
2313
                        /*
2314
                        //캡쳐 하기 전에 코멘트 저장
2315
                        if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (Application.Current.MainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0)
2316
                        {
2317
                            var menu = (Application.Current.MainWindow as MainWindow).dzMainMenu;
2318
                            menu.ReleaseAdorner();
2319
                            if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
2320
                            {
2321
                                (Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu);
2322
                            }
2323
                            else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
2324
                            {
2325

    
2326
                            }
2327
                            else
2328
                            {
2329
                                (Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu);
2330
                            }
2331
                        }*/
2332

    
2333
                        //Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).ID;
2334
                        //Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Image).DataContext as Customer).ID;
2335
                        //Common.ViewerDataModel.Instance.PageNumber = ((e.Source as Image).DataContext as Customer).PAGENUMBER;
2336
                        Application.Current.MainWindow.Focus();
2337
                        Common.ViewerDataModel.Instance.Capture_Opacity = 0.49;
2338
                        (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture;
2339
                        break;
2340
                    #endregion
2341
                    #region Cad
2342
                    case "Inside":
2343
                        //instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
2344
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
2345
                        Common.ViewerDataModel.Instance.SelectedControl = "InsideWhite";
2346
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.InsideWhite;
2347
                        break;
2348
                    case "Overlap":
2349
                        //instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
2350
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
2351
                        Common.ViewerDataModel.Instance.SelectedControl = "OverlapWhite";
2352
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.OverlapWhite;
2353
                        break;
2354
                    case "Clip":
2355
                        //instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
2356
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
2357
                        Common.ViewerDataModel.Instance.SelectedControl = "ClipWhite";
2358
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ClipWhite;
2359
                        break;
2360
                    case "CadExport":
2361
                        if (isClosed)
2362
                        {
2363
                            //토글 및 마우스 상태 초기화
2364
                            var toggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2365
                            foreach (var togle in toggleList)
2366
                            {
2367
                                togle.IsChecked = false;
2368
                            }
2369
                            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2370

    
2371
                            isClosed = false;
2372
                            //Control 파일 먼저 생성
2373
                            CollapsedButton_Click();
2374
                            CadViewer check = new CadViewer();
2375
                            check.WindowStartupLocation = WindowStartupLocation.CenterScreen;
2376
                            check.Title = "Export Viewer";
2377
                            //check.Topmost = true;
2378
                            check.Show();
2379
                            check.Closed += Check_Closed;
2380
                            instanceToggle.IsChecked = false;
2381
                        }
2382
                        break;
2383
                    case "CadViewer":
2384
                        if (isClosed)
2385
                        {
2386
                            //토글 및 마우스 상태 초기화
2387
                            var toggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2388
                            foreach (var togle in toggleList)
2389
                            {
2390
                                togle.IsChecked = false;
2391
                            }
2392
                            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2393

    
2394
                            isClosed = false;
2395
                            CadResultViewer check = new CadResultViewer();
2396
                            check.WindowStartupLocation = WindowStartupLocation.CenterScreen;
2397
                            check.Title = "Viewer";
2398
                            check.Show();
2399

    
2400
                            check.Closed += Check_Closed;
2401

    
2402
                        }
2403
                        break;
2404
                    #endregion
2405
                    default:
2406
                        break;
2407
                }
2408
                #endregion
2409
            }
2410
            else
2411
            {
2412

    
2413
                if (!instanceMain.dzMainMenu.IsFreeSelectionMode)
2414
                {
2415
                    instanceMain.dzMainMenu.IsSwingMode = false;
2416
                    Common.ViewerDataModel.Instance.SelectedControl = "";
2417
                    Common.ViewerDataModel.Instance.ControlTag = null;
2418
                    this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2419
                    this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2420
                }
2421
            }
2422
        }
2423

    
2424
        private void SyncInit()
2425
        {
2426
            try
2427
            {
2428
                if (!ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden)
2429
                {
2430
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden = true;
2431
                    ViewerDataModel.Instance.PageBalanceMode = false;
2432
                    ViewerDataModel.Instance.PageBalanceNumber = 0;
2433
                    ViewerDataModel.Instance.PageNumber = 0;
2434
                    ViewerDataModel.Instance.MarkupControls_Sync.Clear();
2435
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewRevMarkup.Visibility = Visibility.Collapsed;
2436
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.UserList.IsChecked = false;
2437
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.BalanceMode.IsChecked = false;
2438
                }
2439
            }
2440
            catch (Exception ex)
2441
            {
2442
                Logger.sendResLog("SyncInit", ex.Message, 0);
2443
            }
2444

    
2445
        }
2446

    
2447
        Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
2448
        CommentUserInfo currentControl { get; set; }
2449
        private Point GetSquareEndPoint(Point StartP, Point EndP)
2450
        {
2451
            Point Return_Point = new Point();
2452
            double dx = EndP.X - StartP.X;
2453
            double dy = EndP.Y - StartP.Y;
2454
            double length;
2455
            length = Math.Max(Math.Abs(dx), Math.Abs(dy));
2456
            Return_Point.X = (dx > 0) ? StartP.X + length : StartP.X - length;
2457
            Return_Point.Y = (dy > 0) ? StartP.Y + length : StartP.Y - length;
2458
            return Return_Point;
2459
        }
2460
        private void Check_Closed(object sender, EventArgs e)
2461
        {
2462
            isClosed = true;
2463
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
2464
            //토글 및 마우스 상태 초기화
2465
            var toggleList = this.Parent.ChildrenOfType<RadToggleButton>();
2466
            foreach (var togle in toggleList)
2467
            {
2468
                togle.IsChecked = false;
2469
            }
2470
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2471
            ViewerDataModel.Instance.Capture_Opacity = 0;
2472

    
2473
        }
2474

    
2475
        /* public class test 
2476
         {
2477
             public double width { get; set; }
2478
             public double height { get; set; }
2479
         }
2480
         */
2481
        private void CollapsedButton_Click()
2482
        {
2483
            this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); // 저장하지 못한 데이터가 있다면 저장
2484

    
2485
            string[] data = new string[0];
2486

    
2487
            int cnt = 0;
2488
            var menu = this.ParentOfType<MainWindow>().dzMainMenu;
2489

    
2490
            List<MarkupInfoItem> gridSelectionItem = menu.gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
2491

    
2492
            foreach (var item in gridSelectionItem)
2493
            {
2494
                if ((item.UserID == App.ViewInfo.UserID) && (ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage != null))
2495
                {
2496
                    var instance = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.PageNumber == ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber &&
2497
                    d.MarkupInfoID == item.MarkupInfoID).ToList();
2498
                    data = new string[instance.Count];
2499
                    foreach (var markup in instance)
2500
                    {
2501
                        data[cnt++] = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString(markup.Data);
2502
                    }
2503
                }
2504
            }
2505

    
2506
            if (data != null)
2507
            {
2508
                string FilePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Cad");
2509
                string FileName = FilePath + "\\commentstring.json"; // Default file name
2510
                if (!File.Exists(FilePath))
2511
                {
2512
                    Directory.CreateDirectory(FilePath);
2513
                }
2514

    
2515
                if (!string.IsNullOrEmpty(FileName))
2516
                {
2517
                    //  File.WriteAllText(SaveDig.FileName, data);
2518
                    File.WriteAllLines(FileName, data);
2519
                }
2520
            }
2521
        }
2522

    
2523
        private double minHeight;
2524
        private double minWidth;
2525

    
2526
        private double maxHeight;
2527
        private double maxWidth;
2528

    
2529
        public bool CanVResize { get; private set; }
2530
        public bool CanHResize { get; private set; }
2531

    
2532
        public void DesignerComponent(FrameworkElement content)
2533
        {
2534
            this.InitializeComponent();
2535

    
2536
            if (!double.IsNaN(content.Width))
2537
            {
2538
                CanHResize = false;
2539
                this.Width = content.Width;
2540
            }
2541
            else
2542
            {
2543
                CanHResize = true;
2544
                this.Width = 23.0;
2545
            }
2546
            if (!double.IsNaN(content.Height))
2547
            {
2548
                CanVResize = false;
2549
                this.Height = content.Height; ;
2550
            }
2551
            else
2552
            {
2553
                CanVResize = true;
2554
                this.Height = 23.0;
2555
            }
2556

    
2557
            minWidth = content.MinWidth < 10.0 ? 10.0 : content.MinWidth;
2558
            minHeight = content.MinHeight < 10.0 ? 10.0 : content.MinHeight;
2559
            maxWidth = content.MaxWidth;
2560
            maxHeight = content.MaxHeight;
2561

    
2562
            double top = (double)content.GetValue(Canvas.TopProperty);
2563
            if (double.IsNaN(top))
2564
                top = 0.0;
2565
            double left = (double)content.GetValue(Canvas.LeftProperty);
2566
            if (double.IsNaN(left))
2567
                left = 0.0;
2568
            SetValue(Canvas.TopProperty, top);
2569
            SetValue(Canvas.LeftProperty, left);
2570

    
2571
            //Set the actual content. Note that "Content" property is a new property. See below
2572
            this.Content = content;
2573
        }
2574
        private void Thumb_DragDelta(object sender, DragDeltaEventArgs e)
2575
        {
2576
            string name = ((Thumb)sender).Name;
2577
            if (name.Contains("Top"))
2578
            {
2579
                double newHeight = this.Height - e.VerticalChange;
2580
                if (newHeight >= minHeight && newHeight <= maxHeight)
2581
                {
2582
                    this.Height = newHeight;
2583
                    SetValue(Canvas.TopProperty,
2584
                (double)GetValue(Canvas.TopProperty) + e.VerticalChange);
2585
                }
2586
            }
2587
            if (name.Contains("Right"))
2588
            {
2589
                double newWidth = this.Width + e.HorizontalChange;
2590
                if (newWidth >= minWidth && newWidth <= maxWidth)
2591
                    this.Width = newWidth;
2592
            }
2593
            if (name.Contains("Bottom"))
2594
            {
2595
                double newHeight = this.Height + e.VerticalChange;
2596
                if (newHeight >= minHeight && newHeight <= maxHeight)
2597
                    this.Height = newHeight;
2598
            }
2599
            if (name.Contains("Left"))
2600
            {
2601
                double newWidth = this.Width - e.HorizontalChange;
2602
                if (newWidth >= minWidth && newWidth <= maxWidth)
2603
                {
2604
                    this.Width = newWidth;
2605
                    SetValue(Canvas.LeftProperty,
2606
                (double)GetValue(Canvas.LeftProperty) + e.HorizontalChange);
2607
                }
2608
            }
2609
        }
2610

    
2611
        private void drawControlBorder(object sender)
2612
        {
2613
            System.Windows.Controls.Control control = (System.Windows.Controls.Control)sender;
2614
        }
2615

    
2616
        private void ResizeThumb_DragDelta(object sender, MouseButtonEventArgs e)
2617
        {
2618
            System.Windows.Controls.Control designerItem = (System.Windows.Controls.Control)sender;
2619
            if (designerItem != null)
2620
            {
2621
                double deltaVertical, deltaHorizontal;
2622

    
2623
                switch (VerticalAlignment)
2624
                {
2625
                    case VerticalAlignment.Bottom:
2626
                        deltaVertical = designerItem.ActualHeight - designerItem.MinHeight;
2627
                        designerItem.Height -= deltaVertical;
2628
                        break;
2629
                    case VerticalAlignment.Top:
2630
                        deltaVertical = designerItem.ActualHeight - designerItem.MinHeight;
2631
                        Canvas.SetTop(designerItem, Canvas.GetTop(designerItem) + deltaVertical);
2632
                        designerItem.Height -= deltaVertical;
2633
                        break;
2634
                    default:
2635
                        break;
2636
                }
2637

    
2638
                switch (HorizontalAlignment)
2639
                {
2640
                    case HorizontalAlignment.Left:
2641
                        deltaHorizontal = designerItem.ActualWidth - designerItem.MinWidth;
2642
                        Canvas.SetLeft(designerItem, Canvas.GetLeft(designerItem) + deltaHorizontal);
2643
                        designerItem.Width -= deltaHorizontal;
2644
                        break;
2645
                    case HorizontalAlignment.Right:
2646
                        deltaHorizontal = designerItem.ActualWidth - designerItem.MinWidth;
2647
                        designerItem.Width -= deltaHorizontal;
2648
                        break;
2649
                    default:
2650
                        break;
2651
                }
2652
            }
2653
            e.Handled = true;
2654
        }
2655

    
2656
        SaveFileDialog SaveDig = new SaveFileDialog(); //파일 세이브 다이얼로그
2657

    
2658
        void ExportMethod()
2659
        {
2660
            //FileDialogFilter filterImage = new FileDialogFilter("Image Files", "*.jpg", "*.png");
2661
            SaveDig.Filter = "PDF file format|*.pdf";
2662
            SaveDig.Title = "Save an DWG File";
2663
            SaveDig.ShowDialog();
2664
        }
2665

    
2666
        private void cbAutoSave_Checked(object sender, RoutedEventArgs e)
2667
        {            
2668
            if (cbAutoSave.IsChecked == true)
2669
            {
2670
                SaveTime(true, (int)cbSaveInterval.Value);
2671
            }
2672
            else
2673
            {
2674
                SaveTime(false, (int)cbSaveInterval.Value);
2675
            }
2676
        }
2677
        private void cbSaveInterval_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
2678
        {
2679
            if(string.IsNullOrEmpty(cbSaveInterval.Value.ToString()))
2680
            {
2681
                cbSaveInterval.Value = cbSaveInterval.Minimum;
2682
            }
2683
            if (cbAutoSave.IsChecked == true)
2684
            {
2685
                SaveTime(true, (int)cbSaveInterval.Value);
2686
            }
2687

    
2688
            KCOM.Properties.Settings.Default.SaveInterval = (double)cbSaveInterval.Value;
2689
            Properties.Settings.Default.Save();
2690
        }
2691
        //강인구 자동 저장 추가
2692
        private void AutoSave(object sender, RoutedEventArgs e)
2693
        {
2694
            RadToggleButton instanceToggle = sender as RadToggleButton;
2695

    
2696
            if(instanceToggle.IsChecked == true)
2697
            {
2698
                SaveTime(true);
2699
            }
2700
            else
2701
            {
2702
                SaveTime(false);
2703
            }
2704
        }
2705

    
2706
        public void Copy_Start()
2707
        {
2708
            if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2709
            {
2710
                string MarkupData = "";
2711

    
2712
                foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2713
                {
2714
                    if (item.GetType().Name == "AdornerFinal")
2715
                    {
2716
                        foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2717

    
2718
                        {
2719
                            if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2720
                            {
2721
                                markupReturn = MarkupParser.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID);
2722
                                MarkupData += "|OR|" + markupReturn.ConvertData;
2723
                            }
2724
                        }
2725
                        Clipboard.SetText(MarkupData);
2726
                    }
2727
                }
2728
            }
2729
        }
2730

    
2731
        public void Cut_Start()
2732
        {
2733
            if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2734
            {
2735
                foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2736
                {
2737
                    string MarkupData = "";
2738

    
2739
                    if (item.GetType().Name == "AdornerFinal")
2740
                    {
2741
                        foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2742
                        {
2743
                            if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2744
                            {
2745
                                markupReturn = MarkupParser.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID);
2746
                                MarkupData += "|OR|" + markupReturn.ConvertData;
2747
                            }
2748
                        }
2749
                        //클립보드에 넣음
2750
                        Clipboard.SetText(MarkupData);
2751
                    }
2752
                }
2753
                this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear();
2754
            }
2755
        }
2756

    
2757
        public void Paste_Start()
2758
        {
2759
            //마크업 붙여넣기
2760
            //if (Clipboard.GetText().Contains("|DZ|"))
2761
            if (Clipboard.GetText().Contains("|OR||DZ|"))
2762
            {
2763
                List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>();
2764

    
2765
                string[] delimiterChars = { "|OR|" };
2766
                string[] data = Clipboard.GetText().Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
2767

    
2768
                SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu);
2769

    
2770
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
2771

    
2772
                //강인구 Undo/Redo 보류
2773
                UndoData = new Undo_data()
2774
                {
2775
                    IsUndo = false,
2776
                    Event = Event_Type.Create,
2777
                    EventTime = DateTime.Now,
2778
                    Markup_List = new List<Multi_Undo_data>()
2779
                };
2780

    
2781
                ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i =>
2782
                {
2783
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
2784
                });
2785

    
2786
                foreach (string parse in data)
2787
                {
2788
                    if (parse != "")
2789
                    {
2790
                        System.Windows.Controls.Control item = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, parse, ViewerDataModel.Instance.MarkupControls_USER, string.Empty, string.Empty);
2791
                        (item as MarkupToPDF.Common.CommentUserInfo).CommentID = Commons.shortGuid();
2792

    
2793
                        ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo);
2794
                        ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo);
2795

    
2796
                        adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo);
2797

    
2798
                        //Controls.AdornerFinal final = new Controls.AdornerFinal(item as MarkupToPDF.Common.CommentUserInfo);
2799
                        //this.dzMainMenu.SelectLayer.Children.Add(final);
2800

    
2801
                        multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo);
2802

    
2803
                        UndoData.Markup_List.Add(multi_Undo_Data);
2804
                        ViewerDataModel.Instance.UndoDataList.Add(UndoData);                        
2805
                    }
2806
                }
2807
                Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet);
2808

    
2809
                if(this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X < 0)
2810
                {
2811
                    Canvas.SetLeft(final, 0);
2812
                    Canvas.SetTop(final, 0);
2813
                }
2814
                else
2815
                {
2816
                    double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2);
2817
                    double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2);
2818
                    final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
2819

    
2820
                    if (final.MemberSet.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null)
2821
                    {
2822
                        final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(0.001, 0.001)); //dummy
2823
                    }
2824

    
2825
                }
2826
                
2827

    
2828
                this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final);
2829

    
2830
                //붙여 넣을때 원본 컨트롤과 겹치지 않도록 설정
2831
                //Canvas.SetLeft(final, 50);
2832
                //Canvas.SetTop(final, 50);
2833
            }
2834
            //외부 이미지 붙여넣기
2835
            else if (Clipboard.GetImage() != null)
2836
            {
2837
                try
2838
                {
2839
                    Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
2840

    
2841
                    //강인구 Undo/Redo 보류
2842
                    UndoData = new Undo_data()
2843
                    {
2844
                        IsUndo = false,
2845
                        Event = Event_Type.Create,
2846
                        EventTime = DateTime.Now,
2847
                        Markup_List = new List<Multi_Undo_data>()
2848
                    };
2849

    
2850

    
2851
                    string temppath = System.IO.Path.GetTempPath();
2852
                    //string filename = KCOM.Events.Save.shortCommentKey();
2853
                    string filename = Commons.shortFileKey();
2854

    
2855
                    System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage();
2856
                    clipboardImage.Save(temppath + "\\" + filename);
2857

    
2858
                    System.IO.FileInfo fileInfo = new System.IO.FileInfo(temppath + "\\" + filename);
2859
                    String strFile = System.IO.Path.GetFileName(fileInfo.FullName);
2860
                    long numByte = fileInfo.Length;
2861
                    double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
2862
                    kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
2863

    
2864
                    if (dLen < 4)
2865
                    {
2866
                        System.IO.FileStream fStream = new System.IO.FileStream(fileInfo.FullName,
2867
                        System.IO.FileMode.Open, System.IO.FileAccess.Read);
2868
                        System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
2869
                        byte[] data = br.ReadBytes((int)numByte);
2870

    
2871
                        filename = fileUploader.Run(App.ViewInfo.ProjectNO, this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile + ".png", data);
2872
                        Check_Uri.UriCheck(filename);
2873
                        br.Close();
2874
                        fStream.Close();
2875
                        fStream.Dispose();
2876
                    }
2877
                    else
2878
                    {
2879
                        this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert");
2880
                        return;
2881
                    }
2882

    
2883
                    fileInfo.Delete();
2884

    
2885
                    //System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage();
2886
                    System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(clipboardImage);
2887
                    IntPtr hBitmap = bmp.GetHbitmap();
2888
                    System.Windows.Media.ImageSource WpfBitmap = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
2889
                    Image img = new Image();
2890
                    //img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(filename));
2891
                    if (filename.Contains(".svg"))
2892
                    {
2893
                        byte[] imageData = null;
2894
                        DrawingImage image = null;
2895
                        using (System.Net.WebClient web = new System.Net.WebClient())
2896
                        {
2897
                            imageData = web.DownloadData(new Uri(filename));
2898
                            System.IO.Stream stream = new System.IO.MemoryStream(imageData);
2899
                            image = SvgReader.Load(stream);
2900
                        }
2901
                        img.Source = image;
2902
                    }
2903
                    else
2904
                    {
2905
                        img.Source = new BitmapImage(new Uri(filename));
2906
                    }
2907

    
2908
                    var currentControl = new MarkupToPDF.Controls.Etc.ImgControl
2909
                    {
2910
                        PointSet = new List<Point>(),
2911
                        //FilePath = img.Source.ToString(),
2912
                        FilePath = filename,
2913
                        ImageData = img.Source,
2914
                        StartPoint = new Point(100, 100),
2915
                        EndPoint = new Point(200, 200),
2916
                        TopRightPoint = new Point(100, 200),
2917
                        LeftBottomPoint = new Point(200, 100)
2918
                    };
2919

    
2920
                    currentControl.TopRightPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y);
2921
                    currentControl.LeftBottomPoint = new Point(currentControl.StartPoint.X, currentControl.StartPoint.Y + clipboardImage.Height);
2922
                    currentControl.EndPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y + clipboardImage.Height);
2923

    
2924
                    currentControl.PointSet = new List<Point>
2925
                                        {
2926
                                            currentControl.StartPoint,
2927
                                            currentControl.LeftBottomPoint,
2928
                                            currentControl.EndPoint,
2929
                                            currentControl.TopRightPoint,
2930
                                        };
2931

    
2932
                    multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo);
2933
                    UndoData.Markup_List.Add(multi_Undo_Data);
2934
                    ViewerDataModel.Instance.UndoDataList.Add(UndoData);
2935

    
2936
                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo);
2937
                    currentControl.CommentID = Commons.shortGuid();
2938

    
2939
                    currentControl.ApplyTemplate();
2940
                    currentControl.SetImage();
2941

    
2942
                    ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo);
2943
                    Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo);
2944
                    this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final);
2945

    
2946
                    double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2);
2947
                    double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2);
2948
                    final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
2949
                }
2950
                catch(Exception ex)
2951
                {
2952
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("" + ex, "Alert");
2953
                }
2954
            }
2955
        }
2956
    }
2957
}
클립보드 이미지 추가 (최대 크기: 500 MB)