프로젝트

일반

사용자정보

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

markus / KCOM / Events / Implementation / TopMenuEvent.cs.bak @ 3026d214

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

1 787a4489 KangIngu
using KCOM.Common;
2
using KCOM.Common.Converter;
3
using KCOM.Controls;
4
using KCOM.Events;
5
using MarkupToPDF.Common;
6
using System;
7
using System.Collections.Generic;
8
using System.Linq;
9
using System.Text;
10
using System.Windows;
11
using System.Windows.Controls;
12
using System.Windows.Input;
13
using System.Windows.Media;
14
using Telerik.Windows.Controls;
15
16
namespace KCOM.Views
17
{
18
    public partial class TopMenu : UserControl
19
    {
20
        public int rotateOffSet = 0;
21
        private double[] rotateValue = { 0, 90, 180, 270 };
22
        public System.Windows.Threading.DispatcherTimer SaveTimer { get; set; }
23
        public bool isClosed = true;
24
        public RadWindow CheckPop;
25
26
        /// <summary>
27
        /// TaskBar에 메시지를 입력합니다
28
        /// </summary>
29
        /// <param name="message"></param>
30
        /// <param name="type"></param>
31
        public void TaskMessage(string message, TaskMessageType type)
32
        {
33
            //if (taskBar != null)
34
            //{
35
            //    string color = "";
36
            //    taskBar.Content = message;
37
            //    DicTaskMessage.TryGetValue(type, out color);
38
            //    taskBar.Foreground = new SolidColorBrush(StringToColorConverter.Parse(color));
39
            //}
40
        }
41
42
        /// <summary>
43
        /// Task Type명을 Key값으로 지정합니다
44
        /// </summary>
45
        public enum TaskMessageType
46
        {
47
            Normal,
48
            Caption,
49
            Error,
50
        }
51
52
        private void CheckShapeState()
53
        {
54
55
56
            if (cbHatchShape.IsChecked == true)
57
            {
58
                cbFillShape.IsChecked = false;
59
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch;
60
            }
61
            else if(cbFillShape.IsChecked == true)
62
            {
63
                cbHatchShape.IsChecked = false;
64
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill;
65
            }
66
            else
67
            {
68
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;
69
            }
70
        }
71
72
        //강인구 추가(Undo End)
73
        private void SetPaintEvent()
74
        {
75
            List<AdornerMember> AdonerList = GetAdornerItem();
76
77
            if (AdonerList.Count > 0)
78
            {
79
                Undo_data UndoData = new Undo_data()
80
                {
81
                    IsUndo = false,
82
                    Event = Event_Type.Option,
83
                    EventTime = DateTime.Now,
84
                    paint = ViewerDataModel.Instance.paintSet,
85
                    Markup_List = new List<Multi_Undo_data>()
86
                };
87
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
88
89
                foreach (AdornerMember InnerItem in AdonerList)
90
                {
91
                    multi_Undo_Data.PointSet = new List<Point>();
92
93
                    if ((InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl) != null)
94
                    {
95
                        (InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl).Paint = ViewerDataModel.Instance.paintSet;
96
                    }
97
98
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
99
                    UndoData.Markup_List.Add(multi_Undo_Data);
100
                    multi_Undo_Data = new Multi_Undo_data();
101
                }
102
103
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
104
                {
105
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
106
                });
107
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
108
            }
109
110
        }
111
112
        private void SetHighlightEvent()
113
        {
114
            List<AdornerMember> AdonerList = GetAdornerItem();
115
116
            if (AdonerList.Count > 0)
117
            {
118
                foreach (AdornerMember InnerItem in AdonerList)
119
                {
120
                    switch (InnerItem.DrawingData.GetType().Name)
121
                    {
122
                        case ("TextControl"):
123
                            {
124
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape;
125
                            }
126
                            break;
127
                        case ("ArrowTextControl"):
128
                            {
129
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape;
130
                            }
131
                            break;
132
                    }
133
                }
134
            }
135
136
        }
137
138
        private void FillShapeEvent(object sender, RoutedEventArgs e)
139
        {
140
            #region 주석
141
            //if ((sender as CheckBox).IsChecked.Value)
142
            //{
143
            //    cbHatchShape.IsChecked = false;
144
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Fill.png", UriKind.Relative));
145
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Fill.png", UriKind.Relative));
146
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle_Fill.png", UriKind.Relative));
147
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon.png", UriKind.Relative));
148
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon.png", UriKind.Relative));
149
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_Fill.png", UriKind.Relative));
150
            //    TaskMessage("채우기 옵션이 적용되었습니다", TaskMessageType.Normal);
151
            //}
152
            //else
153
            //{
154
155
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative));
156
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative));
157
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative));
158
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative));
159
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative));
160
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative));
161
            //    TaskMessage("채우기 옵션이 해제되었습니다", TaskMessageType.Caption);
162
            //}
163
            #endregion
164
            ViewerDataModel.Instance.checkFillShape = (sender as CheckBox).IsChecked.Value;
165
166
            if (ViewerDataModel.Instance.checkFillShape)
167
            {
168
                cbHatchShape.IsChecked = false;
169
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill;
170
            }
171
            else
172
            {
173
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;
174
            }
175
            SetPaintEvent();
176
            
177
178
179
        }
180
181
        /// <summary>
182
        /// 도형 빗금 처리
183
        /// </summary>
184
        /// <param name="sender"></param>
185
        /// <param name="e"></param>
186
        private void HatchShapeEvent(object sender, RoutedEventArgs e)
187
        {
188
			#region 주석
189
            //if ((sender as CheckBox).IsChecked.Value)
190
            //{
191
            //    cbFillShape.IsChecked = false;
192
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Hatch.png", UriKind.Relative));
193
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Hatch.png", UriKind.Relative));
194
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/rectangle-icon_Hatch.png", UriKind.Relative));
195
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_Hatch.png", UriKind.Relative));
196
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_Hatch.png", UriKind.Relative));
197
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_hatch.png", UriKind.Relative));
198
            //    TaskMessage("무늬 옵션이 적용되었습니다", TaskMessageType.Normal);
199
            //}
200
            //else
201
            //{
202
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative));
203
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative));
204
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative));
205
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative));
206
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative));
207
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative));
208
            //    TaskMessage("무늬 옵션이 해제되었습니다", TaskMessageType.Caption);
209
            //} 
210
            #endregion
211
212
            //강인구 추가
213
            ViewerDataModel.Instance.checkHatchShape = (sender as CheckBox).IsChecked.Value;
214
            if (ViewerDataModel.Instance.checkHatchShape)
215
            {
216
                cbFillShape.IsChecked = false;
217
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch;
218
            }
219
            else
220
            {
221
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;  
222
            }
223
            SetPaintEvent();
224
        }
225
226
 		//강인구 추가
227
        private string SetColor(string ID)
228
        {
229
            try
230
            {
231
                return ViewerDataModel.Instance._markupInfoList.Where(info => info.MarkupInfoID == ID).First().DisplayColor;
232
            }
233
            catch (Exception)
234
            {
235
                return "#FFFFFF";
236
            }
237
        }
238
239
        void SaveTimer_Tick(object sender, EventArgs e)
240
        {
241
            //if (this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode != IKCOM.MouseHandlingMode.Drawing)
242
            if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl == null && this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count == 0)
