프로젝트

일반

사용자정보

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

markus / KCOM / Events / Implementation / TopMenuEvent.cs @ 787a4489

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

1
using KCOM.Common;
2
using KCOM.Common.Converter;
3
using KCOM.Controls;
4
using KCOM.Events;
5
using MarkupToPDF.Common;
6
using System;
7
using System.Collections.Generic;
8
using System.Linq;
9
using System.Text;
10
using System.Windows;
11
using System.Windows.Controls;
12
using System.Windows.Input;
13
using System.Windows.Media;
14
using Telerik.Windows.Controls;
15

    
16
namespace KCOM.Views
17
{
18
    public partial class TopMenu : UserControl
19
    {
20
        public int rotateOffSet = 0;
21
        private double[] rotateValue = { 0, 90, 180, 270 };
22
        public System.Windows.Threading.DispatcherTimer SaveTimer { get; set; }
23
        public bool isClosed = true;
24
        public RadWindow CheckPop;
25

    
26
        /// <summary>
27
        /// TaskBar에 메시지를 입력합니다
28
        /// </summary>
29
        /// <param name="message"></param>
30
        /// <param name="type"></param>
31
        public void TaskMessage(string message, TaskMessageType type)
32
        {
33
            //if (taskBar != null)
34
            //{
35
            //    string color = "";
36
            //    taskBar.Content = message;
37
            //    DicTaskMessage.TryGetValue(type, out color);
38
            //    taskBar.Foreground = new SolidColorBrush(StringToColorConverter.Parse(color));
39
            //}
40
        }
41

    
42
        /// <summary>
43
        /// Task Type명을 Key값으로 지정합니다
44
        /// </summary>
45
        public enum TaskMessageType
46
        {
47
            Normal,
48
            Caption,
49
            Error,
50
        }
51

    
52
        private void CheckShapeState()
53
        {
54

    
55

    
56
            if (cbHatchShape.IsChecked == true)
57
            {
58
                cbFillShape.IsChecked = false;
59
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch;
60
            }
61
            else if(cbFillShape.IsChecked == true)
62
            {
63
                cbHatchShape.IsChecked = false;
64
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill;
65
            }
66
            else
67
            {
68
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;
69
            }
70
        }
71

    
72
        //강인구 추가(Undo End)
73
        private void SetPaintEvent()
74
        {
75
            List<AdornerMember> AdonerList = GetAdornerItem();
76

    
77
            if (AdonerList.Count > 0)
78
            {
79
                Undo_data UndoData = new Undo_data()
80
                {
81
                    IsUndo = false,
82
                    Event = Event_Type.Option,
83
                    EventTime = DateTime.Now,
84
                    paint = ViewerDataModel.Instance.paintSet,
85
                    Markup_List = new List<Multi_Undo_data>()
86
                };
87
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
88

    
89
                foreach (AdornerMember InnerItem in AdonerList)
90
                {
91
                    multi_Undo_Data.PointSet = new List<Point>();
92

    
93
                    if ((InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl) != null)
94
                    {
95
                        (InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl).Paint = ViewerDataModel.Instance.paintSet;
96
                    }
97

    
98
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
99
                    UndoData.Markup_List.Add(multi_Undo_Data);
100
                    multi_Undo_Data = new Multi_Undo_data();
101
                }
102

    
103
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
104
                {
105
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
106
                });
107
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
108
            }
109

    
110
        }
111

    
112
        private void SetHighlightEvent()
113
        {
114
            List<AdornerMember> AdonerList = GetAdornerItem();
115

    
116
            if (AdonerList.Count > 0)
117
            {
118
                foreach (AdornerMember InnerItem in AdonerList)
119
                {
120
                    switch (InnerItem.DrawingData.GetType().Name)
121
                    {
122
                        case ("TextControl"):
123
                            {
124
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape;
125
                            }
126
                            break;
127
                        case ("ArrowTextControl"):
128
                            {
129
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape;
130
                            }
131
                            break;
132
                    }
133
                }
134
            }
135

    
136
        }
137

    
138
        private void FillShapeEvent(object sender, RoutedEventArgs e)
139
        {
140
            #region 주석
141
            //if ((sender as CheckBox).IsChecked.Value)
142
            //{
143
            //    cbHatchShape.IsChecked = false;
144
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Fill.png", UriKind.Relative));
145
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Fill.png", UriKind.Relative));
146
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle_Fill.png", UriKind.Relative));
147
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon.png", UriKind.Relative));
148
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon.png", UriKind.Relative));
149
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_Fill.png", UriKind.Relative));
150
            //    TaskMessage("채우기 옵션이 적용되었습니다", TaskMessageType.Normal);
151
            //}
152
            //else
153
            //{
154

    
155
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative));
156
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative));
157
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative));
158
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative));
159
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative));
160
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative));
161
            //    TaskMessage("채우기 옵션이 해제되었습니다", TaskMessageType.Caption);
162
            //}
163
            #endregion
164
            ViewerDataModel.Instance.checkFillShape = (sender as CheckBox).IsChecked.Value;
165

    
166
            if (ViewerDataModel.Instance.checkFillShape)
167
            {
168
                cbHatchShape.IsChecked = false;
169
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill;
170
            }
171
            else
172
            {
173
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;
174
            }
175
            SetPaintEvent();
176
            
177

    
178

    
179
        }
180

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

    
212
            //강인구 추가
213
            ViewerDataModel.Instance.checkHatchShape = (sender as CheckBox).IsChecked.Value;
214
            if (ViewerDataModel.Instance.checkHatchShape)
215
            {
216
                cbFillShape.IsChecked = false;
217
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch;
218
            }
219
            else
220
            {
221
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;  
222
            }
223
            SetPaintEvent();
224
        }
225

    
226
 		//강인구 추가
227
        private string SetColor(string ID)
228
        {
229
            try
230
            {
231
                return ViewerDataModel.Instance._markupInfoList.Where(info => info.MarkupInfoID == ID).First().DisplayColor;
232
            }
233
            catch (Exception)
234
            {
235
                return "#FFFFFF";
236
            }
237
        }
238

    
239
        void SaveTimer_Tick(object sender, EventArgs e)
240
        {
241
            //if (this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode != IKCOM.MouseHandlingMode.Drawing)
242
            if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl == null && this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count == 0)
243
            {
244
                //Console.WriteLine("세이브 실시");
245

    
246
                SaveEvent(null, null);
247
            }
248

    
249
        }
250

    
251
        private void SaveTime(bool IsRun)
252
        {
253
            if(SaveTimer == null)
254
            {
255
                SaveTimer = new System.Windows.Threading.DispatcherTimer();
256
                SaveTimer.Interval = new TimeSpan(0, 0, 5);
257
                SaveTimer.Tick += new EventHandler(SaveTimer_Tick);
258
            }
259

    
260
            if (IsRun)
261
            {
262
                SaveTimer.Start();
263
            }
264
            else
265
            {
266
                SaveTimer.Stop();
267
            }
268
        }
269

    
270
        public void SaveEvent(object sender, RoutedEventArgs e)
