프로젝트

일반

사용자정보

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

markus / KCOM / Events / Implementation / TopMenuEvent.cs @ 5ce56a3a

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

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

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

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

    
243
                SaveEvent(null, null);
244
            }
245

    
246
        }
247

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

    
257
            if (IsRun)
258
            {
259
                SaveTimer.Start();
260
            }
261
            else
262
            {
263
                SaveTimer.Stop();
264
            }
265
        }
266

    
267
        public void SaveEvent(object sender, RoutedEventArgs e)
268
        {
269
            this.ParentOfType<MainWindow>().dzMainMenu.ReleaseAdorner();
270

    
271
            this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
272

    
273
            var menu = this.ParentOfType<MainWindow>().dzMainMenu;
274

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

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

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

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

    
323
            menu.ChangeCommentReact();
324

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

    
355
		public void RefactoryCommentReact(MainMenu menu)
356
        {
357
            this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
358

    
359
            Save save = new Save();
360

    
361
            //강인구 추가
362
            List<IKCOM.MarkupInfoItem> MySelectItem = new List<IKCOM.MarkupInfoItem>();
363

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

    
372
            //MySelectItem = (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
373

    
374

    
375
            save.Project_No = App.ViewInfo.ProjectNO;
376
            save.document_id = App.ViewInfo.DocumentItemID;
377
            save.user_id = App.ViewInfo.UserID;
378
            save.page_no = Convert.ToInt32(tlcurrentPage.Text);
379

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

    
418

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

    
425
                        if (_docpage.PAGE_ANGLE != data.PAGE_ANGLE)
426
                        {
427
                            _docpage.PAGE_ANGLE = data.PAGE_ANGLE;
428
                        }
429
                    });
430

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

    
441
        //강인구 추가
442
        public void Print_Start(string Type)
443
        {
444

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

    
456
                }
457
                else
458
                {
459
                    RefactoryCommentReact(menu);
460
                }
461
            }
462

    
463
            bool isprint = false;
464
            if (Type == "Print")
465
            {
466
                isprint = true;
467
            }
468

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

    
477
            List<IKCOM.MarkupInfoItem> markupinfo = new List<IKCOM.MarkupInfoItem>();
478

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

    
486
                var docitem = docinfo.First();
487

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

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

    
505
                    _result.MarkupList = new List<IKCOM.MarkupItem>();
506
                    var markup_Version = markinfo.MARKUP_INFO_VERSION.OrderByDescending(p => p.CREATE_DATE).First();
507

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

    
518
                    _result.PageCount = _result.MarkupList.GroupBy(i => i.PageNumber).Count();
519

    
520
                    markupinfo.Add(_result);
521
                }
522

    
523

    
524
                
525
                //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);
526

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

    
535

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

    
545
                //http://cloud.devdoftech.co.kr:5977/TileSource/000000_Tile/111111/11111111/1.jpg
546
            }
547

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

    
556
            Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.VisualStudio2013Theme());
557
            //Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.Office2013Theme());
558
            PrintWindow.ShowDialog();
559
        }
560

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

    
568
        private List<AdornerMember> GetAdornerItem()
569
        {
570
            List<AdornerMember> AdonerList = new List<AdornerMember>();
571

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

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

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

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

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

    
696
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
697
                    UndoData.Markup_List.Add(multi_Undo_Data);
698
                    multi_Undo_Data = new Multi_Undo_data();
699
                }
700

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

    
709

    
710
        private void cbIntervalSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
711
        {
712
            List<AdornerMember> AdonerList = GetAdornerItem();
713
            if (AdonerList.Count > 0)
714
            {
715

    
716
                Undo_data UndoData = new Undo_data()
717
                {
718
                    IsUndo = false,
719
                    Event = Event_Type.Option,
720
                    EventTime = DateTime.Now,
721
                    Interval = ViewerDataModel.Instance.Interval,
722
                    Markup_List = new List<Multi_Undo_data>()
723
                };
724
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
725

    
726
                foreach (AdornerMember InnerItem in AdonerList)
727
                {
728
                    switch (InnerItem.DrawingData.GetType().Name)
729
                    {
730
                        case ("LineControl"):
731
                            {
732
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).Interval = ViewerDataModel.Instance.Interval;
733

    
734
                                multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
735
                                UndoData.Markup_List.Add(multi_Undo_Data);
736
                                multi_Undo_Data = new Multi_Undo_data();
737
                            }
738
                            break;
739
                    }
740
                }
741

    
742
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
743
                {
744
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
745
                });