243
            {
244
                //Console.WriteLine("세이브 실시");
245
246
                SaveEvent(null, null);
247
            }
248
249
        }
250
251
        private void SaveTime(bool IsRun)
252
        {
253
            if(SaveTimer == null)
254
            {
255
                SaveTimer = new System.Windows.Threading.DispatcherTimer();
256
                SaveTimer.Interval = new TimeSpan(0, 0, 5);
257
                SaveTimer.Tick += new EventHandler(SaveTimer_Tick);
258
            }
259
260
            if (IsRun)
261
            {
262
                SaveTimer.Start();
263
            }
264
            else
265
            {
266
                SaveTimer.Stop();
267
            }
268
        }
269
270
        public void SaveEvent(object sender, RoutedEventArgs e)
271
        {
272
            this.ParentOfType<MainWindow>().dzMainMenu.ReleaseAdorner();
273
274
            this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
275
276
            var menu = this.ParentOfType<MainWindow>().dzMainMenu;
277
278
            //콘솔리 데잇일 경우 
279
            //if (ViewerDataModel.Instance.IsConsolidate && menu.gridViewMarkup.SelectedItems.Count > 1)
280
            if (ViewerDataModel.Instance.IsConsolidate)
281
            {
282
                ViewerDataModel.Instance.IsConsolidate = false;
283
                return;
284
            }
285
286
            //코멘트가 없을 경우
287
            //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0)
288
            //{
289
            //    foreach (var item in menu.gridViewMarkup.SelectedItems)
290
            //    {
291
            //        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
292
            //        {
293
            //            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
294
            //            return;
295
            //        }
296
            //    }
297
            //}
298
299
            //코멘트가 없을 경우
300
            if (ViewerDataModel.Instance.MarkupList_USER.Count == 0)
301
            {
302
                foreach (var item in menu.gridViewMarkup.SelectedItems)
303
                {
304
                    if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
305
                    {
306
                        this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
307
                        return;
308
                    }
309
                }
310
            }
311
312
            //코멘트가 없을 경우
313
            //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0)
314
            //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0 && menu.gridViewMarkup.SelectedItems.Count == 0)
315
            //{
316
            //    foreach (var item in menu.gridViewMarkup.SelectedItems)
317
            //    {
318
            //        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
319
            //        {
320
            //            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
321
            //            return;
322
            //        }
323
            //    }
324
            //}
325
326
            menu.ChangeCommentReact();
327
328
            if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
329
            {
330
                RefactoryCommentReact(menu);
331
            }
332
            else if(menu.gridViewMarkup.SelectedItems.Count == 0)
333
            {
334
                this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
335
                return;
336
            }
337
            //else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as  IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
338
            //{
339
            //    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
340
            //    return;
341
            //}
342
            //강인구 변경
343
            else
344
            {
345
                foreach (var item in menu.gridViewMarkup.SelectedItems)
346
                {
347
                    if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
348
                    {
349
                        RefactoryCommentReact(menu);
350
                        return;
351
                    }
352
                }
353
                //강인구 변경
354
                this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
355
            }
356
        }
357
358
		public void RefactoryCommentReact(MainMenu menu)
359
        {
360
            this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
361
362
            Save save = new Save();
363
364
            //강인구 추가
365
            List<IKCOM.MarkupInfoItem> MySelectItem = new List<IKCOM.MarkupInfoItem>();
366
367
            foreach(var item in menu.gridViewMarkup.SelectedItems)
368
            {
369
                if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
370
                {
371
                    MySelectItem.Add(item as IKCOM.MarkupInfoItem);
372
                }
373
            }
374
375
            //MySelectItem = (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
376
377
378
            save.Project_No = App.ViewInfo.ProjectNO;
379
            save.document_id = App.ViewInfo.DocumentItemID;
380
            save.user_id = App.ViewInfo.UserID;
381
            save.page_no = Convert.ToInt32(tlcurrentPage.Text);
382
383
            try
384
            {
385
                menu.ChangeCommentReact();
386
                if (menu.PreviewUserMarkupInfoItem != null) //신규 코멘트인지(MarkupInfo가 없는 경우)
387
                {
388
                    if (menu.gridViewMarkup.SelectedItems.FirstOrDefault() != null) //복수 페이지 혹은 저장한 경우
389
                    {
390
                        foreach(var item in MySelectItem)
391
                        {
392
                            save.MarkupSave(item);
393
                        }
394
                        //save.MarkupSave(menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
395
                    }
396
                    else  //단일 페이지인 경우
397
                    {
398
                        //menu.ChangeCommentReact();
399
                        foreach (var item in MySelectItem)
400
                        {
401
                            save.MarkupSave(item);
402
                        }
403
                        //save.MarkupSave(menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
404
                    }
405
                }
406
                else //기존 코멘트에 작업하는 경우
407
                {
408
                    if (menu.gridViewMarkup.SelectedItems.FirstOrDefault() != null)
409
                    {
410
                        foreach (var item in MySelectItem)
411
                        {
412
                            save.MarkupSave(item);
413
                        }
414
                        //save.MarkupSave(menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem);
415
                    }
416
                }
417
                using (KCOMDataModel.DataModel.CIEntities Entity = new KCOMDataModel.DataModel.CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString()))
418
                {
419
                    KCOMDataModel.DataModel.DOCPAGE _docpage = new KCOMDataModel.DataModel.DOCPAGE();
420
421
422
                    ViewerDataModel.Instance.Document_Info.OrderBy(i => i.PAGE_NUMBER).ToList().ForEach(data =>
423
                    {
424
                        _docpage = (from info in Entity.DOCPAGE
425
                                    where info.ID == data.ID
426
                                    select info).FirstOrDefault();
427
428
                        if (_docpage.PAGE_ANGLE != data.PAGE_ANGLE)
429
                        {
430
                            _docpage.PAGE_ANGLE = data.PAGE_ANGLE;
431
                        }
432
                    });
433
434
                    Entity.SaveChanges();
435
                }
436
            }
437
            catch (Exception ex)
438
            {
439
                MessageBox.Show("세이브 실패 : " + ex.Message);
440
            }
441
        }
442
443
        //강인구 추가
444
        public void Print_Start(string Type)