271
        {
272
            this.ParentOfType<MainWindow>().dzMainMenu.ReleaseAdorner();
273

    
274
            this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
275

    
276
            var menu = this.ParentOfType<MainWindow>().dzMainMenu;
277

    
278
            //콘솔리 데잇일 경우 
279
            //if (ViewerDataModel.Instance.IsConsolidate && menu.gridViewMarkup.SelectedItems.Count > 1)
280
            if (ViewerDataModel.Instance.IsConsolidate)
281
            {
282
                ViewerDataModel.Instance.IsConsolidate = false;
283
                return;
284
            }
285

    
286
            //코멘트가 없을 경우
287
            //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0)
288
            //{
289
            //    foreach (var item in menu.gridViewMarkup.SelectedItems)
290
            //    {
291
            //        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
292
            //        {
293
            //            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
294
            //            return;
295
            //        }
296
            //    }
297
            //}
298

    
299
            //코멘트가 없을 경우
300
            if (ViewerDataModel.Instance.MarkupList_USER.Count == 0)
301
            {
302
                foreach (var item in menu.gridViewMarkup.SelectedItems)
303
                {
304
                    if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
305
                    {
306
                        this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
307
                        return;
308
                    }
309
                }
310
            }
311

    
312
            //코멘트가 없을 경우
313
            //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0)
314
            //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0 && menu.gridViewMarkup.SelectedItems.Count == 0)
315
            //{
316
            //    foreach (var item in menu.gridViewMarkup.SelectedItems)
317
            //    {
318
            //        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
319
            //        {
320
            //            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
321
            //            return;
322
            //        }
323
            //    }
324
            //}
325

    
326
            menu.ChangeCommentReact();
327

    
328
            if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
329
            {
330
                RefactoryCommentReact(menu);
331
            }
332
            else if(menu.gridViewMarkup.SelectedItems.Count == 0)
333
            {
334
                this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
335
                return;
336
            }
337
            //else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as  IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
338
            //{
339
            //    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
340
            //    return;
341
            //}
342
            //강인구 변경
343
            else
344
            {
345
                foreach (var item in menu.gridViewMarkup.SelectedItems)
346
                {
347
                    if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
348
                    {
349
                        RefactoryCommentReact(menu);
350
                        return;
351
                    }
352
                }
353
                //강인구 변경
354
                this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
355
            }
356
        }
357

    
358
		public void RefactoryCommentReact(MainMenu menu)
359
        {
360
            this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
361

    
362
            Save save = new Save();
363

    
364
            //강인구 추가
365
            List<IKCOM.MarkupInfoItem> MySelectItem = new List<IKCOM.MarkupInfoItem>();
366

    
367
            foreach(var item in menu.gridViewMarkup.SelectedItems)
368
            {
369
                if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
370
                {
371
                    MySelectItem.Add(item as IKCOM.MarkupInfoItem);
372
                }
373
            }
374

    
375
            //MySelectItem = (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
376

    
377

    
378
            save.Project_No = App.ViewInfo.ProjectNO;
379
            save.document_id = App.ViewInfo.DocumentItemID;
380
            save.user_id = App.ViewInfo.UserID;
381
            save.page_no = Convert.ToInt32(tlcurrentPage.Text);
382

    
383
            try
384
            {
385
                menu.ChangeCommentReact();
386
                if (menu.PreviewUserMarkupInfoItem != null) //신규 코멘트인지(MarkupInfo가 없는 경우)
387
                {
388
                    if (menu.gridViewMarkup.SelectedItems.FirstOrDefault() != null) //복수 페이지 혹은 저장한 경우
389
                    {
390
                        foreach(var item in MySelectItem)
391
                        {
392
                            save.MarkupSave(item);
393
                        }
394
                        //save.MarkupSave(menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
395
                    }
396
                    else  //단일 페이지인 경우
397
                    {
398
                        //menu.ChangeCommentReact();
399
                        foreach (var item in MySelectItem)
400
                        {
401
                            save.MarkupSave(item);
402
                        }
403
                        //save.MarkupSave(menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
404
                    }
405
                }
406
                else //기존 코멘트에 작업하는 경우
407
                {
408
                    if (menu.gridViewMarkup.SelectedItems.FirstOrDefault() != null)
409
                    {
410
                        foreach (var item in MySelectItem)
411
                        {
412
                            save.MarkupSave(item);
413
                        }
414
                        //save.MarkupSave(menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
415
                    }
416
                }
417
                using (KCOMDataModel.DataModel.CIEntities Entity = new KCOMDataModel.DataModel.CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString()))
418
                {
419
                    KCOMDataModel.DataModel.DOCPAGE _docpage = new KCOMDataModel.DataModel.DOCPAGE();
420

    
421

    
422
                    ViewerDataModel.Instance.Document_Info.OrderBy(i => i.PAGE_NUMBER).ToList().ForEach(data =>
423
                    {
424
                        _docpage = (from info in Entity.DOCPAGE
425
                                    where info.ID == data.ID
426
                                    select info).FirstOrDefault();
427

    
428
                        if (_docpage.PAGE_ANGLE != data.PAGE_ANGLE)
429
                        {
430
                            _docpage.PAGE_ANGLE = data.PAGE_ANGLE;
431
                        }
432
                    });
433

    
434
                    Entity.SaveChanges();
435
                }
436
            }
437
            catch (Exception ex)
438
            {
439
                this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("세이브 실패", "Alert");
440
                //MessageBox.Show("세이브 실패 : " + ex.Message);
441
            }
442
        }
443

    
444
        //강인구 추가
445
        public void Print_Start(string Type)