746
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
747
            }
748
        }
749

    
750
        //강인구 추가(Undo End)
751
        private void cbDashStyle_SelectionChanged(object sender, SelectionChangedEventArgs e)
752
        {
753
            //강인구 추가
754
            if (this.ParentOfType<MainWindow>() != null)
755
            {
756
                ViewerDataModel.Instance.DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
757
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
758
                {
759
                    Undo_data UndoData = new Undo_data()
760
                    {
761
                        IsUndo = false,
762
                        Event = Event_Type.Option,
763
                        EventTime = DateTime.Now,
764
                        DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData,
765
                        Markup_List = new List<Multi_Undo_data>()
766
                    };
767
                    Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
768

    
769
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
770
                    {
771
                        if (item.GetType().Name == "AdornerFinal")
772
                        {
773
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
774
                            {
775
                                switch (InnerItem.DrawingData.GetType().Name)
776
                                {
777
                                    case ("LineControl"):
778
                                        {
779
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
780
                                        }
781
                                        break;
782
                                    case ("ArcControl"):
783
                                        {
784
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
785
                                        }
786
                                        break;
787
                                    case ("ArrowControl_Multi"):
788
                                        {
789
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
790
                                        }
791
                                        break;
792
                                    case ("CloudControl"):
793
                                        {
794
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
795
                                        }
796
                                        break;
797
                                    case ("PolygonControl"):
798
                                        {
799
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
800
                                        }
801
                                        break;
802
                                    case ("RectangleControl"):
803
                                        {
804
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
805
                                        }
806
                                        break;
807
                                    case ("RectCloudControl"):
808
                                        {
809
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
810
                                        }
811
                                        break;
812
                                    case ("TriControl"):
813
                                        {
814
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
815
                                        }
816
                                        break;
817
                                    case ("CircleControl"):
818
                                        {
819
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
820
                                        }
821
                                        break;
822
                                }
823

    
824
                                multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
825
                                UndoData.Markup_List.Add(multi_Undo_Data);
826
                                multi_Undo_Data = new Multi_Undo_data();
827
                            }
828

    
829
                            ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
830
                            {
831
                                ViewerDataModel.Instance.UndoDataList.Remove(i);
832
                            });
833
                            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
834
                        }
835
                    }
836
                }
837
            }
838
        }
839

    
840
        //강인구 추가
841
        private void comboFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
842
        {
843
            if (this.ParentOfType<MainWindow>() != null)
844
            {
845
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
846
                {
847
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
848
                    {
849
                        if (item.GetType().Name == "AdornerFinal")
850
                        {
851
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
852
                            {
853
                                switch (InnerItem.DrawingData.GetType().Name)
854
                                {
855
                                    case ("TextControl"):
856
                                        {
857
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Text);
858
                                        }
859
                                        break;
860
                                    case ("ArrowTextControl"):
861
                                        {
862
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Text);
863
                                        }
864
                                        break;
865
                                }
866
                            }
867
                        }
868
                    }
869
                }
870
            }
871
        }
872

    
873
        //강인구 추가
874
        private void btnBold_Checked(object sender, RoutedEventArgs e)
875
        {
876
            if (this.ParentOfType<MainWindow>() != null)
877
            {
878
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
879
                {
880
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
881
                    {
882
                        if (item.GetType().Name == "AdornerFinal")
883
                        {
884
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
885
                            {
886
                                switch (InnerItem.DrawingData.GetType().Name)
887
                                {
888
                                    case ("TextControl"):
889
                                        {
890
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight == FontWeights.Heavy)
891
                                            {
892
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Normal;
893
                                            }
894
                                            else
895
                                            {
896
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Heavy;
897
                                            }
898

    
899
                                        }
900
                                        break;
901
                                    case ("ArrowTextControl"):
902
                                        {
903
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight == FontWeights.Heavy)
904
                                            {
905
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Normal;
906
                                            }
907
                                            else
908
                                            {
909
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Heavy;
910
                                            }
911
                                        }
912
                                        break;
913
                                }
914
                            }
915
                        }
916
                    }
917
                }