445
        {
446
447
            if(ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
448
            {
449
                var menu = this.ParentOfType<MainWindow>().dzMainMenu;
450
                menu.ReleaseAdorner();
451
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
452
                {
453
                    RefactoryCommentReact(menu);
454
                }
455
                else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
456
                {
457
458
                }
459
                else
460
                {
461
                    RefactoryCommentReact(menu);
462
                }
463
            }
464
465
            bool isprint = false;
466
            if (Type == "Print")
467
            {
468
                isprint = true;
469
            }
470
471
            RadWindow PrintWindow = new RadWindow();
472
            IKCOM.MarkupInfoItem _result = null;
473
            PrintWindow.Width = 850;
474
            PrintWindow.Height = 600;
475
            //PrintWindow.Width = 650;
476
            //PrintWindow.Height = 550;
477
            PrintWindow.Header = Type;
478
479
            List<IKCOM.MarkupInfoItem> markupinfo = new List<IKCOM.MarkupInfoItem>();
480
481
            using (KCOMDataModel.DataModel.CIEntities Entity = new KCOMDataModel.DataModel.CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString()))
482
            {
483
                var docinfo = from info in Entity.DOCINFO
484
                              where info.DOCUMENT_ID == App.ViewInfo.DocumentItemID
485
                              && info.PROJECT_NO == App.ViewInfo.ProjectNO
486
                              select info;
487
488
                var docitem = docinfo.First();
489
490
                foreach (KCOMDataModel.DataModel.MARKUP_INFO markinfo in docitem.MARKUP_INFO)
491
                {
492
                    var member = (from mem in Entity.MEMBER
493
                                  where mem.ID == markinfo.USER_ID
494
                                  select mem).First();
495
496
                    _result = new IKCOM.MarkupInfoItem
497
                    {
498
                        MarkupInfoID = markinfo.ID,
499
                        Consolidate = markinfo.CONSOLIDATE,
500
                        CreateTime = markinfo.UPDATE_TIME.HasValue ? markinfo.UPDATE_TIME.Value : markinfo.CREATE_TIME,
501
                        DisplayColor = SetColor(markinfo.ID),
502
                        UserID = markinfo.USER_ID,
503
                        UserName = member.NAME,
504
                        Depatment = member.DEPARTMENT,
505
                    };
506
507
                    _result.MarkupList = new List<IKCOM.MarkupItem>();
508
                    var markup_Version = markinfo.MARKUP_INFO_VERSION.OrderByDescending(p => p.CREATE_DATE).First();
509
510
                    foreach (KCOMDataModel.DataModel.MARKUP_DATA markdata in markup_Version.MARKUP_DATA)
511
                    {
512
                        IKCOM.MarkupItem markitem = new IKCOM.MarkupItem()
513
                        {
514
                            ID = markdata.ID,
515
                            PageNumber = markdata.PAGENUMBER,
516
                        };
517
                        _result.MarkupList.Add(markitem);
518
                    }
519
520
                    _result.PageCount = _result.MarkupList.GroupBy(i => i.PageNumber).Count();
521
522
                    markupinfo.Add(_result);
523
                }
524
525
526
                
527
                //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);
528
529
                //강인구 추가 
530
                var Tile_Url = string.Format(@"{0}/TileSource/{1}_Tile/{2}/{3}/", 
531
                    App.SystemInfo.HostName,
532
                    App.ViewInfo.ProjectNO,
533
                    (Convert.ToInt64(App.ViewInfo.DocumentItemID) / 100).ToString(),
534
                    App.ViewInfo.DocumentItemID
535
                    );
536
537
538
                PrintWindow.Content = new KCOM.Control.PrintControl(
539
                          Tile_Url,
540
                          docitem.PROJECT_NO,
541
                          docitem, markupinfo,
542
                          this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber,
543
                          docitem.DOCUMENT_ID,
544
                          this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO,
545
                          docitem.ORIGINAL_FILE, isprint);
546
547
                //http://cloud.devdoftech.co.kr:5977/TileSource/000000_Tile/111111/11111111/1.jpg
548
            }
549
550
            //프린트 팝업 옵션
551
            //PrintWindow.BorderThickness = new Thickness(3);
552
            //PrintWindow.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 37, 160, 218));
553
            PrintWindow.ResizeMode = System.Windows.ResizeMode.NoResize;
554
            PrintWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
555
            PrintWindow.Background = new SolidColorBrush(Colors.Black);
556
            PrintWindow.Background.Opacity = 0.6;
557
558
            Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.VisualStudio2013Theme());
559
            //Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.Office2013Theme());
560
            PrintWindow.ShowDialog();
561
        }
562
563
        //강인구 추가
564
        private void PrintEvent(object sender, RoutedEventArgs e)
565
        {
566
            RadRibbonButton button = sender as RadRibbonButton;
567
            Print_Start(button.Content.ToString());
568
        }
569
570
        private List<AdornerMember> GetAdornerItem()
571
        {
572
            List<AdornerMember> AdonerList = new List<AdornerMember>();
573
574
            if (this.ParentOfType<MainWindow>() != null)
575
            {
576
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
577
                {
578
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
579
                    {
580
                        if (item.GetType().Name == "AdornerFinal")
581
                        {
582
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
583
                            {
584
                                AdonerList.Add(InnerItem);
585
                            }
586
                        }
587
                    }
588
                }
589
            }
590
            return AdonerList;
591
        }
592
        /// <summary>
593
        /// 투명도
594
        /// </summary>
595
        /// <param name="sender"></param>
596
        /// <param name="e"></param>
597
        //강인구 추가(Undo End)
598
        private void sdOpacity_ValueChanged(object sender, RoutedEventArgs e)
599
        {
600
            List<AdornerMember> AdonerList = GetAdornerItem();
601
            if(AdonerList.Count > 0)
602
            {
603
                Undo_data UndoData = new Undo_data()
604
                {
605
                    IsUndo = false,
606
                    Event = Event_Type.Option,
607
                    EventTime = DateTime.Now,
608
                    Opacity = ViewerDataModel.Instance.ControlOpacity,
609
                    Markup_List = new List<Multi_Undo_data>()
610
                };
611
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
612
613
                foreach (AdornerMember InnerItem in AdonerList)
614
                {
615
                    InnerItem.DrawingData.Opacity = ViewerDataModel.Instance.ControlOpacity;
616
                  
617
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
618
                    UndoData.Markup_List.Add(multi_Undo_Data);
619
                    multi_Undo_Data = new Multi_Undo_data();
620
                }
621
622
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
623
                {
624
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
625
                });
626
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
627
            }
628
        }
629
630
        //강인구 추가(Undo End)
631
        private void cbLineSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
632
        {
633
            List<AdornerMember> AdonerList = GetAdornerItem();
634
            if (AdonerList.Count > 0)
635
            {
636
                Undo_data UndoData = new Undo_data()
637
                {
638
                    IsUndo = false,
639
                    Event = Event_Type.Option,
640
                    EventTime = DateTime.Now,
641
                    LineSize = ViewerDataModel.Instance.LineSize,
642
                    Markup_List = new List<Multi_Undo_data>()
643
                };
644
                Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
645
646
                foreach (AdornerMember InnerItem in AdonerList)
647
                {
648
                    switch (InnerItem.DrawingData.GetType().Name)
649
                    {
650
                        case ("LineControl"):
651
                            {
652
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).LineSize = ViewerDataModel.Instance.LineSize;
653
                            }
654
                            break;
655
                        case ("ArcControl"):
656
                            {
657
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).LineSize = ViewerDataModel.Instance.LineSize;
658
                            }
659
                            break;
660
                        case ("ArrowControl_Multi"):
661
                            {
662
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).LineSize = ViewerDataModel.Instance.LineSize;
663
                            }
664
                            break;
665
                        case ("CloudControl"):
666
                            {
667
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).LineSize = ViewerDataModel.Instance.LineSize;
668
                            }
669
                            break;
670
                        case ("PolygonControl"):
671
                            {
672
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).LineSize = ViewerDataModel.Instance.LineSize;
673
                            }
674
                            break;
675
                        case ("RectangleControl"):
676
                            {
677
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).LineSize = ViewerDataModel.Instance.LineSize;
678
                            }
679
                            break;
680
                        case ("RectCloudControl"):
681
                            {
682
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).LineSize = ViewerDataModel.Instance.LineSize;
683
                            }
684
                            break;