446
        {
447

    
448
            if(ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
449
            {
450
                var menu = this.ParentOfType<MainWindow>().dzMainMenu;
451
                menu.ReleaseAdorner();
452
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
453
                {
454
                    RefactoryCommentReact(menu);
455
                }
456
                else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
457
                {
458

    
459
                }
460
                else
461
                {
462
                    RefactoryCommentReact(menu);
463
                }
464
            }
465

    
466
            bool isprint = false;
467
            if (Type == "Print")
468
            {
469
                isprint = true;
470
            }
471

    
472
            RadWindow PrintWindow = new RadWindow();
473
            IKCOM.MarkupInfoItem _result = null;
474
            PrintWindow.Width = 850;
475
            PrintWindow.Height = 600;
476
            //PrintWindow.Width = 650;
477
            //PrintWindow.Height = 550;
478
            PrintWindow.Header = Type;
479

    
480
            List<IKCOM.MarkupInfoItem> markupinfo = new List<IKCOM.MarkupInfoItem>();
481

    
482
            using (KCOMDataModel.DataModel.CIEntities Entity = new KCOMDataModel.DataModel.CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString()))
483
            {
484
                var docinfo = from info in Entity.DOCINFO
485
                              where info.DOCUMENT_ID == App.ViewInfo.DocumentItemID
486
                              && info.PROJECT_NO == App.ViewInfo.ProjectNO
487
                              select info;
488

    
489
                var docitem = docinfo.First();
490

    
491
                foreach (KCOMDataModel.DataModel.MARKUP_INFO markinfo in docitem.MARKUP_INFO)
492
                {
493
                    var member = (from mem in Entity.MEMBER
494
                                  where mem.ID == markinfo.USER_ID
495
                                  select mem).First();
496

    
497
                    _result = new IKCOM.MarkupInfoItem
498
                    {
499
                        MarkupInfoID = markinfo.ID,
500
                        Consolidate = markinfo.CONSOLIDATE,
501
                        CreateTime = markinfo.UPDATE_TIME.HasValue ? markinfo.UPDATE_TIME.Value : markinfo.CREATE_TIME,
502
                        DisplayColor = SetColor(markinfo.ID),
503
                        UserID = markinfo.USER_ID,
504
                        UserName = member.NAME,
505
                        Depatment = member.DEPARTMENT,
506
                    };
507

    
508
                    _result.MarkupList = new List<IKCOM.MarkupItem>();
509
                    var markup_Version = markinfo.MARKUP_INFO_VERSION.OrderByDescending(p => p.CREATE_DATE).First();
510

    
511
                    foreach (KCOMDataModel.DataModel.MARKUP_DATA markdata in markup_Version.MARKUP_DATA)
512
                    {
513
                        IKCOM.MarkupItem markitem = new IKCOM.MarkupItem()
514
                        {
515
                            ID = markdata.ID,
516
                            PageNumber = markdata.PAGENUMBER,
517
                        };
518
                        _result.MarkupList.Add(markitem);
519
                    }
520

    
521
                    _result.PageCount = _result.MarkupList.GroupBy(i => i.PageNumber).Count();
522

    
523
                    markupinfo.Add(_result);
524
                }
525

    
526

    
527
                
528
                //PrintWindow.Content = new KCOM.Control.PrintControl(@"http://honeyhead.net/Pages/000000/111111/11111111/", docitem.PROJECT_NO, docitem, markupinfo, 1, docitem.DOCUMENT_ID, "VP-001-001", "http://honeyhead.net/Ensemble/000000_app/VPCS_DOCLIB/100/001/TEST_C.pdf", isprint);
529

    
530
                //강인구 추가 
531
                var Tile_Url = string.Format(@"{0}/TileSource/{1}_Tile/{2}/{3}/", 
532
                    App.SystemInfo.HostName,
533
                    App.ViewInfo.ProjectNO,
534
                    (Convert.ToInt64(App.ViewInfo.DocumentItemID) / 100).ToString(),
535
                    App.ViewInfo.DocumentItemID
536
                    );
537

    
538

    
539
                PrintWindow.Content = new KCOM.Control.PrintControl(
540
                          Tile_Url,
541
                          docitem.PROJECT_NO,
542
                          docitem, markupinfo,
543
                          this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber,
544
                          docitem.DOCUMENT_ID,
545
                          this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO,
546
                          docitem.ORIGINAL_FILE, isprint);
547

    
548
                //http://cloud.devdoftech.co.kr:5977/TileSource/000000_Tile/111111/11111111/1.jpg
549
            }
550

    
551
            //프린트 팝업 옵션
552
            //PrintWindow.BorderThickness = new Thickness(3);
553
            //PrintWindow.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 37, 160, 218));
554
            PrintWindow.ResizeMode = System.Windows.ResizeMode.NoResize;
555
            PrintWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
556
            PrintWindow.Background = new SolidColorBrush(Colors.Black);
557
            PrintWindow.Background.Opacity = 0.6;
558

    
559
            Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.VisualStudio2013Theme());
560
            //Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.Office2013Theme());
561
            PrintWindow.ShowDialog();
562
        }
563

    
564
        //강인구 추가
565
        private void PrintEvent(object sender, RoutedEventArgs e)
566
        {
567
            RadRibbonButton button = sender as RadRibbonButton;
568
            Print_Start(button.Content.ToString());
569
        }
570

    
571
        private List<AdornerMember> GetAdornerItem()
572
        {
573
            List<AdornerMember> AdonerList = new List<AdornerMember>();
574

    
575
            if (this.ParentOfType<MainWindow>() != null)
576
            {
577
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
578
                {
579
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
580
                    {
581
                        if (item.GetType().Name == "AdornerFinal")
582
                        {
583
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
584
                            {
585
                                AdonerList.Add(InnerItem);
586
                            }
587
                        }
588
                    }
589
                }
590
            }
591
            return AdonerList;
592
        }
593
        /// <summary>
594
        /// 투명도
595
        /// </summary>
596
        /// <param name="sender"></param>
597
        /// <param name="e"></param>
598
        //강인구 추가(Undo End)
599
        private void sdOpacity_ValueChanged(object sender, RoutedEventArgs e)
600
        {
601
            List<AdornerMember> AdonerList = GetAdornerItem();
602
            if(AdonerList.Count > 0)
603
            {
604
                Undo_data UndoData = new Undo_data()
605
                {
606
                    IsUndo = false,
607
                    Event = Event_Type.Option,
608
                    EventTime = DateTime.Now,
609
                    Opacity = ViewerDataModel.Instance.ControlOpacity,
610
                    Markup_List = new List<Multi_Undo_data>()
611
                };
612
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
613

    
614
                foreach (AdornerMember InnerItem in AdonerList)
615
                {
616
                    InnerItem.DrawingData.Opacity = ViewerDataModel.Instance.ControlOpacity;
617
                  
618
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
619
                    UndoData.Markup_List.Add(multi_Undo_Data);
620
                    multi_Undo_Data = new Multi_Undo_data();
621
                }
622

    
623
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
624
                {
625
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
626
                });
627
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
628
            }
629
        }
630

    
631
        //강인구 추가(Undo End)
632
        private void cbLineSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
633
        {
634
            List<AdornerMember> AdonerList = GetAdornerItem();
635
            if (AdonerList.Count > 0)
636
            {
637
                Undo_data UndoData = new Undo_data()
638
                {
639
                    IsUndo = false,
640
                    Event = Event_Type.Option,
641
                    EventTime = DateTime.Now,
642
                    LineSize = ViewerDataModel.Instance.LineSize,
643
                    Markup_List = new List<Multi_Undo_data>()
644
                };
645
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
646

    
647
                foreach (AdornerMember InnerItem in AdonerList)
648
                {
649
                    switch (InnerItem.DrawingData.GetType().Name)
650
                    {
651
                        case ("LineControl"):
652
                            {
653
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).LineSize = ViewerDataModel.Instance.LineSize;
654
                            }
655
                            break;
656
                        case ("ArcControl"):
657
                            {
658
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).LineSize = ViewerDataModel.Instance.LineSize;
659
                            }
660
                            break;
661
                        case ("ArrowControl_Multi"):
662
                            {
663
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).LineSize = ViewerDataModel.Instance.LineSize;
664
                            }
665
                            break;
666
                        case ("CloudControl"):
667
                            {
668
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).LineSize = ViewerDataModel.Instance.LineSize;
669
                            }
670
                            break;
671
                        case ("PolygonControl"):
672
                            {
673
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).LineSize = ViewerDataModel.Instance.LineSize;
674
                            }
675
                            break;
676
                        case ("RectangleControl"):
677
                            {
678
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).LineSize = ViewerDataModel.Instance.LineSize;
679
                            }
680
                            break;
681
                        case ("RectCloudControl"):
682
                            {
683
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).LineSize = ViewerDataModel.Instance.LineSize;
684
                            }
685
                            break;
686
                        case ("TriControl"):
687
                            {
688
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).LineSize = ViewerDataModel.Instance.LineSize;
689
                            }
690
                            break;
691
                        case ("CircleControl"):
692
                            {
693
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).LineSize = ViewerDataModel.Instance.LineSize;
694
                            }
695
                            break;
696
                    }
697
                    
698

    
699
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
700
                    UndoData.Markup_List.Add(multi_Undo_Data);