918
            }
919
        }
920

    
921
        //강인구 추가
922
        private void btnItalic_Checked(object sender, RoutedEventArgs e)
923
        {
924
            if (this.ParentOfType<MainWindow>() != null)
925
            {
926
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
927
                {
928
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
929
                    {
930
                        if (item.GetType().Name == "AdornerFinal")
931
                        {
932
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
933
                            {
934
                                switch (InnerItem.DrawingData.GetType().Name)
935
                                {
936
                                    case ("TextControl"):
937
                                        {
938
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle == FontStyles.Italic)
939
                                            {
940
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = System.Windows.FontStyles.Normal;
941
                                            }
942
                                            else
943
                                            {
944
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = FontStyles.Italic;
945
                                            }
946

    
947
                                        }
948
                                        break;
949
                                    case ("ArrowTextControl"):
950
                                        {
951
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle == FontStyles.Italic)
952
                                            {
953
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Normal;
954
                                            }
955
                                            else
956
                                            {
957
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Italic;
958
                                            }
959
                                        }
960
                                        break;
961
                                }
962
                            }
963
                        }
964
                    }
965
                }
966
            }
967
        }
968

    
969
        //강인구 추가
970
        private void btnUnderLine_Checked(object sender, RoutedEventArgs e)
971
        {
972
            if (this.ParentOfType<MainWindow>() != null)
973
            {
974
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
975
                {
976
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
977
                    {
978
                        if (item.GetType().Name == "AdornerFinal")
979
                        {
980
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
981
                            {
982
                                switch (InnerItem.DrawingData.GetType().Name)
983
                                {
984
                                    case ("TextControl"):
985
                                        {
986
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine == TextDecorations.Underline)
987
                                            {
988
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = null;
989
                                            }
990
                                            else
991
                                            {
992
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
993
                                            }
994
                                        }
995
                                        break;
996
                                    case ("ArrowTextControl"):
997
                                        {
998
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
999
                                            {
1000
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
1001
                                            }
1002
                                            else
1003
                                            {
1004
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
1005
                                            }
1006
                                        }
1007
                                        break;
1008
                                }
1009
                            }
1010
                        }
1011
                    }
1012
                }
1013
            }
1014
        }
1015

    
1016
        private void AxisLockEvent(object sender, RoutedEventArgs e)
1017
        {
1018
            ViewerDataModel.Instance.checkAxis = cbAxisLock.IsChecked.Value;
1019
        }
1020

    
1021
        //강인구 추가
1022
        private void RadRibbonComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
1023
        {
1024
            if (this.ParentOfType<MainWindow>() != null)
1025
            {
1026
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1027
                {
1028
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1029
                    {
1030
                        if (item.GetType().Name == "AdornerFinal")
1031
                        {
1032
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1033
                            {
1034
                                switch (InnerItem.DrawingData.GetType().Name)
1035
                                {
1036
                                    case ("TextControl"):
1037
                                        {
1038
                                            //if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily == TextDecorations.Underline)
1039
                                            //{
1040
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily = new FontFamily(comboFontFamily.Text);
1041
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBlock.FontFamily = new FontFamily(comboFontFamily.Text);
1042
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBox.FontFamily = new FontFamily(comboFontFamily.Text);
1043
                                            //}
1044
                                            //else
1045
                                            //{
1046
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
1047
                                            //}
1048
                                        }
1049
                                        break;
1050
                                    case ("ArrowTextControl"):
1051
                                        {
1052
                                            //if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
1053
                                            //{
1054
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
1055
                                            //}
1056
                                            //else
1057
                                            //{
1058
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
1059
                                            //}
1060
                                        }
1061
                                        break;
1062
                                }
1063
                            }
1064
                        }
1065
                    }
1066
                }
1067
            }
1068
        }
1069

    
1070
        /// <summary>
1071
        /// 텍스트 컨트롤 하일라이트 처리
1072
        /// </summary>
1073
        /// <param name="sender"></param>
1074
        /// <param name="e"></param>
1075
        private void HighlightEvent(object sender, RoutedEventArgs e)