685
                        case ("TriControl"):
686
                            {
687
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).LineSize = ViewerDataModel.Instance.LineSize;
688
                            }
689
                            break;
690
                        case ("CircleControl"):
691
                            {
692
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).LineSize = ViewerDataModel.Instance.LineSize;
693
                            }
694
                            break;
695
                    }
696
                    
697
698
                    multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
699
                    UndoData.Markup_List.Add(multi_Undo_Data);
700
                    multi_Undo_Data = new Multi_Undo_data();
701
                }
702
703
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
704
                {
705
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
706
                });
707
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
708
            }
709
        }
710
711
        //강인구 추가(Undo End)
712
        private void cbDashStyle_SelectionChanged(object sender, SelectionChangedEventArgs e)
713
        {
714
            //강인구 추가
715
            if (this.ParentOfType<MainWindow>() != null)
716
            {
717
                ViewerDataModel.Instance.DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
718
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
719
                {
720
                    Undo_data UndoData = new Undo_data()
721
                    {
722
                        IsUndo = false,
723
                        Event = Event_Type.Option,
724
                        EventTime = DateTime.Now,
725
                        DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData,
726
                        Markup_List = new List<Multi_Undo_data>()
727
                    };
728
                    Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
729
730
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
731
                    {
732
                        if (item.GetType().Name == "AdornerFinal")
733
                        {
734
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
735
                            {
736
                                switch (InnerItem.DrawingData.GetType().Name)
737
                                {
738
                                    case ("LineControl"):
739
                                        {
740
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
741
                                        }
742
                                        break;
743
                                    case ("ArcControl"):
744
                                        {
745
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
746
                                        }
747
                                        break;
748
                                    case ("ArrowControl_Multi"):
749
                                        {
750
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
751
                                        }
752
                                        break;
753
                                    case ("CloudControl"):
754
                                        {
755
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
756
                                        }
757
                                        break;
758
                                    case ("PolygonControl"):
759
                                        {
760
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
761
                                        }
762
                                        break;
763
                                    case ("RectangleControl"):
764
                                        {
765
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
766
                                        }
767
                                        break;
768
                                    case ("RectCloudControl"):
769
                                        {
770
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
771
                                        }
772
                                        break;
773
                                    case ("TriControl"):
774
                                        {
775
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
776
                                        }
777
                                        break;
778
                                    case ("CircleControl"):
779
                                        {
780
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
781
                                        }
782
                                        break;
783
                                }
784
785
                                multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
786
                                UndoData.Markup_List.Add(multi_Undo_Data);
787
                                multi_Undo_Data = new Multi_Undo_data();
788
                            }
789
790
                            ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
791
                            {
792
                                ViewerDataModel.Instance.UndoDataList.Remove(i);
793
                            });
794
                            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
795
                        }
796
                    }
797
                }
798
            }
799
        }
800
801
        //강인구 추가
802
        private void comboFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
803
        {
804
            if (this.ParentOfType<MainWindow>() != null)
805
            {
806
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
807
                {
808
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
809
                    {
810
                        if (item.GetType().Name == "AdornerFinal")
811
                        {
812
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
813
                            {
814
                                switch (InnerItem.DrawingData.GetType().Name)
815
                                {
816
                                    case ("TextControl"):
817
                                        {
818
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Text);
819
                                        }
820
                                        break;
821
                                    case ("ArrowTextControl"):
822
                                        {
823
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Text);
824
                                        }
825
                                        break;
826
                                }
827
                            }
828
                        }
829
                    }
830
                }
831
            }
832
        }
833
834
        //강인구 추가
835
        private void btnBold_Checked(object sender, RoutedEventArgs e)
836
        {
837
            if (this.ParentOfType<MainWindow>() != null)
838
            {
839
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
840
                {
841
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
842
                    {
843
                        if (item.GetType().Name == "AdornerFinal")
844
                        {
845
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
846
                            {
847
                                switch (InnerItem.DrawingData.GetType().Name)
848
                                {
849
                                    case ("TextControl"):
850
                                        {
851
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight == FontWeights.Heavy)
852
                                            {
853
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Normal;
854
                                            }
855
                                            else
856
                                            {
857
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Heavy;
858
                                            }
859
860
                                        }
861
                                        break;
862
                                    case ("ArrowTextControl"):
863
                                        {
864
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight == FontWeights.Heavy)
865
                                            {
866
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Normal;
867
                                            }
868
                                            else
869
                                            {
870
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Heavy;
871
                                            }
872
                                        }
873
                                        break;
874
                                }
875
                            }
876
                        }
877
                    }
878
                }
879
            }
880
        }
881
882
        //강인구 추가
883
        private void btnItalic_Checked(object sender, RoutedEventArgs e)
884
        {
885
            if (this.ParentOfType<MainWindow>() != null)
886
            {
887
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
888
                {
889
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
890
                    {
891
                        if (item.GetType().Name == "AdornerFinal")
892
                        {
893
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
894
                            {
895
                                switch (InnerItem.DrawingData.GetType().Name)
896
                                {
897
                                    case ("TextControl"):
898
                                        {
899
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle == FontStyles.Italic)
900
                                            {
901
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = System.Windows.FontStyles.Normal;
902
                                            }
903
                                            else
904
                                            {
905
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = FontStyles.Italic;
906
                                            }
907
908
                                        }
909
                                        break;
910
                                    case ("ArrowTextControl"):
911
                                        {
912
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle == FontStyles.Italic)
913
                                            {
914
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Normal;
915
                                            }
916
                                            else
917
                                            {
918
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Italic;
919
                                            }
920
                                        }
921
                                        break;
922
                                }
923
                            }
924
                        }
925
                    }
926
                }
927
            }
928
        }
929
930
        //강인구 추가
931
        private void btnUnderLine_Checked(object sender, RoutedEventArgs e)
932
        {
933
            if (this.ParentOfType<MainWindow>() != null)
934
            {
935
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
936
                {
937
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
938
                    {
939
                        if (item.GetType().Name == "AdornerFinal")
940
                        {
941
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
942
                            {
943
                                switch (InnerItem.DrawingData.GetType().Name)
944
                                {
945
                                    case ("TextControl"):
946
                                        {
947
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine == TextDecorations.Underline)
948
                                            {
949
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = null;
950
                                            }
951
                                            else
952
                                            {
953
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
954
                                            }
955
                                        }
956
                                        break;
957
                                    case ("ArrowTextControl"):
958
                                        {
959
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
960
                                            {
961
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
962
                                            }
963
                                            else
964
                                            {
965
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
966
                                            }
967
                                        }
968
                                        break;
969
                                }
970
                            }
971
                        }
972
                    }
973
                }
974
            }
975
        }
976
        
977
        //강인구 추가
978
        private void RadRibbonComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