701
                    multi_Undo_Data = new Multi_Undo_data();
702
                }
703

    
704
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
705
                {
706
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
707
                });
708
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
709
            }
710
        }
711

    
712
        //강인구 추가(Undo End)
713
        private void cbDashStyle_SelectionChanged(object sender, SelectionChangedEventArgs e)
714
        {
715
            //강인구 추가
716
            if (this.ParentOfType<MainWindow>() != null)
717
            {
718
                ViewerDataModel.Instance.DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
719
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
720
                {
721
                    Undo_data UndoData = new Undo_data()
722
                    {
723
                        IsUndo = false,
724
                        Event = Event_Type.Option,
725
                        EventTime = DateTime.Now,
726
                        DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData,
727
                        Markup_List = new List<Multi_Undo_data>()
728
                    };
729
                    Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
730

    
731
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
732
                    {
733
                        if (item.GetType().Name == "AdornerFinal")
734
                        {
735
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
736
                            {
737
                                switch (InnerItem.DrawingData.GetType().Name)
738
                                {
739
                                    case ("LineControl"):
740
                                        {
741
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
742
                                        }
743
                                        break;
744
                                    case ("ArcControl"):
745
                                        {
746
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
747
                                        }
748
                                        break;
749
                                    case ("ArrowControl_Multi"):
750
                                        {
751
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
752
                                        }
753
                                        break;
754
                                    case ("CloudControl"):
755
                                        {
756
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
757
                                        }
758
                                        break;
759
                                    case ("PolygonControl"):
760
                                        {
761
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
762
                                        }
763
                                        break;
764
                                    case ("RectangleControl"):
765
                                        {
766
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
767
                                        }
768
                                        break;
769
                                    case ("RectCloudControl"):
770
                                        {
771
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
772
                                        }
773
                                        break;
774
                                    case ("TriControl"):
775
                                        {
776
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
777
                                        }
778
                                        break;
779
                                    case ("CircleControl"):
780
                                        {
781
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
782
                                        }
783
                                        break;
784
                                }
785

    
786
                                multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
787
                                UndoData.Markup_List.Add(multi_Undo_Data);
788
                                multi_Undo_Data = new Multi_Undo_data();
789
                            }
790

    
791
                            ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
792
                            {
793
                                ViewerDataModel.Instance.UndoDataList.Remove(i);
794
                            });
795
                            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
796
                        }
797
                    }
798
                }
799
            }
800
        }
801

    
802
        //강인구 추가
803
        private void comboFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
804
        {
805
            if (this.ParentOfType<MainWindow>() != null)
806
            {
807
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
808
                {
809
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
810
                    {
811
                        if (item.GetType().Name == "AdornerFinal")
812
                        {
813
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
814
                            {
815
                                switch (InnerItem.DrawingData.GetType().Name)
816
                                {
817
                                    case ("TextControl"):
818
                                        {
819
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Text);
820
                                        }
821
                                        break;
822
                                    case ("ArrowTextControl"):
823
                                        {
824
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Text);
825
                                        }
826
                                        break;
827
                                }
828
                            }
829
                        }
830
                    }
831
                }
832
            }
833
        }
834

    
835
        //강인구 추가
836
        private void btnBold_Checked(object sender, RoutedEventArgs e)
837
        {
838
            if (this.ParentOfType<MainWindow>() != null)
839
            {
840
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
841
                {
842
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
843
                    {
844
                        if (item.GetType().Name == "AdornerFinal")
845
                        {
846
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
847
                            {
848
                                switch (InnerItem.DrawingData.GetType().Name)
849
                                {
850
                                    case ("TextControl"):
851
                                        {
852
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight == FontWeights.Heavy)
853
                                            {
854
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Normal;
855
                                            }
856
                                            else
857
                                            {
858
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Heavy;
859
                                            }
860

    
861
                                        }
862
                                        break;
863
                                    case ("ArrowTextControl"):
864
                                        {
865
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight == FontWeights.Heavy)
866
                                            {
867
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Normal;
868
                                            }
869
                                            else
870
                                            {
871
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Heavy;
872
                                            }
873
                                        }
874
                                        break;
875
                                }
876
                            }
877
                        }
878
                    }
879
                }
880
            }
881
        }
882

    
883
        //강인구 추가
884
        private void btnItalic_Checked(object sender, RoutedEventArgs e)
885
        {
886
            if (this.ParentOfType<MainWindow>() != null)
887
            {
888
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
889
                {
890
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
891
                    {
892
                        if (item.GetType().Name == "AdornerFinal")
893
                        {
894
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
895
                            {
896
                                switch (InnerItem.DrawingData.GetType().Name)
897
                                {
898
                                    case ("TextControl"):
899
                                        {
900
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle == FontStyles.Italic)
901
                                            {
902
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = System.Windows.FontStyles.Normal;
903
                                            }
904
                                            else
905
                                            {
906
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = FontStyles.Italic;
907
                                            }
908

    
909
                                        }
910
                                        break;
911
                                    case ("ArrowTextControl"):
912
                                        {
913
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle == FontStyles.Italic)
914
                                            {
915
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Normal;
916
                                            }
917
                                            else
918
                                            {
919
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Italic;
920
                                            }
921
                                        }
922
                                        break;
923
                                }
924
                            }
925
                        }
926
                    }
927
                }
928
            }
929
        }
930

    
931
        //강인구 추가
932
        private void btnUnderLine_Checked(object sender, RoutedEventArgs e)
933
        {
934
            if (this.ParentOfType<MainWindow>() != null)
935
            {
936
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
937
                {
938
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
939
                    {
940
                        if (item.GetType().Name == "AdornerFinal")
941
                        {
942
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
943
                            {
944
                                switch (InnerItem.DrawingData.GetType().Name)
945
                                {
946
                                    case ("TextControl"):
947
                                        {
948
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine == TextDecorations.Underline)
949
                                            {
950
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = null;
951
                                            }
952
                                            else
953
                                            {
954
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
955
                                            }
956
                                        }
957
                                        break;
958
                                    case ("ArrowTextControl"):
959
                                        {
960
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
961
                                            {
962
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
963
                                            }
964
                                            else
965
                                            {
966
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
967
                                            }
968
                                        }
969
                                        break;
970
                                }
971
                            }
972
                        }
973
                    }
974
                }
975
            }
976
        }
977
        
978
        //강인구 추가
979
        private void RadRibbonComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
980
        {
981
            if (this.ParentOfType<MainWindow>() != null)
982
            {
983
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
984
                {
985
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
986
                    {
987
                        if (item.GetType().Name == "AdornerFinal")
988
                        {
989
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
990
                            {
991
                                switch (InnerItem.DrawingData.GetType().Name)
992
                                {
993
                                    case ("TextControl"):
994
                                        {
995
                                            //if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily == TextDecorations.Underline)
996
                                            //{
997
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily = new FontFamily(comboFontFamily.Text);
998
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBlock.FontFamily = new FontFamily(comboFontFamily.Text);
999
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBox.FontFamily = new FontFamily(comboFontFamily.Text);
1000
                                            //}
1001
                                            //else
1002
                                            //{
1003
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
1004
                                            //}
1005
                                        }
1006
                                        break;
1007
                                    case ("ArrowTextControl"):
1008
                                        {
1009
                                            //if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
1010
                                            //{
1011
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
1012
                                            //}
1013
                                            //else
1014
                                            //{
1015
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
1016
                                            //}
1017
                                        }
1018
                                        break;
1019
                                }
1020
                            }
1021
                        }
1022
                    }
1023
                }
1024
            }
1025
        }