1076
        {
1077

    
1078
            ViewerDataModel.Instance.checkHighShape = (sender as CheckBox).IsChecked.Value;
1079
            SetHighlightEvent();
1080
            //if ((sender as CheckBox).IsChecked.Value)
1081
            //{
1082
            //    TaskMessage("HighLight가 설정되었습니다", TaskMessageType.Normal);
1083
            //}
1084
            //else
1085
            //{
1086
            //    TaskMessage("HighLight가 해제되었습니다", TaskMessageType.Caption);
1087
            //}
1088
            //if (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl != null)
1089
            //{
1090
            //    MarkupToPDF.Controls.Text.TextControl instance = (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl);
1091
            //    instance.IsHighLight = ViewerDataModel.Instance.checkHighShape;
1092
            //    instance.SetText();
1093
            //}
1094
        }
1095

    
1096
        //강인구 추가페이지 이동 엔터
1097
        private void tlcurrentPage_KeyDown(object sender, KeyEventArgs e)
1098
        {
1099
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1100
            if (e.Key == Key.Enter)
1101
            {
1102
                try
1103
                {
1104
                    var instanceMain = this.ParentOfType<MainWindow>();
1105
                    instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text));
1106
                }
1107
                catch (Exception)
1108
                {
1109
                    RadWindow.Alert(new DialogParameters
1110
                    {
1111
                        Theme = new VisualStudio2013Theme(),
1112
                        Header = "안내",
1113
                        Content = "페이지 번호를 정확하게 입력해 주세요",
1114
                    });
1115
                }
1116
                
1117
            }
1118
        }
1119

    
1120
        public event EventHandler<WindowClosedEventArgs> Closed;
1121

    
1122
        //private void CheckEvent(object sender, RoutedEventArgs e)
1123
        //{
1124
        //    RadWindow CheckPop = new RadWindow();
1125
        //    test check = new test();
1126

    
1127
        //    CheckPop = new RadWindow
1128
        //    {
1129
        //        Width = 1700,
1130
        //        Height = 510,
1131
        //        Header = "My Check List",
1132
        //        Content = check,
1133
        //        Owner = this,
1134
        //        ResizeMode = System.Windows.ResizeMode.NoResize,
1135
        //        WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1136
        //    };
1137
        //    StyleManager.SetTheme(CheckPop, new VisualStudio2013Theme());
1138

    
1139
        //    CheckPop.Closed += CheckPop_Closed;
1140
        //    CheckPop.ShowDialog();
1141
        //}
1142

    
1143
        private void PanoramaEvent(object sender, RoutedEventArgs e)
1144
        {
1145
            PanoramaShow();
1146
        }
1147

    
1148
        public void PanoramaShow()
1149
        {
1150
            Panorama check = new Panorama();
1151
            double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
1152
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
1153
            //double windowWidth = this.Width;
1154
            //double windowHeight = this.Height;
1155

    
1156
            var PanoramaPop = new RadWindow
1157
            {
1158
                //MinWidth = 600,
1159
                //MinHeight = 400,
1160
                //Header = "My Check List",
1161
                Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1162
                Content = check,
1163
                Owner = this,
1164
                ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1165
                //ResizeMode = System.Windows.ResizeMode.NoResize,
1166
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1167
                IsTopmost = false,
1168
                //Left = (screenWidth / 2) - (windowWidth / 2),
1169
                //Top = (screenHeight / 2) - (windowHeight / 2),
1170
                //Left = (screenWidth / 2),
1171
                //Top = (screenHeight / 2),
1172
                Width = screenWidth * 0.4,
1173
                Height = screenHeight * 0.4,
1174
            };
1175
            StyleManager.SetTheme(PanoramaPop, new VisualStudio2013Theme());
1176
            //CheckPop.ShowDialog();
1177
            PanoramaPop.Show();
1178
        }
1179
        private void CheckEvent(object sender, RoutedEventArgs e)