979
        {
980
            if (this.ParentOfType<MainWindow>() != null)
981
            {
982
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
983
                {
984
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
985
                    {
986
                        if (item.GetType().Name == "AdornerFinal")
987
                        {
988
                            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
989
                            {
990
                                switch (InnerItem.DrawingData.GetType().Name)
991
                                {
992
                                    case ("TextControl"):
993
                                        {
994
                                            //if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily == TextDecorations.Underline)
995
                                            //{
996
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily = new FontFamily(comboFontFamily.Text);
997
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBlock.FontFamily = new FontFamily(comboFontFamily.Text);
998
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBox.FontFamily = new FontFamily(comboFontFamily.Text);
999
                                            //}
1000
                                            //else
1001
                                            //{
1002
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
1003
                                            //}
1004
                                        }
1005
                                        break;
1006
                                    case ("ArrowTextControl"):
1007
                                        {
1008
                                            //if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
1009
                                            //{
1010
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
1011
                                            //}
1012
                                            //else
1013
                                            //{
1014
                                            //    (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
1015
                                            //}
1016
                                        }
1017
                                        break;
1018
                                }
1019
                            }
1020
                        }
1021
                    }
1022
                }
1023
            }
1024
        }
1025
1026
        /// <summary>
1027
        /// 텍스트 컨트롤 하일라이트 처리
1028
        /// </summary>
1029
        /// <param name="sender"></param>
1030
        /// <param name="e"></param>
1031
        private void HighlightEvent(object sender, RoutedEventArgs e)
1032
        {
1033
1034
            ViewerDataModel.Instance.checkHighShape = (sender as CheckBox).IsChecked.Value;
1035
            SetHighlightEvent();
1036
            //if ((sender as CheckBox).IsChecked.Value)
1037
            //{
1038
            //    TaskMessage("HighLight가 설정되었습니다", TaskMessageType.Normal);
1039
            //}
1040
            //else
1041
            //{
1042
            //    TaskMessage("HighLight가 해제되었습니다", TaskMessageType.Caption);
1043
            //}
1044
            //if (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl != null)
1045
            //{
1046
            //    MarkupToPDF.Controls.Text.TextControl instance = (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl);
1047
            //    instance.IsHighLight = ViewerDataModel.Instance.checkHighShape;
1048
            //    instance.SetText();
1049
            //}
1050
        }
1051
1052
        //강인구 추가페이지 이동 엔터
1053
        private void tlcurrentPage_KeyDown(object sender, KeyEventArgs e)
1054
        {
1055
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1056
            if (e.Key == Key.Enter)
1057
            {
1058
                try
1059
                {
1060
                    var instanceMain = this.ParentOfType<MainWindow>();
1061
                    instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text));
1062
                }
1063
                catch (Exception)
1064
                {
1065
                    RadWindow.Alert(new DialogParameters
1066
                    {
1067
                        Theme = new VisualStudio2013Theme(),
1068
                        Header = "안내",
1069
                        Content = "페이지 번호를 정확하게 입력해 주세요",
1070
                    });
1071
                }
1072
                
1073
            }
1074
        }
1075
1076
        public event EventHandler<WindowClosedEventArgs> Closed;
1077
1078
        //private void CheckEvent(object sender, RoutedEventArgs e)
1079
        //{
1080
        //    RadWindow CheckPop = new RadWindow();
1081
        //    test check = new test();
1082
1083
        //    CheckPop = new RadWindow
1084
        //    {
1085
        //        Width = 1700,
1086
        //        Height = 510,
1087
        //        Header = "My Check List",
1088
        //        Content = check,
1089
        //        Owner = this,
1090
        //        ResizeMode = System.Windows.ResizeMode.NoResize,
1091
        //        WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1092
        //    };
1093
        //    StyleManager.SetTheme(CheckPop, new VisualStudio2013Theme());
1094
1095
        //    CheckPop.Closed += CheckPop_Closed;
1096
        //    CheckPop.ShowDialog();
1097
        //}
1098
1099
        private void PanoramaEvent(object sender, RoutedEventArgs e)
1100
        {
1101
            PanoramaShow();
1102
        }
1103
1104
        public void PanoramaShow()
1105
        {
1106
            Panorama check = new Panorama();
1107
            double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
1108
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
1109
            //double windowWidth = this.Width;
1110
            //double windowHeight = this.Height;
1111
1112
            var PanoramaPop = new RadWindow
1113
            {
1114
                //MinWidth = 600,
1115
                //MinHeight = 400,
1116
                //Header = "My Check List",
1117
                Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1118
                Content = check,
1119
                Owner = this,
1120
                ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1121
                //ResizeMode = System.Windows.ResizeMode.NoResize,
1122
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1123
                IsTopmost = false,
1124
                //Left = (screenWidth / 2) - (windowWidth / 2),
1125
                //Top = (screenHeight / 2) - (windowHeight / 2),
1126
                //Left = (screenWidth / 2),
1127
                //Top = (screenHeight / 2),
1128
                Width = screenWidth * 0.4,
1129
                Height = screenHeight * 0.4,
1130
            };
1131
            StyleManager.SetTheme(PanoramaPop, new VisualStudio2013Theme());
1132
            //CheckPop.ShowDialog();
1133
            PanoramaPop.Show();
1134
        }
1135
        private void CheckEvent(object sender, RoutedEventArgs e)
1136
        {
1137
            //창이 떠있을 경우 재 실행 방지
1138
            if (isClosed)
1139
            {
1140
                //토글 및 마우스 상태 초기화
1141
                var toggleList = this.Parent.ChildrenOfType<RadToggleButton>();
1142
                foreach(var togle in toggleList)
1143
                {
1144
                    togle.IsChecked = false;
1145
                }
1146
                this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1147
1148
                isClosed = false;
1149
1150
                
1151
                CheckList check = new CheckList();
1152
1153
                CheckPop = new RadWindow
1154
                {
1155
                    MinWidth = 1200,
1156
                    MinHeight = 500,
1157
                    //Header = "My Check List",
1158
                    Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1159
                    Content = check,
1160
                    Owner = this,
1161
                    //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1162
                    ResizeMode = System.Windows.ResizeMode.NoResize,
1163
                    WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1164
                    IsTopmost = true,
1165
                };
1166
                StyleManager.SetTheme(CheckPop, new Office2013Theme());
1167
                CheckPop.Closed += CheckPop_Closed;
1168
                
1169
                //CheckPop.ShowDialog();
1170
                CheckPop.Show();
1171
            }
1172
        }
1173
1174
        private void CheckPop_Closed(object sender, WindowClosedEventArgs e)
1175
        {
1176
            isClosed = true;
1177
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
1178
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1179
            ViewerDataModel.Instance.Capture_Opacity = 0;
1180
        }
1181
1182
        private void PageGoEvent(object sender, RoutedEventArgs e)
1183
        {
1184
            RadButton button = sender as RadButton;
1185
            var instanceMain = this.ParentOfType<MainWindow>();
1186
            
1187
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1188
            try
1189
            {
1190
                switch (button.CommandParameter.ToString())
1191
                {
1192
                    case "Down":
1193
                        {
1194
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) + 1);
1195
                        }
1196
                        break;
1197
                    case "Up":
1198
                        {
1199
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) - 1);
1200
                        }
1201
                        break;
1202
                }
1203
            }
1204
            catch (Exception)
1205
            {
1206
                RadWindow.Alert(new DialogParameters
1207
                {
1208
                    Theme = new VisualStudio2013Theme(),
1209
                    Header = "안내",
1210
                    Content = "페이지 번호를 정확하게 입력해 주세요",
1211
                });
1212
            }
1213
        }
1214
1215
        private void viewEvent(object sender, RoutedEventArgs e)