1026

    
1027
        /// <summary>
1028
        /// 텍스트 컨트롤 하일라이트 처리
1029
        /// </summary>
1030
        /// <param name="sender"></param>
1031
        /// <param name="e"></param>
1032
        private void HighlightEvent(object sender, RoutedEventArgs e)
1033
        {
1034

    
1035
            ViewerDataModel.Instance.checkHighShape = (sender as CheckBox).IsChecked.Value;
1036
            SetHighlightEvent();
1037
            //if ((sender as CheckBox).IsChecked.Value)
1038
            //{
1039
            //    TaskMessage("HighLight가 설정되었습니다", TaskMessageType.Normal);
1040
            //}
1041
            //else
1042
            //{
1043
            //    TaskMessage("HighLight가 해제되었습니다", TaskMessageType.Caption);
1044
            //}
1045
            //if (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl != null)
1046
            //{
1047
            //    MarkupToPDF.Controls.Text.TextControl instance = (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl);
1048
            //    instance.IsHighLight = ViewerDataModel.Instance.checkHighShape;
1049
            //    instance.SetText();
1050
            //}
1051
        }
1052

    
1053
        //강인구 추가페이지 이동 엔터
1054
        private void tlcurrentPage_KeyDown(object sender, KeyEventArgs e)
1055
        {
1056
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1057
            if (e.Key == Key.Enter)
1058
            {
1059
                try
1060
                {
1061
                    var instanceMain = this.ParentOfType<MainWindow>();
1062
                    instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text));
1063
                }
1064
                catch (Exception)
1065
                {
1066
                    RadWindow.Alert(new DialogParameters
1067
                    {
1068
                        Theme = new VisualStudio2013Theme(),
1069
                        Header = "안내",
1070
                        Content = "페이지 번호를 정확하게 입력해 주세요",
1071
                    });
1072
                }
1073
                
1074
            }
1075
        }
1076

    
1077
        public event EventHandler<WindowClosedEventArgs> Closed;
1078

    
1079
        //private void CheckEvent(object sender, RoutedEventArgs e)
1080
        //{
1081
        //    RadWindow CheckPop = new RadWindow();
1082
        //    test check = new test();
1083

    
1084
        //    CheckPop = new RadWindow
1085
        //    {
1086
        //        Width = 1700,
1087
        //        Height = 510,
1088
        //        Header = "My Check List",
1089
        //        Content = check,
1090
        //        Owner = this,
1091
        //        ResizeMode = System.Windows.ResizeMode.NoResize,
1092
        //        WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1093
        //    };
1094
        //    StyleManager.SetTheme(CheckPop, new VisualStudio2013Theme());
1095

    
1096
        //    CheckPop.Closed += CheckPop_Closed;
1097
        //    CheckPop.ShowDialog();
1098
        //}
1099

    
1100
        private void PanoramaEvent(object sender, RoutedEventArgs e)
1101
        {
1102
            PanoramaShow();
1103
        }
1104

    
1105
        public void PanoramaShow()
1106
        {
1107
            Panorama check = new Panorama();
1108
            double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
1109
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
1110
            //double windowWidth = this.Width;
1111
            //double windowHeight = this.Height;
1112

    
1113
            var PanoramaPop = new RadWindow
1114
            {
1115
                //MinWidth = 600,
1116
                //MinHeight = 400,
1117
                //Header = "My Check List",
1118
                Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1119
                Content = check,
1120
                Owner = this,
1121
                ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1122
                //ResizeMode = System.Windows.ResizeMode.NoResize,
1123
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1124
                IsTopmost = false,
1125
                //Left = (screenWidth / 2) - (windowWidth / 2),
1126
                //Top = (screenHeight / 2) - (windowHeight / 2),
1127
                //Left = (screenWidth / 2),
1128
                //Top = (screenHeight / 2),
1129
                Width = screenWidth * 0.4,
1130
                Height = screenHeight * 0.4,
1131
            };
1132
            StyleManager.SetTheme(PanoramaPop, new VisualStudio2013Theme());
1133
            //CheckPop.ShowDialog();
1134
            PanoramaPop.Show();
1135
        }
1136
        private void CheckEvent(object sender, RoutedEventArgs e)
1137
        {
1138
            //창이 떠있을 경우 재 실행 방지
1139
            if (isClosed)
1140
            {
1141
                //토글 및 마우스 상태 초기화
1142
                var toggleList = this.Parent.ChildrenOfType<RadToggleButton>();
1143
                foreach(var togle in toggleList)
1144
                {
1145
                    togle.IsChecked = false;
1146
                }
1147
                this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1148

    
1149
                isClosed = false;
1150

    
1151
                
1152
                CheckList check = new CheckList();
1153

    
1154
                CheckPop = new RadWindow
1155
                {
1156
                    MinWidth = 1200,
1157
                    MinHeight = 500,
1158
                    //Header = "My Check List",
1159
                    Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1160
                    Content = check,
1161
                    //Owner = this,
1162
                    //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1163
                    ResizeMode = System.Windows.ResizeMode.NoResize,
1164
                    WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1165
                    IsTopmost = true,
1166
                };
1167
                StyleManager.SetTheme(CheckPop, new Office2013Theme());
1168
                CheckPop.Closed += CheckPop_Closed;
1169
                
1170
                //CheckPop.ShowDialog();
1171
                CheckPop.Show();
1172
            }
1173
        }
1174

    
1175
        private void CheckPop_Closed(object sender, WindowClosedEventArgs e)
1176
        {
1177
            isClosed = true;
1178
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
1179
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1180
            ViewerDataModel.Instance.Capture_Opacity = 0;
1181
        }
1182

    
1183
        private void PageGoEvent(object sender, RoutedEventArgs e)
1184
        {
1185
            RadButton button = sender as RadButton;
1186
            var instanceMain = this.ParentOfType<MainWindow>();
1187
            
1188
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1189
            try
1190
            {
1191
                switch (button.CommandParameter.ToString())
1192
                {
1193
                    case "Down":
1194
                        {
1195
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) + 1);
1196
                        }
1197
                        break;
1198
                    case "Up":
1199
                        {
1200
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) - 1);
1201
                        }
1202
                        break;
1203
                }
1204
            }
1205
            catch (Exception)
1206
            {
1207
                RadWindow.Alert(new DialogParameters
1208
                {
1209
                    Theme = new VisualStudio2013Theme(),
1210
                    Header = "안내",
1211
                    Content = "페이지 번호를 정확하게 입력해 주세요",
1212
                });
1213
            }
1214
        }
1215

    
1216
        private void viewEvent(object sender, RoutedEventArgs e)
1217
        {
1218
            RadButton viewButton = sender as RadButton;
1219
            var instanceMain = this.ParentOfType<MainWindow>();
1220

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

    
1223
            switch (viewButton.CommandParameter.ToString())
1224
            {
1225
                case "zoomout":
1226
                    {
1227
                        //장원
1228
                        //instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(new Rect(0, 0, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualWidth, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualHeight));
1229

    
1230
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale -= 0.1, point);
1231
                        //Common.ViewerDataModel.Instance.zom
1232
                    }
1233
                    break;
1234
                case "zoomin":
1235
                    {
1236
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale += 0.1, point);
1237
                    }