1180
        {
1181
            //창이 떠있을 경우 재 실행 방지
1182
            if (isClosed)
1183
            {
1184
                //토글 및 마우스 상태 초기화
1185
                var toggleList = this.Parent.ChildrenOfType<RadToggleButton>();
1186
                foreach(var togle in toggleList)
1187
                {
1188
                    togle.IsChecked = false;
1189
                }
1190
                this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1191

    
1192
                isClosed = false;
1193

    
1194
                
1195
                CheckList check = new CheckList();
1196

    
1197
                CheckPop = new RadWindow
1198
                {
1199
                    MinWidth = 1200,
1200
                    MinHeight = 500,
1201
                    //Header = "My Check List",
1202
                    Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1203
                    Content = check,
1204
                    //Owner = this,
1205
                    //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1206
                    ResizeMode = System.Windows.ResizeMode.NoResize,
1207
                    WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1208
                    IsTopmost = true,
1209
                };
1210
                StyleManager.SetTheme(CheckPop, new Office2013Theme());
1211
                CheckPop.Closed += CheckPop_Closed;
1212
                
1213
                //CheckPop.ShowDialog();
1214
                CheckPop.Show();
1215
            }
1216
        }
1217

    
1218
        private void CheckPop_Closed(object sender, WindowClosedEventArgs e)
1219
        {
1220
            isClosed = true;
1221
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
1222
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1223
            ViewerDataModel.Instance.Capture_Opacity = 0;
1224
        }
1225

    
1226
        private void PageGoEvent(object sender, RoutedEventArgs e)
1227
        {
1228
            RadButton button = sender as RadButton;
1229
            var instanceMain = this.ParentOfType<MainWindow>();
1230
            
1231
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1232
            try
1233
            {
1234
                switch (button.CommandParameter.ToString())
1235
                {
1236
                    case "Down":
1237
                        {
1238
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) + 1);
1239
                        }
1240
                        break;
1241
                    case "Up":
1242
                        {
1243
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) - 1);
1244
                        }
1245
                        break;
1246
                }
1247
            }
1248
            catch (Exception)
1249
            {
1250
                RadWindow.Alert(new DialogParameters
1251
                {
1252
                    Theme = new VisualStudio2013Theme(),
1253
                    Header = "안내",
1254
                    Content = "페이지 번호를 정확하게 입력해 주세요",
1255
                });
1256
            }
1257
        }
1258

    
1259
        private void viewEvent(object sender, RoutedEventArgs e)
1260
        {
1261
            RadButton viewButton = sender as RadButton;
1262
            var instanceMain = this.ParentOfType<MainWindow>();
1263

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

    
1266
            switch (viewButton.CommandParameter.ToString())
1267
            {
1268
                case "zoomout":
1269
                    {
1270
                        //장원
1271
                        //instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(new Rect(0, 0, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualWidth, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualHeight));
1272

    
1273
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale -= 0.1, point);
1274
                        //Common.ViewerDataModel.Instance.zom
1275
                    }
1276
                    break;
1277
                case "zoomin":
1278
                    {
1279
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale += 0.1, point);
1280
                    }
1281
                    break;
1282
                case "fullscreen":
1283
                    {
1284
                        instanceMain.WindowState = WindowState.Maximized;
1285
                        //Sizemode 대기(강인구)
1286
                        //instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit;
1287
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1288
                    }
1289
                    break;
1290
                case "fitWidth":
1291
                    {
1292
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1293
                    }
1294
                    break;
1295
                case "fitHeight":
1296
                    {
1297
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1298
                    }
1299
                    break;
1300
                case "boundzoom":
1301
                    {
1302
                        //대기(강인구)
1303
                        bool isGO = false;
1304
                        instanceMain.dzMainMenu.imageViewer.MouseLeftButtonDown += (sen, ea) =>
1305
                        {
1306
                            isGO = true;
1307
                        };
1308
                        instanceMain.dzMainMenu.imageViewer.MouseLeftButtonUp += (sen, ea) =>
1309
                        {
1310
                            isGO = false;
1311
                        };
1312
                        //instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit;
1313
                        //instanceMain.dzMainMenu.imageViewer.InteractiveMode = Leadtools.Windows.Controls.InteractiveMode.UserRectangle;
1314
                        //instanceMain.dzMainMenu.imageViewer.InteractiveUserRectangle += (sen, ea) =>
1315
                        //{
1316
                        //    System.Diagnostics.Debug.WriteLine(ea.Bounds);
1317
                        //    if (ea.Status == Leadtools.Windows.Controls.InteractiveModeStatus.End)
1318
                        //    {
1319
                        //        instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(ea.Bounds);
1320
                        //        instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Normal;
1321
                        //        instanceMain.dzMainMenu.imageViewer.InteractiveMode = Leadtools.Windows.Controls.InteractiveMode.None;
1322
                        //    }
1323
                        //};
1324
                    }