1216
        {
1217
            RadButton viewButton = sender as RadButton;
1218
            var instanceMain = this.ParentOfType<MainWindow>();
1219
1220
            Point point = new Point(instanceMain.dzMainMenu.zoomAndPanCanvas.Width / 2, instanceMain.dzMainMenu.zoomAndPanCanvas.Height / 2);
1221
1222
            switch (viewButton.CommandParameter.ToString())
1223
            {
1224
                case "zoomout":
1225
                    {
1226
                        //장원
1227
                        //instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(new Rect(0, 0, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualWidth, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualHeight));
1228
1229
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale -= 0.1, point);
1230
                        //Common.ViewerDataModel.Instance.zom
1231
                    }
1232
                    break;
1233
                case "zoomin":
1234
                    {
1235
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale += 0.1, point);
1236
                    }
1237
                    break;
1238
                case "fullscreen":
1239
                    {
1240
                        instanceMain.WindowState = WindowState.Maximized;
1241
                        instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit;
1242
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1243
                    }
1244
                    break;
1245
                case "fitWidth":
1246
                    {
1247
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1248
                    }
1249
                    break;
1250
                case "fitHeight":
1251
                    {
1252
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1253
                    }
1254
                    break;
1255
                case "boundzoom":
1256
                    {                       
1257
1258
                            bool isGO = false;
1259
                            instanceMain.dzMainMenu.imageViewer.MouseLeftButtonDown += (sen, ea) =>
1260
                            {
1261
                                isGO = true;
1262
                            };
1263
                            instanceMain.dzMainMenu.imageViewer.MouseLeftButtonUp += (sen, ea) =>
1264
                            {
1265
                                isGO = false;
1266
                            };
1267
                            instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit;
1268
                            instanceMain.dzMainMenu.imageViewer.InteractiveMode = Leadtools.Windows.Controls.InteractiveMode.UserRectangle;
1269
                            instanceMain.dzMainMenu.imageViewer.InteractiveUserRectangle += (sen, ea) =>
1270
                            {
1271
                                System.Diagnostics.Debug.WriteLine(ea.Bounds);
1272
                                if (ea.Status == Leadtools.Windows.Controls.InteractiveModeStatus.End)
1273
                                {
1274
                                //zoomAndPanControl.ZoomTo(ea.Bounds);
1275
                                instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(ea.Bounds);
1276
                                    instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Normal;
1277
                                    instanceMain.dzMainMenu.imageViewer.InteractiveMode = Leadtools.Windows.Controls.InteractiveMode.None;
1278
                                }
1279
                            };
1280
                            //Canvas.SetZIndex(instanceMain.dzMainMenu.imageViewer, 10);
1281
                    }
1282
                    break;
1283
                case "Rotate_M":
1284
                    {
1285
                        drawingPannelRotate(false);
1286
                        //UpdateLayout();
1287
                    }
1288
                    break;
1289
                case "Rotate_P":
1290
                    {
1291
                        drawingPannelRotate(true);
1292
                        //UpdateLayout();
1293
                    }
1294
                    break;
1295
                case "Rotate_half":
1296
                    {
1297
                        drawingPannelRotate(true);
1298
                        drawingPannelRotate(true);
1299
                        //UpdateLayout();
1300
                    }
1301
                    break;
1302
            }
1303
        }
1304
1305
        #region 대기
1306
1307
        public void drawingPannelRotate(bool Flag)
1308
        {
1309
            var instanceMain = this.ParentOfType<MainWindow>();
1310
1311
            //if (rotateOffSet > 3)
1312
            //    rotateOffSet = 0;
1313
1314
            //if (rotateOffSet < 0)
1315
            //    rotateOffSet = 3;
1316
1317
            if(Flag)
1318
            {
1319
                if (instanceMain.dzMainMenu.rotate.Angle == 270)
1320
                {
1321
                    instanceMain.dzMainMenu.rotate.Angle = 0;
1322
                }
1323
                else
1324
                {
1325
                    instanceMain.dzMainMenu.rotate.Angle += 90;
1326
                }
1327
            }
1328
            else
1329
            {
1330
                if(instanceMain.dzMainMenu.rotate.Angle == 0)
1331
                {
1332
                    instanceMain.dzMainMenu.rotate.Angle = 270;
1333
                }
1334
                else
1335
                {
1336
                    instanceMain.dzMainMenu.rotate.Angle -= 90;
1337
                }
1338
            }
1339
            //double angle = (double)rotateValue.GetValue(rotateOffSet);
1340
            //instanceMain.dzMainMenu.rotate.Angle = angle;
1341
            var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90));
1342
1343
            if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth)
1344
            {
1345
                double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1346
                instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1347
                instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize;
1348
            }
1349
            if (instanceMain.dzMainMenu.rotate.Angle == 0)
1350
            {
1351
                instanceMain.dzMainMenu.translate.X = 0;
1352
                instanceMain.dzMainMenu.translate.Y = 0;
1353
            }
1354
            else if (instanceMain.dzMainMenu.rotate.Angle == 90)
1355
            {
1356
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1357
                instanceMain.dzMainMenu.translate.Y = 0;
1358
            }
1359
            else if (instanceMain.dzMainMenu.rotate.Angle == 180)
1360
            {
1361
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1362
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1363
            }
1364
            else
1365
            {
1366
                instanceMain.dzMainMenu.translate.X = 0;
1367
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1368
            }
1369
1370
1371
            instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle;
1372
            instanceMain.dzMainMenu.imageViewer.RotateAngle = instanceMain.dzMainMenu.rotate.Angle;
1373
1374
1375
            ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1376
            ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1377
            ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X;
1378
            ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y;
1379
            ViewerDataModel.Instance.Angle = instanceMain.dzMainMenu.rotate.Angle;
1380
            //ViewerDataModel.Instance.Document_Info.Clear();
1381
            //ViewerDataModel.Instance.Document_Info.Where(i => i.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(value =>
1382
            //{
1383
            //    value.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1384
            //});
1385
1386
1387
            //이미지 각도 변경 시 실시간 Thumbnail 각도 변경(강인구 추가)
1388
            instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Where(info => info.PageNumber == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(data =>
1389
            {
1390
                data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1391
1392
                instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems;
1393
                var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault();
1394
                instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1395
1396
                instanceMain.dzMainMenu.pageNavigator.setPageChange(data);
1397
            });
1398
        }
1399
        #endregion
1400
1401
        private void ImageConverter()
1402
        {
1403
            var instanceMain = this.ParentOfType<MainWindow>();
1404
            //http://cloud.devdoftech.co.kr:5977/ImageUpload/FileUpload.asmx
1405
1406
1407
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
1408
            dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png";
1409
            Nullable<bool> result = dlg.ShowDialog();
1410
            if (result == true)
1411
            {
1412
                instanceMain.dzMainMenu.filename = dlg.FileName;
1413
                instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1414
1415
                System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename);
1416
                String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename);
1417
                long numByte = fileInfo.Length;
1418
                double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
1419
                kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
1420
1421
                if (dLen < 4)
1422
                {
1423
                    System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename,
1424
                    System.IO.FileMode.Open, System.IO.FileAccess.Read);
1425
                    System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
1426
                    byte[] data = br.ReadBytes((int)numByte);
1427
                    br.Close();
1428
1429
                    instanceMain.dzMainMenu.filename = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data);
1430
                    fStream.Close();