1238
                    break;
1239
                case "fullscreen":
1240
                    {
1241
                        instanceMain.WindowState = WindowState.Maximized;
1242
                        //Sizemode 대기(강인구)
1243
                        //instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit;
1244
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1245
                    }
1246
                    break;
1247
                case "fitWidth":
1248
                    {
1249
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1250
                    }
1251
                    break;
1252
                case "fitHeight":
1253
                    {
1254
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1255
                    }
1256
                    break;
1257
                case "boundzoom":
1258
                    {
1259
                        //대기(강인구)
1260
                        bool isGO = false;
1261
                        instanceMain.dzMainMenu.imageViewer.MouseLeftButtonDown += (sen, ea) =>
1262
                        {
1263
                            isGO = true;
1264
                        };
1265
                        instanceMain.dzMainMenu.imageViewer.MouseLeftButtonUp += (sen, ea) =>
1266
                        {
1267
                            isGO = false;
1268
                        };
1269
                        //instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit;
1270
                        //instanceMain.dzMainMenu.imageViewer.InteractiveMode = Leadtools.Windows.Controls.InteractiveMode.UserRectangle;
1271
                        //instanceMain.dzMainMenu.imageViewer.InteractiveUserRectangle += (sen, ea) =>
1272
                        //{
1273
                        //    System.Diagnostics.Debug.WriteLine(ea.Bounds);
1274
                        //    if (ea.Status == Leadtools.Windows.Controls.InteractiveModeStatus.End)
1275
                        //    {
1276
                        //        instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(ea.Bounds);
1277
                        //        instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Normal;
1278
                        //        instanceMain.dzMainMenu.imageViewer.InteractiveMode = Leadtools.Windows.Controls.InteractiveMode.None;
1279
                        //    }
1280
                        //};
1281
                    }
1282
                    break;
1283
                case "Rotate_M":
1284
                    {
1285
                        drawingPannelRotate(false);
1286
                        //UpdateLayout();
1287
                    }
1288
                    break;
1289
                case "Rotate_P":
1290
                    {
1291
                        drawingPannelRotate(true);
1292
                        //UpdateLayout();
1293
                    }
1294
                    break;
1295
                case "Rotate_half":
1296
                    {
1297
                        drawingPannelRotate(true);
1298
                        drawingPannelRotate(true);
1299
                        //UpdateLayout();
1300
                    }
1301
                    break;
1302
            }
1303
        }
1304

    
1305
        #region 대기
1306

    
1307
        public void drawingPannelRotate(bool Flag)
1308
        {
1309
            var instanceMain = this.ParentOfType<MainWindow>();
1310

    
1311
            //if (rotateOffSet > 3)
1312
            //    rotateOffSet = 0;
1313

    
1314
            //if (rotateOffSet < 0)
1315
            //    rotateOffSet = 3;
1316

    
1317
            if(Flag)
1318
            {
1319
                if (instanceMain.dzMainMenu.rotate.Angle == 270)
1320
                {
1321
                    instanceMain.dzMainMenu.rotate.Angle = 0;
1322
                }
1323
                else
1324
                {
1325
                    instanceMain.dzMainMenu.rotate.Angle += 90;
1326
                }
1327
            }
1328
            else
1329
            {
1330
                if(instanceMain.dzMainMenu.rotate.Angle == 0)
1331
                {
1332
                    instanceMain.dzMainMenu.rotate.Angle = 270;
1333
                }
1334
                else
1335
                {
1336
                    instanceMain.dzMainMenu.rotate.Angle -= 90;
1337
                }
1338
            }
1339
            //double angle = (double)rotateValue.GetValue(rotateOffSet);
1340
            //instanceMain.dzMainMenu.rotate.Angle = angle;
1341
            var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90));
1342

    
1343
            if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth)
1344
            {
1345
                double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1346
                instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1347
                instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize;
1348
            }
1349
            if (instanceMain.dzMainMenu.rotate.Angle == 0)
1350
            {
1351
                instanceMain.dzMainMenu.translate.X = 0;
1352
                instanceMain.dzMainMenu.translate.Y = 0;
1353
            }
1354
            else if (instanceMain.dzMainMenu.rotate.Angle == 90)
1355
            {
1356
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1357
                instanceMain.dzMainMenu.translate.Y = 0;
1358
            }
1359
            else if (instanceMain.dzMainMenu.rotate.Angle == 180)
1360
            {
1361
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1362
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1363
            }
1364
            else
1365
            {
1366
                instanceMain.dzMainMenu.translate.X = 0;
1367
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1368
            }
1369

    
1370
            //instanceMain.dzMainMenu.zoomAndPanControl.RenderTransformOrigin = new Point(0.5, 0.5);
1371
            instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle;
1372
            //대기(강인구)
1373
            //instanceMain.dzMainMenu.imageViewer.RotateAngle = instanceMain.dzMainMenu.rotate.Angle;
1374

    
1375

    
1376
            //instanceMain.dzMainMenu.imageViewer.RenderTransformOrigin = new Point(0.5, 0.5);
1377
            //RotateTransform rotateTransform = new RotateTransform(instanceMain.dzMainMenu.rotate.Angle);
1378
            //instanceMain.dzMainMenu.imageViewer.RenderTransform = rotateTransform;
1379

    
1380

    
1381
            ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1382
            ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1383
            ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X;
1384
            ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y;
1385
            ViewerDataModel.Instance.Angle = instanceMain.dzMainMenu.rotate.Angle;
1386
            //ViewerDataModel.Instance.Document_Info.Clear();
1387
            //ViewerDataModel.Instance.Document_Info.Where(i => i.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(value =>
1388
            //{
1389
            //    value.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1390
            //});
1391

    
1392

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

    
1398
                instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems;
1399
                var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault();
1400
                instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1401

    
1402
                instanceMain.dzMainMenu.pageNavigator.setPageChange(data);
1403
            });
1404
        }
1405
        #endregion
1406

    
1407
        private void ImageConverter()
1408
        {
1409
            var instanceMain = this.ParentOfType<MainWindow>();
1410
            //http://cloud.devdoftech.co.kr:5977/ImageUpload/FileUpload.asmx
1411

    
1412

    
1413
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
1414
            dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png";
1415
            Nullable<bool> result = dlg.ShowDialog();
1416
            if (result == true)
1417
            {
1418
                instanceMain.dzMainMenu.filename = dlg.FileName;
1419
                instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1420

    
1421
                System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename);
1422
                String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename);
1423
                long numByte = fileInfo.Length;
1424
                double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
1425
                kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
1426

    
1427
                if (dLen < 4)
1428
                {
1429
                    System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
1430
                    System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
1431
                    byte[] data = br.ReadBytes((int)numByte);
1432
                    br.Close();
1433

    
1434
                    instanceMain.dzMainMenu.filename = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data);
1435
                    fStream.Close();
1436
                    fStream.Dispose();
1437
                }
1438
                else
1439
                {
1440
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert");
1441
                }
1442
            }
1443
        }
1444

    
1445
        private void ControlEvent(object sender, RoutedEventArgs e)