1325
                    break;
1326
                case "Rotate_M":
1327
                    {
1328
                        drawingPannelRotate(false);
1329
                        //UpdateLayout();
1330
                    }
1331
                    break;
1332
                case "Rotate_P":
1333
                    {
1334
                        drawingPannelRotate(true);
1335
                        //UpdateLayout();
1336
                    }
1337
                    break;
1338
                case "Rotate_half":
1339
                    {
1340
                        drawingPannelRotate(true);
1341
                        drawingPannelRotate(true);
1342
                        //UpdateLayout();
1343
                    }
1344
                    break;
1345
            }
1346
        }
1347

    
1348
        #region 대기
1349

    
1350
        public void drawingPannelRotate(bool Flag)
1351
        {
1352
            var instanceMain = this.ParentOfType<MainWindow>();
1353

    
1354
            //if (rotateOffSet > 3)
1355
            //    rotateOffSet = 0;
1356

    
1357
            //if (rotateOffSet < 0)
1358
            //    rotateOffSet = 3;
1359

    
1360
            if(Flag)
1361
            {
1362
                if (instanceMain.dzMainMenu.rotate.Angle == 270)
1363
                {
1364
                    instanceMain.dzMainMenu.rotate.Angle = 0;
1365
                }
1366
                else
1367
                {
1368
                    instanceMain.dzMainMenu.rotate.Angle += 90;
1369
                }
1370
            }
1371
            else
1372
            {
1373
                if(instanceMain.dzMainMenu.rotate.Angle == 0)
1374
                {
1375
                    instanceMain.dzMainMenu.rotate.Angle = 270;
1376
                }
1377
                else
1378
                {
1379
                    instanceMain.dzMainMenu.rotate.Angle -= 90;
1380
                }
1381
            }
1382
            //double angle = (double)rotateValue.GetValue(rotateOffSet);
1383
            //instanceMain.dzMainMenu.rotate.Angle = angle;
1384
            var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90));
1385

    
1386
            if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth)
1387
            {
1388
                double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1389
                instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1390
                instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize;
1391
            }
1392
            if (instanceMain.dzMainMenu.rotate.Angle == 0)
1393
            {
1394
                instanceMain.dzMainMenu.translate.X = 0;
1395
                instanceMain.dzMainMenu.translate.Y = 0;
1396
            }
1397
            else if (instanceMain.dzMainMenu.rotate.Angle == 90)
1398
            {
1399
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1400
                instanceMain.dzMainMenu.translate.Y = 0;
1401
            }
1402
            else if (instanceMain.dzMainMenu.rotate.Angle == 180)
1403
            {
1404
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1405
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1406
            }
1407
            else
1408
            {
1409
                instanceMain.dzMainMenu.translate.X = 0;
1410
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1411
            }
1412

    
1413
            //instanceMain.dzMainMenu.zoomAndPanControl.RenderTransformOrigin = new Point(0.5, 0.5);
1414
            instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle;
1415
            //대기(강인구)
1416
            //instanceMain.dzMainMenu.imageViewer.RotateAngle = instanceMain.dzMainMenu.rotate.Angle;
1417

    
1418

    
1419
            //instanceMain.dzMainMenu.imageViewer.RenderTransformOrigin = new Point(0.5, 0.5);
1420
            //RotateTransform rotateTransform = new RotateTransform(instanceMain.dzMainMenu.rotate.Angle);
1421
            //instanceMain.dzMainMenu.imageViewer.RenderTransform = rotateTransform;
1422

    
1423

    
1424
            ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1425
            ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1426
            ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X;
1427
            ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y;
1428
            ViewerDataModel.Instance.Angle = instanceMain.dzMainMenu.rotate.Angle;
1429
            //ViewerDataModel.Instance.Document_Info.Clear();
1430
            //ViewerDataModel.Instance.Document_Info.Where(i => i.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(value =>