1431
                    fStream.Dispose();
1432
                }
1433
            }
1434
        }
1435
1436
        private void ControlEvent(object sender, RoutedEventArgs e)
1437
        {
1438
            RadToggleButton instanceToggle = sender as RadToggleButton;
1439
            var instanceMain = this.ParentOfType<MainWindow>();
1440
1441
            #region Ctrl + A 눌렀을 때 대처 방법 
1442
            //원인 : Ctrl + A를 누르면 UIElementSet에 등록을 시키지 않는다(이유는 한꺼번에 많은 양의 컨트롤의 동작이 유입되기 때문에
1443
            //       시스템의 성능저하를 불러올 수 있기 때문이다. 그래서 선택 후 다른 컨트롤을 누르면 등록되지 않은 컨트롤이기 때문에 삭제된다
1444
            //       이를 대처하는 방법으로 아래 코드를 사용한다.
1445
            if (Common.ViewerDataModel.Instance.MarkupControls.Count == 0 && Common.ViewerDataModel.Instance.MarkupControls.Count >= 1)
1446
            {
1447
                //var lstItem = instanceMain.DeepLayer._SelectLayer.ChildrenOfType<AdornerFinal>().ToList();
1448
                //foreach (var item in lstItem)
1449
                //{
1450
                //    foreach (var member in item.MemberSet)
1451
                //    {
1452
                //        if (!instanceMain.DeepLayer.UIElementSet.Contains(member.DrawingData))
1453
                //        {
1454
                //            instanceMain.DeepLayer.UIElementSet.Add(member.DrawingData);
1455
                //        }
1456
                //    }
1457
                //}
1458
            }
1459
            #endregion
1460
1461
            //if (!instanceMain.IsFreeSelectionMode)
1462
            //{
1463
            //    instanceMain.IsSwingMode = true;
1464
            //}
1465
1466
            Release_ToggleButton(sender); //-> 해당 컨트롤을 제외한 모든 컨트롤에 대해 해제 처리
1467
            if (instanceToggle != null)
1468
            {
1469
                Common.ViewerDataModel.Instance.ControlTag = instanceToggle.Tag.ToString();
1470
            }
1471
            else if ((sender as RadRibbonToggleButton) != null)
1472
            {
1473
                Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString();
1474
                instanceToggle = (sender as RadRibbonToggleButton);
1475
            }
1476
            else if ((sender as RadRibbonButton) != null)
1477
            {
1478
                RadRibbonButton instanceButton = sender as RadRibbonButton;
1479
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1480
            }
1481
            else
1482
            {
1483
                RadButton instanceButton = sender as RadButton;
1484
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1485
            }
1486
1487
1488
1489
            #region 다른 컨트롤 버튼 선택 해제
1490
            System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.SelectedControl).Subscribe(ControlState =>
1491
            {
1492
                if (ControlState == null)
1493
                {
1494
                    instanceToggle.IsChecked = false;
1495
                    HiddenControlHide();
1496
                }
1497
            });
1498
            #endregion
1499
1500
            System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleVisibility).Subscribe(isSee =>
1501
            {
1502
                instanceMain.dzMainMenu.MainAngle.Visibility = isSee;
1503
                System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleValue).Subscribe(p =>
1504
                {
1505
                    instanceMain.dzMainMenu.MainAngle.AngleValue = p;
1506
                });
1507
            });
1508
            instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
1509
1510
            instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
1511
1512
            if (instanceToggle.IsChecked != false)