1446
        {
1447
            RadToggleButton instanceToggle = sender as RadToggleButton;
1448
            var instanceMain = this.ParentOfType<MainWindow>();
1449

    
1450
            #region Ctrl + A 눌렀을 때 대처 방법 
1451
            //원인 : Ctrl + A를 누르면 UIElementSet에 등록을 시키지 않는다(이유는 한꺼번에 많은 양의 컨트롤의 동작이 유입되기 때문에
1452
            //       시스템의 성능저하를 불러올 수 있기 때문이다. 그래서 선택 후 다른 컨트롤을 누르면 등록되지 않은 컨트롤이기 때문에 삭제된다
1453
            //       이를 대처하는 방법으로 아래 코드를 사용한다.
1454
            if (Common.ViewerDataModel.Instance.MarkupControls.Count == 0 && Common.ViewerDataModel.Instance.MarkupControls.Count >= 1)
1455
            {
1456
                //var lstItem = instanceMain.DeepLayer._SelectLayer.ChildrenOfType<AdornerFinal>().ToList();
1457
                //foreach (var item in lstItem)
1458
                //{
1459
                //    foreach (var member in item.MemberSet)
1460
                //    {
1461
                //        if (!instanceMain.DeepLayer.UIElementSet.Contains(member.DrawingData))
1462
                //        {
1463
                //            instanceMain.DeepLayer.UIElementSet.Add(member.DrawingData);
1464
                //        }
1465
                //    }
1466
                //}
1467
            }
1468
            #endregion
1469

    
1470
            //if (!instanceMain.IsFreeSelectionMode)
1471
            //{
1472
            //    instanceMain.IsSwingMode = true;
1473
            //}
1474

    
1475
            Release_ToggleButton(sender); //-> 해당 컨트롤을 제외한 모든 컨트롤에 대해 해제 처리
1476
            if (instanceToggle != null)
1477
            {
1478
                Common.ViewerDataModel.Instance.ControlTag = instanceToggle.Tag.ToString();
1479
            }
1480
            else if ((sender as RadRibbonToggleButton) != null)
1481
            {
1482
                Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString();
1483
                instanceToggle = (sender as RadRibbonToggleButton);
1484
            }
1485
            else if ((sender as RadRibbonButton) != null)
1486
            {
1487
                RadRibbonButton instanceButton = sender as RadRibbonButton;
1488
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1489
            }
1490
            else
1491
            {
1492
                RadButton instanceButton = sender as RadButton;
1493
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1494
            }
1495

    
1496

    
1497

    
1498
            #region 다른 컨트롤 버튼 선택 해제
1499
            System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.SelectedControl).Subscribe(ControlState =>
1500
            {
1501
                if (ControlState == null)
1502
                {
1503
                    instanceToggle.IsChecked = false;
1504
                    HiddenControlHide();
1505
                }
1506
            });
1507
            #endregion
1508

    
1509
            System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleVisibility).Subscribe(isSee =>
1510
            {
1511
                instanceMain.dzMainMenu.MainAngle.Visibility = isSee;
1512
                System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleValue).Subscribe(p =>
1513
                {
1514
                    instanceMain.dzMainMenu.MainAngle.AngleValue = p;
1515
                });
1516
            });
1517
            instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
1518

    
1519
            instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
1520

    
1521
            if (instanceToggle.IsChecked != false)