1431
            //{
1432
            //    value.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1433
            //});
1434

    
1435

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

    
1441
                instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems;
1442
                var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault();
1443
                instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1444

    
1445
                instanceMain.dzMainMenu.pageNavigator.setPageChange(data);
1446
            });
1447
        }
1448
        #endregion
1449

    
1450
        private void ImageConverter()
1451
        {
1452
            var instanceMain = this.ParentOfType<MainWindow>();
1453
            //http://cloud.devdoftech.co.kr:5977/ImageUpload/FileUpload.asmx
1454

    
1455

    
1456
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
1457
            dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png";
1458
            Nullable<bool> result = dlg.ShowDialog();
1459
            if (result == true)
1460
            {
1461
                instanceMain.dzMainMenu.filename = dlg.FileName;
1462
                instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1463

    
1464
                System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename);
1465
                String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename);
1466
                long numByte = fileInfo.Length;
1467
                double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
1468
                kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
1469

    
1470
                if (dLen < 4)
1471
                {
1472
                    System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
1473
                    System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
1474
                    byte[] data = br.ReadBytes((int)numByte);
1475
                    br.Close();
1476

    
1477
                    instanceMain.dzMainMenu.filename = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data);
1478
                    fStream.Close();
1479
                    fStream.Dispose();
1480
                }
1481
                else
1482
                {
1483
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert");
1484
                }
1485
            }
1486
        }
1487

    
1488
        private void ControlEvent(object sender, RoutedEventArgs e)
1489
        {
1490
            RadToggleButton instanceToggle = sender as RadToggleButton;
1491
            var instanceMain = this.ParentOfType<MainWindow>();
1492

    
1493
            #region Ctrl + A 눌렀을 때 대처 방법 
1494
            //원인 : Ctrl + A를 누르면 UIElementSet에 등록을 시키지 않는다(이유는 한꺼번에 많은 양의 컨트롤의 동작이 유입되기 때문에
1495
            //       시스템의 성능저하를 불러올 수 있기 때문이다. 그래서 선택 후 다른 컨트롤을 누르면 등록되지 않은 컨트롤이기 때문에 삭제된다
1496
            //       이를 대처하는 방법으로 아래 코드를 사용한다.
1497
            if (Common.ViewerDataModel.Instance.MarkupControls.Count == 0 && Common.ViewerDataModel.Instance.MarkupControls.Count >= 1)
1498
            {
1499
                //var lstItem = instanceMain.DeepLayer._SelectLayer.ChildrenOfType<AdornerFinal>().ToList();
1500
                //foreach (var item in lstItem)
1501
                //{
1502
                //    foreach (var member in item.MemberSet)
1503
                //    {
1504
                //        if (!instanceMain.DeepLayer.UIElementSet.Contains(member.DrawingData))
1505
                //        {
1506
                //            instanceMain.DeepLayer.UIElementSet.Add(member.DrawingData);
1507
                //        }
1508
                //    }
1509
                //}
1510
            }
1511
            #endregion
1512

    
1513
            //if (!instanceMain.IsFreeSelectionMode)
1514
            //{
1515
            //    instanceMain.IsSwingMode = true;
1516
            //}
1517

    
1518
            Release_ToggleButton(sender); //-> 해당 컨트롤을 제외한 모든 컨트롤에 대해 해제 처리
1519
            if (instanceToggle != null)
1520
            {
1521
                Common.ViewerDataModel.Instance.ControlTag = instanceToggle.Tag.ToString();
1522
            }
1523
            else if ((sender as RadRibbonToggleButton) != null)
1524
            {
1525
                Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString();
1526
                instanceToggle = (sender as RadRibbonToggleButton);
1527
            }
1528
            else if ((sender as RadRibbonButton) != null)
1529
            {
1530
                RadRibbonButton instanceButton = sender as RadRibbonButton;
1531
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1532
            }
1533
            else
1534
            {
1535
                RadButton instanceButton = sender as RadButton;
1536
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1537
            }
1538

    
1539

    
1540

    
1541
            #region 다른 컨트롤 버튼 선택 해제
1542
            System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.SelectedControl).Subscribe(ControlState =>
1543
            {
1544
                if (ControlState == null)
1545
                {
1546
                    instanceToggle.IsChecked = false;
1547
                    HiddenControlHide();
1548
                }
1549
            });