1513
            {
1514
                #region 컨트롤이 체크되었다면
1515
                switch (instanceToggle.CommandParameter.ToString())
1516
                {
1517
                    #region Line
1518
                    case "Line":
1519
                        Common.ViewerDataModel.Instance.SelectedControl = "Line";
1520
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1521
                        if (instanceToggle.Tag.ToString() == "LineDelete")
1522
                        {
1523
                            //HiddenInterval.Visibility = Visibility.Visible;
1524
                        }
1525
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.SingleLine;
1526
                        break;
1527
                    #endregion
1528
                    #region ChainLine
1529
                    case "ChainLine":
1530
                        Common.ViewerDataModel.Instance.SelectedControl = "ChainLine";
1531
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1532
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ChainLine;
1533
                        break;
1534
                    #endregion
1535
                    #region DimLine
1536
                    case "DimLine":
1537
                        Common.ViewerDataModel.Instance.SelectedControl = "DimLine";
1538
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1539
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.DimLine;
1540
                        break;
1541
                    #endregion
1542
                    #region TwinLine
1543
                    case "TwinLine":
1544
                        Common.ViewerDataModel.Instance.SelectedControl = "TwinLine";
1545
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1546
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TwinLine;
1547
                        break;
1548
                    #endregion
1549
                    #region CancelLine
1550
                    case "CancelLine":
1551
                        Common.ViewerDataModel.Instance.SelectedControl = "CancelLine";
1552
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1553
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.CancelLine;
1554
                        break;
1555
                    #endregion
1556
                    #region PolygonCloud
1557
                    case "PolygonCloud":
1558
                        Common.ViewerDataModel.Instance.SelectedControl = "PolygonCloud";
1559
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1560
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonCloud;
1561
                        break;
1562
                    #endregion
1563
                    #region RectCloud
1564
                    case "RectCloud":
1565
                        Common.ViewerDataModel.Instance.SelectedControl = "RectCloud";
1566
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1567
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.RectCloud;
1568
                        break;
1569
                    #endregion
1570
                    #region RectCloud
1571
                    case "Rectangle":
1572
                        Common.ViewerDataModel.Instance.SelectedControl = "Rectangle";
1573
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1574
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Rectangle;
1575
                        break;
1576
                    #endregion
1577
                    #region RectCloud
1578
                    case "Triangle":
1579
                        Common.ViewerDataModel.Instance.SelectedControl = "Triangle";
1580
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1581
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Triangle;
1582
                        break;
1583
                    #endregion
1584
                    #region RectCloud
1585
                    case "Circle":
1586
                        Common.ViewerDataModel.Instance.SelectedControl = "Circle";
1587
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1588
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Circle;
1589
                        break;
1590
                    #endregion
1591
                    #region Symbol
1592
                    case "Symbol":
1593
                        Common.ViewerDataModel.Instance.SelectedControl = "Symbol";
1594
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1595
                        break;
1596
                    #endregion
1597
                    #region SymbolN
1598
                    case "SymbolN":
1599
                        Common.ViewerDataModel.Instance.SelectedControl = "SymbolN";
1600
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Stamp;
1601
                        break;
1602
                    #endregion
1603
                    #region Text
1604
                    case "Text":
1605
                        Common.ViewerDataModel.Instance.SelectedControl = "Text";
1606
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1607
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextControl;
1608
                        break;
1609
                    #endregion
1610
                    #region TextBorder
1611
                    case "TextBorder":
1612
                        Common.ViewerDataModel.Instance.SelectedControl = "TextBorder";
1613
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1614
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextBorder;
1615
                        break;
1616
                    #endregion
1617
                    #region TextCloud
1618
                    case "TextCloud":
1619
                        Common.ViewerDataModel.Instance.SelectedControl = "TextCloud";
1620
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
1621
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextCloud;
1622
                        break;
1623
                    #endregion
1624
                    #region Date
1625
                    case "Date":
1626
                        Common.ViewerDataModel.Instance.SelectedControl = "Date";
1627
                        TaskMessage("날짜 컨트롤을 더블 클릭하면 날짜를 변경할 수 있습니다", TaskMessageType.Normal);
1628
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Date;
1629
                        break;
1630
                    #endregion
1631
                    #region ArrowText
1632
                    case "ArrowText":
1633
                        TaskMessage("ArrowText 컨트롤은 그린 후 컨트롤을 선택하였을 시 중간점을 조정할 수 있습니다", TaskMessageType.Normal);
1634
                        if (instanceToggle.Tag.ToString() == "ArrowText_Cloud")
1635
                        {
1636
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowText_Cloud";
1637
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl;
1638
                        }
1639
                        else if (instanceToggle.Tag.ToString() == "ArrowText_Border")
1640
                        {
1641
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTextBorderControl";
1642
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl;
1643
                        }
1644
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Normal")
1645
                        {
1646
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextControl";
1647
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl;
1648
                        }
1649
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Border")
1650
                        {
1651
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextBorderControl";
1652
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl;
1653
                        }
1654
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Cloud")
1655
                        {
1656
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextCloudControl";
1657
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl;
1658
                        }
1659
                        else
1660
                        {
1661
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowText";
1662
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextControl;
1663
                            //HiddenAxisLock.Visibility = Visibility.Visible;
1664
                        }
1665
                        break;
1666
                    #endregion
1667
                    #region Arrow
1668
                    case "Arrow":
1669
                        Common.ViewerDataModel.Instance.SelectedControl = "Arrow";
1670
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1671
                        //HiddenDimSize.Visibility = Visibility.Visible;
1672
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowLine;
1673
                        break;
1674
                    #endregion
1675
                    #region Shape
1676
                    case "Shape":
1677
                        Common.ViewerDataModel.Instance.SelectedControl = "Shape";
1678
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
1679
                        break;
1680
                    #endregion
1681
                    #region Polygon
1682
                    case "Polygon":
1683
                        Common.ViewerDataModel.Instance.SelectedControl = "Polygon";
1684
                        TaskMessage("자유형 코멘트 도구는 오른쪽 마우스 클릭을 통해 그리기를 마칠 수 있습니다", TaskMessageType.Normal);
1685
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1686
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonControl;
1687
                        break;
1688
                    #endregion
1689
                    #region Arc
1690
                    case "Arc":
1691
                        Common.ViewerDataModel.Instance.SelectedControl = "Arc";
1692
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcLine;
1693
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1694
                        TaskMessage("Arc 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal);
1695
                        break;
1696
                    #endregion
1697
                    #region ArrowMulti
1698
                    case "ArrowMulti":
1699
                        Common.ViewerDataModel.Instance.SelectedControl = "ArrowMulti";
1700
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowMultiLine;
1701
                        //HiddenAxisLock.Visibility = Visibility.Visible;
1702
                        break;
1703
                    #endregion
1704
                    #region Etc
1705
                    case "Etc":
1706
                        Common.ViewerDataModel.Instance.SelectedControl = "Etc";
1707
                        break;
1708
                    #endregion
1709
                    #region Ink
1710
                    case "Ink":
1711
                        if (instanceToggle.Tag.ToString() == "EraserClear")
1712
                        {
1713
                            TaskMessage("해당 컨트롤은 점 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal);
1714
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
1715
                            instanceMain.dzMainMenu.inkBoard.Tag = "EraseByPoint";
1716
                        }
1717
                        else if (instanceToggle.Tag.ToString() == "Eraser")
1718
                        {
1719
                            TaskMessage("해당 컨트롤은 선 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal);
1720
                            instanceMain.dzMainMenu.inkBoard.Tag = "EraseByStroke";
1721
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
1722
                        }
1723
                        else
1724
                        {
1725
                            instanceMain.dzMainMenu.inkBoard.Tag = "Ink";
1726
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.Ink;
1727
                        }
1728
1729
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = true;
1730
1731
                        Common.ViewerDataModel.Instance.SelectedControl = "Ink";
1732
                        Common.ViewerDataModel.Instance.LineSize = (double)cbLineSize.Value;
1733
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PenControl;
1734
                        break;
1735
                    #endregion
1736
                    #region Select
1737
                    case "Select":
1738
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting;
1739
                        break;
1740
                    #endregion
1741
                    #region Image
1742
                    case "Image":
1743
                        Common.ViewerDataModel.Instance.SelectedControl = "ImgControl";
1744
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1745
                        ImageConverter();
1746
                        break;
1747
                    #endregion
1748
                    #region Sign
1749
                    case "Sign":
1750
                        Common.ViewerDataModel.Instance.SelectedControl = "Sign";
1751
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
1752
                        //강인구 추가
1753
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Sign;
1754
                        //instanceMain.BaseClient.GetUserSignCompleted += (sen, ea) =>
1755
                        //{
1756
                        //    if (ea.Result == null)
1757
                        //    {
1758
1759
                        //        this.ParentOfType<MainPage>().DialogMessage_Alert("You Don't Have Sign Data", "Alert");
1760
                        //    }
1761
                        //    else
1762
                        //    {
1763
                        //        byte[] imageBytes = System.Convert.FromBase64String(ea.Result);
1764
                        //        using (MemoryStream ms = new MemoryStream(imageBytes))
1765
                        //        {
1766
                        //            BitmapImage im = new BitmapImage();
1767
                        //            im.SetSource(ms);
1768
                        //            instanceMain.DeepLayer.SignImage = im;
1769
                        //            ms.Close();
1770
                        //        }
1771
                        //    }
1772
                        //};
1773
                        //instanceMain.BaseClient.GetUserSignAsync(instanceMain._ViewInfo.UserID);
1774
                        break;
1775
                    #endregion
1776
                    #region Check
1777
                    case "Check":
1778
                        Common.ViewerDataModel.Instance.SelectedControl = "Check";
1779
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
1780
                        //강인구 추가
1781
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Symbol;
1782
                        break;
1783
                    #endregion
1784
                    #region Batch
1785
                    case "Batch":
1786
                        Common.ViewerDataModel.Instance.SelectedControl = "Batch";
1787
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
1788
                        //강인구 추가
1789
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
1790
                        break;
1791
                        #endregion
1792
                    default:
1793
                        break;
1794
                }
1795
                #endregion
1796
            }
1797
            else
1798
            {
1799
                
1800
                if (!instanceMain.dzMainMenu.IsFreeSelectionMode)
1801
                {
1802
                    instanceMain.dzMainMenu.IsSwingMode = false;
1803
                    Common.ViewerDataModel.Instance.SelectedControl = "";
1804
                    Common.ViewerDataModel.Instance.ControlTag = null;
1805
                    this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1806
                    this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1807
                }
1808
            }
1809
        }
1810
1811
        //강인구 자동 저장 추가
1812
        private void AutoSave(object sender, RoutedEventArgs e)
1813
        {
1814
            RadToggleButton instanceToggle = sender as RadToggleButton;
1815
1816
            if(instanceToggle.IsChecked == true)
1817
            {
1818
                SaveTime(true);
1819
            }
1820
            else
1821
            {
1822
                SaveTime(false);
1823
            }
1824
        }
1825
1826
    }
1827
}
클립보드 이미지 추가 (최대 크기: 500 MB)