1522
            {
1523
                #region 컨트롤이 체크되었다면
1524
                switch (instanceToggle.CommandParameter.ToString())
1525
                {
1526
                    #region Line
1527
                    case "Line":
1528
                        Common.ViewerDataModel.Instance.SelectedControl = "Line";
1529
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1530
                        if (instanceToggle.Tag.ToString() == "LineDelete")
1531
                        {
1532
                            //HiddenInterval.Visibility = Visibility.Visible;
1533
                        }
1534
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.SingleLine;
1535
                        break;
1536
                    #endregion
1537
                    #region ChainLine
1538
                    case "ChainLine":
1539
                        Common.ViewerDataModel.Instance.SelectedControl = "ChainLine";
1540
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1541
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ChainLine;
1542
                        break;
1543
                    #endregion
1544
                    #region DimLine
1545
                    case "DimLine":
1546
                        Common.ViewerDataModel.Instance.SelectedControl = "DimLine";
1547
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1548
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.DimLine;
1549
                        break;
1550
                    #endregion
1551
                    #region TwinLine
1552
                    case "TwinLine":
1553
                        Common.ViewerDataModel.Instance.SelectedControl = "TwinLine";
1554
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1555
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TwinLine;
1556
                        break;
1557
                    #endregion
1558
                    #region CancelLine
1559
                    case "CancelLine":
1560
                        Common.ViewerDataModel.Instance.SelectedControl = "CancelLine";
1561
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1562
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.CancelLine;
1563
                        break;
1564
                    #endregion
1565
                    #region PolygonCloud
1566
                    case "PolygonCloud":
1567
                        Common.ViewerDataModel.Instance.SelectedControl = "PolygonCloud";
1568
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1569
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonCloud;
1570
                        break;
1571
                    #endregion
1572
                    #region RectCloud
1573
                    case "RectCloud":
1574
                        Common.ViewerDataModel.Instance.SelectedControl = "RectCloud";
1575
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1576
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.RectCloud;
1577
                        break;
1578
                    #endregion
1579
                    #region RectCloud
1580
                    case "Rectangle":
1581
                        Common.ViewerDataModel.Instance.SelectedControl = "Rectangle";
1582
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1583
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Rectangle;
1584
                        break;
1585
                    #endregion
1586
                    #region RectCloud
1587
                    case "Triangle":
1588
                        Common.ViewerDataModel.Instance.SelectedControl = "Triangle";
1589
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1590
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Triangle;
1591
                        break;
1592
                    #endregion
1593
                    #region RectCloud
1594
                    case "Circle":
1595
                        Common.ViewerDataModel.Instance.SelectedControl = "Circle";
1596
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1597
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Circle;
1598
                        break;
1599
                    #endregion
1600
                    #region Symbol
1601
                    case "Symbol":
1602
                        Common.ViewerDataModel.Instance.SelectedControl = "Symbol";
1603
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1604
                        break;
1605
                    #endregion
1606
                    #region SymbolN
1607
                    case "SymbolN":
1608
                        Common.ViewerDataModel.Instance.SelectedControl = "SymbolN";
1609
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Stamp;
1610
                        break;
1611
                    #endregion
1612
                    #region Text
1613
                    case "Text":
1614
                        Common.ViewerDataModel.Instance.SelectedControl = "Text";
1615
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1616
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextControl;
1617
                        break;
1618
                    #endregion
1619
                    #region TextBorder
1620
                    case "TextBorder":
1621
                        Common.ViewerDataModel.Instance.SelectedControl = "TextBorder";
1622
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1623
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextBorder;
1624
                        break;
1625
                    #endregion
1626
                    #region TextCloud
1627
                    case "TextCloud":
1628
                        Common.ViewerDataModel.Instance.SelectedControl = "TextCloud";
1629
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1630
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextCloud;
1631
                        break;
1632
                    #endregion
1633
                    #region Date
1634
                    case "Date":
1635
                        Common.ViewerDataModel.Instance.SelectedControl = "Date";
1636
                        TaskMessage("날짜 컨트롤을 더블 클릭하면 날짜를 변경할 수 있습니다", TaskMessageType.Normal);
1637
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Date;
1638
                        break;
1639
                    #endregion
1640
                    #region ArrowText
1641
                    case "ArrowText":
1642
                        TaskMessage("ArrowText 컨트롤은 그린 후 컨트롤을 선택하였을 시 중간점을 조정할 수 있습니다", TaskMessageType.Normal);
1643
                        if (instanceToggle.Tag.ToString() == "ArrowText_Cloud")
1644
                        {
1645
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowText_Cloud";
1646
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl;
1647
                        }
1648
                        else if (instanceToggle.Tag.ToString() == "ArrowText_Border")
1649
                        {
1650
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTextBorderControl";
1651
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl;
1652
                        }
1653
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Normal")
1654
                        {
1655
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextControl";
1656
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl;
1657
                        }
1658
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Border")
1659
                        {
1660
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextBorderControl";
1661
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl;
1662
                        }
1663
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Cloud")
1664
                        {
1665
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextCloudControl";
1666
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl;
1667
                        }
1668
                        else
1669
                        {
1670
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowText";
1671
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextControl;
1672
                            //HiddenAxisLock.Visibility = Visibility.Visible;
1673
                        }
1674
                        break;
1675
                    #endregion
1676
                    #region Arrow
1677
                    case "Arrow":
1678
                        Common.ViewerDataModel.Instance.SelectedControl = "Arrow";
1679
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1680
                        //HiddenDimSize.Visibility = Visibility.Visible;
1681
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowLine;
1682
                        break;
1683
                    #endregion
1684
                    #region Shape
1685
                    case "Shape":
1686
                        Common.ViewerDataModel.Instance.SelectedControl = "Shape";
1687
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
1688
                        break;
1689
                    #endregion
1690
                    #region Polygon
1691
                    case "Polygon":
1692
                        Common.ViewerDataModel.Instance.SelectedControl = "Polygon";
1693
                        TaskMessage("자유형 코멘트 도구는 오른쪽 마우스 클릭을 통해 그리기를 마칠 수 있습니다", TaskMessageType.Normal);
1694
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1695
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonControl;
1696
                        break;
1697
                    #endregion
1698
                    #region Arc
1699
                    case "Arc":
1700
                        Common.ViewerDataModel.Instance.SelectedControl = "Arc";
1701
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcLine;
1702
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1703
                        TaskMessage("Arc 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal);
1704
                        break;
1705
                    #endregion
1706
                    #region ArrowMulti
1707
                    case "ArrowMulti":
1708
                        Common.ViewerDataModel.Instance.SelectedControl = "ArrowMulti";
1709
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowMultiLine;
1710
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1711
                        break;
1712
                    #endregion
1713
                    #region Etc
1714
                    case "Etc":
1715
                        Common.ViewerDataModel.Instance.SelectedControl = "Etc";
1716
                        break;
1717
                    #endregion
1718
                    #region Ink
1719
                    case "Ink":
1720
                        if (instanceToggle.Tag.ToString() == "EraserClear")
1721
                        {
1722
                            TaskMessage("해당 컨트롤은 점 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal);
1723
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
1724
                            instanceMain.dzMainMenu.inkBoard.Tag = "EraseByPoint";
1725
                        }
1726
                        else if (instanceToggle.Tag.ToString() == "Eraser")
1727
                        {
1728
                            TaskMessage("해당 컨트롤은 선 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal);
1729
                            instanceMain.dzMainMenu.inkBoard.Tag = "EraseByStroke";
1730
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
1731
                        }
1732
                        else
1733
                        {
1734
                            instanceMain.dzMainMenu.inkBoard.Tag = "Ink";
1735
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.Ink;
1736
                        }
1737

    
1738
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = true;
1739

    
1740
                        Common.ViewerDataModel.Instance.SelectedControl = "Ink";
1741
                        Common.ViewerDataModel.Instance.LineSize = (double)cbLineSize.Value;
1742
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PenControl;
1743
                        break;
1744
                    #endregion
1745
                    #region Select
1746
                    case "Select":
1747
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting;
1748
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1749
                        break;
1750
                    #endregion
1751
                    #region Image
1752
                    case "Image":
1753
                        Common.ViewerDataModel.Instance.SelectedControl = "ImgControl";
1754
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1755
                        ImageConverter();
1756
                        break;
1757
                    #endregion
1758
                    #region Sign
1759
                    case "Sign":
1760
                        Common.ViewerDataModel.Instance.SelectedControl = "Sign";
1761
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
1762
                        //강인구 추가
1763
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Sign;
1764
                        //instanceMain.BaseClient.GetUserSignCompleted += (sen, ea) =>
1765
                        //{
1766
                        //    if (ea.Result == null)
1767
                        //    {
1768

    
1769
                        //        this.ParentOfType<MainPage>().DialogMessage_Alert("You Don't Have Sign Data", "Alert");
1770
                        //    }
1771
                        //    else
1772
                        //    {
1773
                        //        byte[] imageBytes = System.Convert.FromBase64String(ea.Result);
1774
                        //        using (MemoryStream ms = new MemoryStream(imageBytes))
1775
                        //        {
1776
                        //            BitmapImage im = new BitmapImage();
1777
                        //            im.SetSource(ms);
1778
                        //            instanceMain.DeepLayer.SignImage = im;
1779
                        //            ms.Close();
1780
                        //        }
1781
                        //    }
1782
                        //};
1783
                        //instanceMain.BaseClient.GetUserSignAsync(instanceMain._ViewInfo.UserID);
1784
                        break;
1785
                    #endregion
1786
                    #region Check
1787
                    case "Check":
1788
                        Common.ViewerDataModel.Instance.SelectedControl = "Check";
1789
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
1790
                        //강인구 추가
1791
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Symbol;
1792
                        break;
1793
                    #endregion
1794
                    #region Batch
1795
                    case "Batch":
1796
                        Common.ViewerDataModel.Instance.SelectedControl = "Batch";
1797
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
1798
                        //강인구 추가
1799
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
1800
                        instanceMain.dzMainMenu.txtBatch.Visibility = Visibility.Visible;
1801
                        instanceMain.dzMainMenu.txtBatch.Text = "Mark Control을 그립니다";
1802
                        break;
1803
                        #endregion
1804
                    default:
1805
                        break;
1806
                }
1807
                #endregion
1808
            }
1809
            else
1810
            {
1811
                
1812
                if (!instanceMain.dzMainMenu.IsFreeSelectionMode)
1813
                {
1814
                    instanceMain.dzMainMenu.IsSwingMode = false;
1815
                    Common.ViewerDataModel.Instance.SelectedControl = "";
1816
                    Common.ViewerDataModel.Instance.ControlTag = null;
1817
                    this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1818
                    this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1819
                }
1820
            }
1821
        }
1822

    
1823
        //강인구 자동 저장 추가
1824
        private void AutoSave(object sender, RoutedEventArgs e)
1825
        {
1826
            RadToggleButton instanceToggle = sender as RadToggleButton;
1827

    
1828
            if(instanceToggle.IsChecked == true)
1829
            {
1830
                SaveTime(true);
1831
            }
1832
            else
1833
            {
1834
                SaveTime(false);
1835
            }
1836
        }
1837

    
1838
    }
1839
}
클립보드 이미지 추가 (최대 크기: 500 MB)