1550
            #endregion
1551

    
1552
            System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleVisibility).Subscribe(isSee =>
1553
            {
1554
                instanceMain.dzMainMenu.MainAngle.Visibility = isSee;
1555
                System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleValue).Subscribe(p =>
1556
                {
1557
                    instanceMain.dzMainMenu.MainAngle.AngleValue = p;
1558
                });
1559
            });
1560
            instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
1561

    
1562
            instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
1563

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

    
1781
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = true;
1782

    
1783
                        Common.ViewerDataModel.Instance.SelectedControl = "Ink";
1784
                        Common.ViewerDataModel.Instance.LineSize = (double)cbLineSize.Value;
1785
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PenControl;
1786
                        break;
1787
                    #endregion
1788
                    #region Select
1789
                    case "Select":
1790
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting;
1791
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1792
                        break;
1793
                    #endregion
1794
                    #region Image
1795
                    case "Image":
1796
                        Common.ViewerDataModel.Instance.SelectedControl = "ImgControl";
1797
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1798
                        ImageConverter();
1799
                        break;
1800
                    #endregion
1801
                    #region Sign
1802
                    case "Sign":
1803
                        Common.ViewerDataModel.Instance.SelectedControl = "Sign";
1804
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
1805
                        //강인구 추가
1806
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Sign;
1807
                        //instanceMain.BaseClient.GetUserSignCompleted += (sen, ea) =>
1808
                        //{
1809
                        //    if (ea.Result == null)
1810
                        //    {
1811

    
1812
                        //        this.ParentOfType<MainPage>().DialogMessage_Alert("You Don't Have Sign Data", "Alert");
1813
                        //    }
1814
                        //    else
1815
                        //    {
1816
                        //        byte[] imageBytes = System.Convert.FromBase64String(ea.Result);
1817
                        //        using (MemoryStream ms = new MemoryStream(imageBytes))
1818
                        //        {
1819
                        //            BitmapImage im = new BitmapImage();
1820
                        //            im.SetSource(ms);
1821
                        //            instanceMain.DeepLayer.SignImage = im;
1822
                        //            ms.Close();
1823
                        //        }
1824
                        //    }
1825
                        //};
1826
                        //instanceMain.BaseClient.GetUserSignAsync(instanceMain._ViewInfo.UserID);
1827
                        break;
1828
                    #endregion
1829
                    #region Check
1830
                    case "Check":
1831
                        Common.ViewerDataModel.Instance.SelectedControl = "Check";
1832
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
1833
                        //강인구 추가
1834
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Symbol;
1835
                        break;
1836
                    #endregion
1837
                    #region Batch
1838
                    case "Batch":
1839
                        Common.ViewerDataModel.Instance.SelectedControl = "Batch";
1840
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
1841
                        //강인구 추가
1842
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
1843
                        instanceMain.dzMainMenu.txtBatch.Visibility = Visibility.Visible;
1844
                        instanceMain.dzMainMenu.txtBatch.Text = "Mark Control을 그립니다";
1845
                        break;
1846
                        #endregion
1847
                    default:
1848
                        break;
1849
                }
1850
                #endregion
1851
            }
1852
            else
1853
            {
1854
                
1855
                if (!instanceMain.dzMainMenu.IsFreeSelectionMode)
1856
                {
1857
                    instanceMain.dzMainMenu.IsSwingMode = false;
1858
                    Common.ViewerDataModel.Instance.SelectedControl = "";
1859
                    Common.ViewerDataModel.Instance.ControlTag = null;
1860
                    this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1861
                    this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1862
                }
1863
            }
1864
        }
1865

    
1866
        //강인구 자동 저장 추가
1867
        private void AutoSave(object sender, RoutedEventArgs e)
1868
        {
1869
            RadToggleButton instanceToggle = sender as RadToggleButton;
1870

    
1871
            if(instanceToggle.IsChecked == true)
1872
            {
1873
                SaveTime(true);
1874
            }
1875
            else
1876
            {
1877
                SaveTime(false);
1878
            }
1879
        }
1880

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