프로젝트

일반

사용자정보

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

markus / KCOM / Events / Implementation / TopMenuEvent.cs @ e46ef756

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

1 787a4489 KangIngu
using KCOM.Common;
2
using KCOM.Common.Converter;
3
using KCOM.Controls;
4
using KCOM.Events;
5 53880c83 ljiyeon
using KCOMDataModel.DataModel;
6 787a4489 KangIngu
using MarkupToPDF.Common;
7
using System;
8
using System.Collections.Generic;
9
using System.Linq;
10
using System.Text;
11
using System.Windows;
12
using System.Windows.Controls;
13
using System.Windows.Input;
14
using System.Windows.Media;
15 53880c83 ljiyeon
using System.Windows.Media.Imaging;
16 787a4489 KangIngu
using Telerik.Windows.Controls;
17 684ef11c ljiyeon
using IKCOM;
18
using Microsoft.Win32;
19
using System.IO;
20
using System.Reflection;
21
using System.Windows.Controls.Primitives;
22 036650a0 humkyung
using MarkupToPDF.Controls.Parsing;
23 2dfbf711 ljiyeon
using Telerik.Windows.Data;
24
using System.ComponentModel;
25 6dcbe4a7 humkyung
using System.Web;
26 24c5e56c taeseongkim
using Markus.Fonts;
27 b42dd24d taeseongkim
using System.Threading.Tasks;
28 5b48dae7 taeseongkim
using System.Windows.Threading;
29 9380813b swate0609
using System.Text.RegularExpressions;
30 b79d6e7f humkyung
using MarkupToPDF.Controls.Shape;
31
using MarkupToPDF.Controls.Polygon;
32
using MarkupToPDF.Controls.Line;
33 787a4489 KangIngu
34
namespace KCOM.Views
35
{
36
    public partial class TopMenu : UserControl
37
    {
38
        public int rotateOffSet = 0;
39
        private double[] rotateValue = { 0, 90, 180, 270 };
40
        public System.Windows.Threading.DispatcherTimer SaveTimer { get; set; }
41
        public bool isClosed = true;
42
        public RadWindow CheckPop;
43 53880c83 ljiyeon
        public RadWindow OptionPop;
44 787a4489 KangIngu
45
        /// <summary>
46
        /// TaskBar에 메시지를 입력합니다
47
        /// </summary>
48
        /// <param name="message"></param>
49
        /// <param name="type"></param>
50
        public void TaskMessage(string message, TaskMessageType type)
51
        {
52 129ca191 humkyung
            /*
53
            if (taskBar != null)
54
            {
55
                string color = "";
56
                taskBar.Content = message;
57
                DicTaskMessage.TryGetValue(type, out color);
58 3abe8d4e taeseongkim
                taskBar.Foreground = new SolidColorBrush(StringToColorBrushConverter.Parse(color));
59 129ca191 humkyung
            }
60
            */
61 787a4489 KangIngu
        }
62
63
        /// <summary>
64
        /// Task Type명을 Key값으로 지정합니다
65
        /// </summary>
66
        public enum TaskMessageType
67
        {
68
            Normal,
69
            Caption,
70
            Error,
71
        }
72
73
        private void CheckShapeState()
74
        {
75
76
77
            if (cbHatchShape.IsChecked == true)
78
            {
79
                cbFillShape.IsChecked = false;
80
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch;
81
            }
82
            else if(cbFillShape.IsChecked == true)
83
            {
84
                cbHatchShape.IsChecked = false;
85
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill;
86
            }
87
            else
88
            {
89
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;
90
            }
91
        }
92
93 c5519c44 taeseongkim
        /// <summary>
94
        ///  comment의 속성 변경시 저장여부 확인 하도록 undocommand에 추가
95
        /// </summary>
96
        /// <param name="adnoerFinal"></param>
97
        public void ChangeComment(Controls.AdornerFinal adnoerFinal)
98
        {
99
            var adornerMembers = adnoerFinal.Members.Cast<Controls.AdornerMember>();
100
101
            if (adornerMembers.Count() > 0)
102
            {
103 e5bd2147 swate0609
                //UndoCommand.Instance.Push(adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList(), adnoerFinal.AngleValue);
104 34ac8db7 humkyung
                UndoCommand.Instance.Push(EventType.Operation, adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList());
105 c5519c44 taeseongkim
            }
106
        }
107
108 787a4489 KangIngu
        //강인구 추가(Undo End)
109
        private void SetPaintEvent()
110
        {
111
            List<AdornerMember> AdonerList = GetAdornerItem();
112
113
            if (AdonerList.Count > 0)
114
            {
115 873011c4 humkyung
                UndoDataGroup UndoData = new UndoDataGroup()
116 787a4489 KangIngu
                {
117
                    IsUndo = false,
118 873011c4 humkyung
                    Event = EventType.Operation,
119 787a4489 KangIngu
                    EventTime = DateTime.Now,
120
                    paint = ViewerDataModel.Instance.paintSet,
121 b79d6e7f humkyung
                    MarkupDataColl = new List<UndoData>()
122 787a4489 KangIngu
                };
123 b79d6e7f humkyung
                UndoData multi_UndoData = new UndoData();
124 787a4489 KangIngu
125
                foreach (AdornerMember InnerItem in AdonerList)
126
                {
127 873011c4 humkyung
                    multi_UndoData.PointSet = new List<Point>();
128 787a4489 KangIngu
129
                    if ((InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl) != null)
130
                    {
131
                        (InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl).Paint = ViewerDataModel.Instance.paintSet;
132
                    }
133
134 873011c4 humkyung
                    multi_UndoData.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
135
                    UndoData.MarkupDataColl.Add(multi_UndoData);
136 b79d6e7f humkyung
                    multi_UndoData = new UndoData();
137 787a4489 KangIngu
                }
138
139
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
140
                {
141 ccf944bb ljiyeon
                    ViewerDataModel.Instance.UndoDataList.Remove(i);                    
142 787a4489 KangIngu
                });
143
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
144
            }
145
        }
146
147
        private void SetHighlightEvent()
148
        {
149
            List<AdornerMember> AdonerList = GetAdornerItem();
150
151
            if (AdonerList.Count > 0)
152
            {
153
                foreach (AdornerMember InnerItem in AdonerList)
154
                {
155
                    switch (InnerItem.DrawingData.GetType().Name)
156
                    {
157
                        case ("TextControl"):
158
                            {
159
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape;
160
                            }
161
                            break;
162
                        case ("ArrowTextControl"):
163
                            {
164
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape;
165
                            }
166
                            break;
167
                    }
168
                }
169 5ba8f2d5 taeseongkim
170
                ViewerDataModel.Instance.IsMarkupUpdate = true;
171 787a4489 KangIngu
            }
172
173
        }
174
175
        private void FillShapeEvent(object sender, RoutedEventArgs e)
176
        {
177
            #region 주석
178
            //if ((sender as CheckBox).IsChecked.Value)
179
            //{
180
            //    cbHatchShape.IsChecked = false;
181
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Fill.png", UriKind.Relative));
182
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Fill.png", UriKind.Relative));
183
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle_Fill.png", UriKind.Relative));
184
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon.png", UriKind.Relative));
185
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon.png", UriKind.Relative));
186
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_Fill.png", UriKind.Relative));
187
            //    TaskMessage("채우기 옵션이 적용되었습니다", TaskMessageType.Normal);
188
            //}
189
            //else
190
            //{
191
192
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative));
193
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative));
194
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative));
195
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative));
196
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative));
197
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative));
198
            //    TaskMessage("채우기 옵션이 해제되었습니다", TaskMessageType.Caption);
199
            //}
200
            #endregion
201
            ViewerDataModel.Instance.checkFillShape = (sender as CheckBox).IsChecked.Value;
202
203
            if (ViewerDataModel.Instance.checkFillShape)
204
            {
205
                cbHatchShape.IsChecked = false;
206
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill;
207
            }
208
            else
209
            {
210
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;
211
            }
212
            SetPaintEvent();
213
        }
214
215
        /// <summary>
216
        /// 도형 빗금 처리
217
        /// </summary>
218
        /// <param name="sender"></param>
219
        /// <param name="e"></param>
220
        private void HatchShapeEvent(object sender, RoutedEventArgs e)
221
        {
222
			#region 주석
223
            //if ((sender as CheckBox).IsChecked.Value)
224
            //{
225
            //    cbFillShape.IsChecked = false;
226
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Hatch.png", UriKind.Relative));
227
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Hatch.png", UriKind.Relative));
228
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/rectangle-icon_Hatch.png", UriKind.Relative));
229
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_Hatch.png", UriKind.Relative));
230
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_Hatch.png", UriKind.Relative));
231
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_hatch.png", UriKind.Relative));
232
            //    TaskMessage("무늬 옵션이 적용되었습니다", TaskMessageType.Normal);
233
            //}
234
            //else
235
            //{
236
            //    imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative));
237
            //    imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative));
238
            //    imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative));
239
            //    imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative));
240
            //    imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative));
241
            //    imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative));
242
            //    TaskMessage("무늬 옵션이 해제되었습니다", TaskMessageType.Caption);
243
            //} 
244
            #endregion
245
246
            //강인구 추가
247
            ViewerDataModel.Instance.checkHatchShape = (sender as CheckBox).IsChecked.Value;
248
            if (ViewerDataModel.Instance.checkHatchShape)
249
            {
250
                cbFillShape.IsChecked = false;
251
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch;
252
            }
253
            else
254
            {
255
                ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None;  
256
            }
257
            SetPaintEvent();
258
        }
259
260
        void SaveTimer_Tick(object sender, EventArgs e)
261
        {
262
            //if (this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode != IKCOM.MouseHandlingMode.Drawing)
263
            if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl == null && this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count == 0)
264
            {
265 cb5c7f06 humkyung
                SaveEventCallback(null, null);
266 787a4489 KangIngu
            }
267
        }
268
269
        private void SaveTime(bool IsRun)
270
        {
271
            if(SaveTimer == null)
272
            {
273
                SaveTimer = new System.Windows.Threading.DispatcherTimer();
274
                SaveTimer.Interval = new TimeSpan(0, 0, 5);
275
                SaveTimer.Tick += new EventHandler(SaveTimer_Tick);
276
            }
277
278
            if (IsRun)
279
            {
280
                SaveTimer.Start();
281
            }
282
            else
283
            {
284
                SaveTimer.Stop();
285
            }
286
        }
287 537f4cd8 djkim
        private void SaveTime(bool IsRun,int timeinterval)
288
        {
289
            if (SaveTimer == null)
290
            {
291
                SaveTimer = new System.Windows.Threading.DispatcherTimer();
292
                SaveTimer.Interval = new TimeSpan(0, timeinterval, 0);
293
                SaveTimer.Tick += new EventHandler(SaveTimer_Tick);
294
            }
295
            else
296
            {
297
                SaveTimer.Stop();
298
                SaveTimer.Interval = new TimeSpan(0, timeinterval, 0);
299
            }
300 787a4489 KangIngu
301 537f4cd8 djkim
            if (IsRun)
302
            {
303
                SaveTimer.Start();
304
            }
305
            else
306
            {
307
                SaveTimer.Stop();
308
            }
309
        }
310 532d83ef humkyung
        /// <summary>
311
        /// enable busy indicator and then call _SaveEvent method.
312
        /// </summary>
313
        /// <param name="sender"></param>
314
        /// <param name="e"></param>
315 1d79913e taeseongkim
        public  void SaveEventCallback(object sender, RoutedEventArgs e)
316 787a4489 KangIngu
        {
317 f65e6c02 taeseongkim
            var mianMenu = this.ParentOfType<MainWindow>().dzMainMenu;
318 787a4489 KangIngu
319 f65e6c02 taeseongkim
            if (mianMenu.busyIndicator.IsBusy == true)
320 532d83ef humkyung
            {
321 f65e6c02 taeseongkim
                return;
322
            }
323
324 77cdac33 taeseongkim
            //var result = await Dispatcher.InvokeAsync<bool>(()=>
325
            //{
326 f65e6c02 taeseongkim
                this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = true;
327
328
                _SaveEvent(sender, e);
329
330
                mianMenu.busyIndicator.IsBusy = false;
331 77cdac33 taeseongkim
               
332
            //});
333 f65e6c02 taeseongkim
334
            //System.Threading.Tasks.Task SaveTask = System.Threading.Tasks.Task.Factory.StartNew(() =>
335
            //{
336
            //    Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action<object, RoutedEventArgs>(_SaveEvent), sender, e);
337
            //}).ContinueWith(task =>
338
            //{
339
            //    Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate () { this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = false; }));
340
            //});
341 532d83ef humkyung
        }
342 787a4489 KangIngu
343 532d83ef humkyung
        /// <summary>
344 d62c0439 humkyung
        /// save markup
345 cb5c7f06 humkyung
        ///  - convert ink control to polygon control if ink control exists
346
        ///  - unselect and update my markup list
347 532d83ef humkyung
        /// <param name="sender"></param>
348
        /// <param name="e"></param>
349 646a4bb9 humkyung
        public async Task<bool> _SaveEvent(object sender, RoutedEventArgs e)
350 532d83ef humkyung
        {
351 b42dd24d taeseongkim
            bool result = false;
352
353 f65e6c02 taeseongkim
            var mainMenu = this.ParentOfType<MainWindow>().dzMainMenu;
354 532d83ef humkyung
            try
355 787a4489 KangIngu
            {
356 f65e6c02 taeseongkim
                mainMenu.ConvertInkControlToPolygon();
357 f729ef4e humkyung
358 f65e6c02 taeseongkim
                mainMenu.UpdateMyMarkupList();
359 8129f2a5 ljiyeon
360 f65e6c02 taeseongkim
                if (mainMenu.gridViewMarkup.SelectedItems.Count == 0 && mainMenu.gridViewMarkup.Items.Count > 0)
361 787a4489 KangIngu
                {
362 532d83ef humkyung
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
363
                }
364
                else
365 8129f2a5 ljiyeon
                {                    
366 f65e6c02 taeseongkim
                    foreach (var item in mainMenu.gridViewMarkup.SelectedItems)
367 787a4489 KangIngu
                    {
368 532d83ef humkyung
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
369
                        {
370 646a4bb9 humkyung
                            #region 저장 서비스 호출(저장 완료시까지 대기)
371
                            await this.ExecuteSaveCommandAsync(mainMenu);
372
                            #endregion
373 eeb0a39c taeseongkim
374 053f2163 humkyung
                            var info = ViewerDataModel.Instance._markupInfoList.FirstOrDefault(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID);
375
                            if(info != null) info.UpdateTime = DateTime.Now;
376 cb5c7f06 humkyung
                            if (!ViewerDataModel.Instance.IsConsolidate && (sender != null))
377 532d83ef humkyung
                            {
378 c5519c44 taeseongkim
                                this.ParentOfType<MainWindow>().DialogMessage_Alert("Save is complete.", "Info");
379 532d83ef humkyung
                            }
380 b42dd24d taeseongkim
381
                            result = true;
382 316d0f5c KangIngu
                        }
383 787a4489 KangIngu
                    }
384 532d83ef humkyung
                }
385 cb5c7f06 humkyung
386 24c5e56c taeseongkim
                mainMenu.SetCommentPages(null);
387 f65e6c02 taeseongkim
388 cb5c7f06 humkyung
                ViewerDataModel.Instance.UndoDataList.Clear();
389 787a4489 KangIngu
            }
390 cb5c7f06 humkyung
            catch (Exception ex)
391 399976da ljiyeon
            {
392 0585d5cc taeseongkim
                System.Diagnostics.Debug.WriteLine("_SaveEvent Error : " + ex.ToString());
393 399976da ljiyeon
            }
394 532d83ef humkyung
            finally
395 316d0f5c KangIngu
            {
396 8129f2a5 ljiyeon
                /*
397 d62c0439 humkyung
                /// delete markup information when 코멘트가 없을 경우
398
                if (ViewerDataModel.Instance.MyMarkupList.Count == 0)
399
                {
400
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
401
                    {
402
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
403
                        {
404 8129f2a5 ljiyeon
                            //this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
405 d62c0439 humkyung
                        }
406
                    }
407
                }
408 8129f2a5 ljiyeon
                */
409 316d0f5c KangIngu
            }
410 b42dd24d taeseongkim
411
            return result;
412 787a4489 KangIngu
        }
413 43e1d368 taeseongkim
414 77cdac33 taeseongkim
        public async Task<bool>  SaveEventAsync()
415
        {
416
            bool result = false;
417
418
            var mainMenu = this.ParentOfType<MainWindow>().dzMainMenu;
419
            try
420
            {
421
                mainMenu.ConvertInkControlToPolygon();
422
423
                // update mylist and gridview
424
                mainMenu.UpdateMyMarkupList();
425
426
                if (mainMenu.gridViewMarkup.SelectedItems.Count == 0 && mainMenu.gridViewMarkup.Items.Count > 0)
427
                {
428
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
429
                }
430
                else
431
                {
432
                    foreach (var item in mainMenu.gridViewMarkup.SelectedItems)
433
                    {
434
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
435
                        {
436
                            /// 저장 서비스 호출
437 43e1d368 taeseongkim
                            result = await this.ExecuteSaveCommandAsync(mainMenu);
438 77cdac33 taeseongkim
                            ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now;
439
                        }
440
                    }
441
                }
442
443
                mainMenu.SetCommentPages(null);
444
445
                ViewerDataModel.Instance.UndoDataList.Clear();
446
                result = true;
447
            }
448
            catch (Exception ex)
449
            {
450
                System.Diagnostics.Debug.WriteLine("_SaveEvent Error : " + ex.ToString());
451
            }
452
            finally
453
            {
454
                /*
455
                /// delete markup information when 코멘트가 없을 경우
456
                if (ViewerDataModel.Instance.MyMarkupList.Count == 0)
457
                {
458
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
459
                    {
460
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
461
                        {
462
                            //this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
463
                        }
464
                    }
465
                }
466
                */
467
            }
468
469
            return result;
470
        }
471 787a4489 KangIngu
472 d62c0439 humkyung
        /// <summary>
473 b2d0f316 humkyung
        /// 마크업 데이터를 저장한다.
474 d62c0439 humkyung
        /// </summary>
475
        /// <param name="menu"></param>
476 b2d0f316 humkyung
        /// <returns></returns>
477 43e1d368 taeseongkim
        public async Task<bool> ExecuteSaveCommandAsync(MainMenu menu)
478 b42dd24d taeseongkim
        {
479
            bool result = false;
480
481
            if (menu.pageNavigator.CurrentPage != null)
482
            {
483
                SaveCommand.Instance.Project_No = App.ViewInfo.ProjectNO;
484
                SaveCommand.Instance.document_id = App.ViewInfo.DocumentItemID;
485
                SaveCommand.Instance.user_id = App.ViewInfo.UserID;
486
                SaveCommand.Instance.page_no = menu.pageNavigator.CurrentPage.PageNumber;
487
488
                try
489
                {
490 5ba8f2d5 taeseongkim
                    if (ViewerDataModel.Instance.UndoDataList.Count > 0 || ViewerDataModel.Instance.IsMarkupUpdate)
491 b42dd24d taeseongkim
                    {
492
                        List<IKCOM.MarkupInfoItem> SelectedMarkupInfos = new List<IKCOM.MarkupInfoItem>();
493
                        foreach (var item in menu.gridViewMarkup.SelectedItems)
494
                        {
495
                            if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
496
                            {
497
                                SelectedMarkupInfos.Add(item as IKCOM.MarkupInfoItem);
498
                            }
499
                        }
500
501
                        result = await SaveCommand.Instance.Execute(SelectedMarkupInfos);
502 5ba8f2d5 taeseongkim
                        ViewerDataModel.Instance.IsMarkupUpdate = false;
503 b42dd24d taeseongkim
                    }
504
                    else
505
                    {
506
                        result = true;
507
                    }
508
509
                    if (ViewerDataModel.Instance.RotationDocs.Count > 0)
510
                    {
511
                        SaveCommand.Instance.PageAngleSave(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.RotationDocs);
512
                    }
513
                }
514
                catch (Exception ex)
515
                {
516
                    this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(string.Format("세이브 실패:{0}", ex.Message), "Alert");
517 b2d0f316 humkyung
                    throw new InvalidOperationException(ex.Message);
518 43e1d368 taeseongkim
                }
519
            }
520
            else
521
            {
522
                System.Diagnostics.Debug.WriteLine("ExecuteSaveCommand Error - pageNavigator.CurrentPage null");
523
            }
524
525
            return result;
526
        }
527
528 787a4489 KangIngu
        //강인구 추가
529
        public void Print_Start(string Type)
530
        {
531 4c8bb207 djkim
            if (ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
532 787a4489 KangIngu
            {
533
                var menu = this.ParentOfType<MainWindow>().dzMainMenu;
534 077896be humkyung
                SelectionSet.Instance.UnSelect(menu);
535 787a4489 KangIngu
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
536
                {
537 cb5c7f06 humkyung
                    this.SaveEventCallback(null, null);
538 787a4489 KangIngu
                }
539
                else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
540
                {
541
542
                }
543
                else
544
                {
545 cb5c7f06 humkyung
                    this.SaveEventCallback(null, null);
546 787a4489 KangIngu
                }
547
            }
548
549
            bool isprint = false;
550
            if (Type == "Print")
551
            {
552
                isprint = true;
553
            }
554
555
            RadWindow PrintWindow = new RadWindow();
556
            PrintWindow.Width = 850;
557
            PrintWindow.Height = 600;
558
            PrintWindow.Header = Type;
559
560
            List<IKCOM.MarkupInfoItem> markupinfo = new List<IKCOM.MarkupInfoItem>();
561 0f065e57 ljiyeon
562 6c781c0c djkim
            markupinfo = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetPrintDocItemList(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID, ViewerDataModel.Instance._markupInfoList.ToList());
563
564 285635d3 taeseongkim
            if (markupinfo?.Count() > 0)
565 0f065e57 ljiyeon
            {
566 664ea2e1 taeseongkim
                //Logger.sendResLog("GetPrintDocItemList", "TRUE", 1);
567 0f065e57 ljiyeon
            }
568
            else
569
            {
570 664ea2e1 taeseongkim
                //Logger.sendResLog("GetPrintDocItemList", "FALSE", 1);
571 0f065e57 ljiyeon
            }
572
573 6dcbe4a7 humkyung
            /// Tile Source URL을 구한다
574 c3bb196c taeseongkim
575 6dcbe4a7 humkyung
            string sImageURL = ViewerDataModel.Instance.SystemMain.dzMainMenu.GetImageURL(App.ViewInfo.DocumentItemID, this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber);
576
            var url = new Uri(sImageURL);
577 71f5a3be humkyung
            string sFolder = App.ViewInfo.DocumentItemID.All(char.IsDigit) ? (Convert.ToInt64(App.ViewInfo.DocumentItemID) / 100).ToString() : App.ViewInfo.DocumentItemID.Substring(0, 5);
578 6dcbe4a7 humkyung
            var Tile_Url = string.Format(@"{0}://{1}:{2}/TileSource/{3}_Tile/{4}/{5}/",
579
                url.Scheme, url.Host, url.Port,
580 6c781c0c djkim
                App.ViewInfo.ProjectNO,
581 71f5a3be humkyung
                sFolder,
582 6c781c0c djkim
                App.ViewInfo.DocumentItemID
583
                );
584 6dcbe4a7 humkyung
            /// up to here
585 6c781c0c djkim
586 00143658 taeseongkim
            var docitem = this.ParentOfType<MainWindow>().dzMainMenu._DocItem;
587
588 6c781c0c djkim
            PrintWindow.Content = new KCOM.Control.PrintControl(
589
                      Tile_Url,
590
                      App.ViewInfo.ProjectNO,
591 00143658 taeseongkim
                      this.ParentOfType<MainWindow>().dzMainMenu._DocInfo,
592
                      markupinfo,
593 6c781c0c djkim
                      this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber,
594 00143658 taeseongkim
                      docitem.GROUP_NO,
595
                      docitem.DOCUMENT_NO,
596
                      docitem.ORIGINAL_FILE,
597
                      isprint);
598 787a4489 KangIngu
599
            //프린트 팝업 옵션
600
            //PrintWindow.BorderThickness = new Thickness(3);
601
            //PrintWindow.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 37, 160, 218));
602
            PrintWindow.ResizeMode = System.Windows.ResizeMode.NoResize;
603
            PrintWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
604
            PrintWindow.Background = new SolidColorBrush(Colors.Black);
605
            PrintWindow.Background.Opacity = 0.6;
606 b9b01f8e ljiyeon
            PrintWindow.Owner = Application.Current.MainWindow;
607 787a4489 KangIngu
            Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.VisualStudio2013Theme());
608
            PrintWindow.ShowDialog();
609
        }
610
611
        //강인구 추가
612
        private void PrintEvent(object sender, RoutedEventArgs e)
613
        {
614
            RadRibbonButton button = sender as RadRibbonButton;
615
            Print_Start(button.Content.ToString());
616
        }
617
618
        private List<AdornerMember> GetAdornerItem()
619
        {
620
            List<AdornerMember> AdonerList = new List<AdornerMember>();
621
622
            if (this.ParentOfType<MainWindow>() != null)
623
            {
624
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
625
                {
626
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
627
                    {
628
                        if (item.GetType().Name == "AdornerFinal")
629
                        {
630 4913851c humkyung
                            foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
631 787a4489 KangIngu
                            {
632
                                AdonerList.Add(InnerItem);
633
                            }
634
                        }
635
                    }
636
                }
637
            }
638 4913851c humkyung
639 787a4489 KangIngu
            return AdonerList;
640
        }
641
        /// <summary>
642
        /// 투명도
643
        /// </summary>
644
        /// <param name="sender"></param>
645
        /// <param name="e"></param>
646
        //강인구 추가(Undo End)
647
        private void sdOpacity_ValueChanged(object sender, RoutedEventArgs e)
648
        {
649
            List<AdornerMember> AdonerList = GetAdornerItem();
650
            if(AdonerList.Count > 0)
651
            {
652 873011c4 humkyung
                UndoDataGroup UndoData = new UndoDataGroup()
653 787a4489 KangIngu
                {
654
                    IsUndo = false,
655 873011c4 humkyung
                    Event = EventType.Operation,
656 787a4489 KangIngu
                    EventTime = DateTime.Now,
657
                    Opacity = ViewerDataModel.Instance.ControlOpacity,
658 b79d6e7f humkyung
                    MarkupDataColl = new List<UndoData>()
659 787a4489 KangIngu
                };
660 b79d6e7f humkyung
                UndoData multi_UndoData = new UndoData();
661 787a4489 KangIngu
662
                foreach (AdornerMember InnerItem in AdonerList)
663
                {
664
                    InnerItem.DrawingData.Opacity = ViewerDataModel.Instance.ControlOpacity;
665
                  
666 873011c4 humkyung
                    multi_UndoData.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
667
                    UndoData.MarkupDataColl.Add(multi_UndoData);
668 b79d6e7f humkyung
                    multi_UndoData = new UndoData();
669 787a4489 KangIngu
                }
670
671
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
672
                {
673
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
674
                });
675
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
676
            }
677
        }
678
679
        //강인구 추가(Undo End)
680
        private void cbLineSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
681
        {
682 be04d12c djkim
            if (string.IsNullOrEmpty(cbLineSize.Value.ToString()))
683
            {
684
                cbLineSize.Value = cbLineSize.Minimum;
685
            }
686 787a4489 KangIngu
            List<AdornerMember> AdonerList = GetAdornerItem();
687
            if (AdonerList.Count > 0)
688
            {
689 873011c4 humkyung
                UndoDataGroup UndoData = new UndoDataGroup()
690 787a4489 KangIngu
                {
691
                    IsUndo = false,
692 873011c4 humkyung
                    Event = EventType.Operation,
693 787a4489 KangIngu
                    EventTime = DateTime.Now,
694
                    LineSize = ViewerDataModel.Instance.LineSize,
695 b79d6e7f humkyung
                    MarkupDataColl = new List<UndoData>()
696 787a4489 KangIngu
                };
697 b79d6e7f humkyung
                UndoData multi_UndoData = new UndoData();
698 787a4489 KangIngu
699
                foreach (AdornerMember InnerItem in AdonerList)
700
                {
701
                    switch (InnerItem.DrawingData.GetType().Name)
702
                    {
703
                        case ("LineControl"):
704
                            {
705
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).LineSize = ViewerDataModel.Instance.LineSize;
706
                            }
707
                            break;
708
                        case ("ArcControl"):
709
                            {
710
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).LineSize = ViewerDataModel.Instance.LineSize;
711
                            }
712
                            break;
713 40b3ce25 ljiyeon
                        case ("ArrowArcControl"):
714
                            {
715
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).LineSize = ViewerDataModel.Instance.LineSize;
716
                            }
717
                            break;
718 787a4489 KangIngu
                        case ("ArrowControl_Multi"):
719
                            {
720
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).LineSize = ViewerDataModel.Instance.LineSize;
721
                            }
722
                            break;
723
                        case ("CloudControl"):
724
                            {
725
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).LineSize = ViewerDataModel.Instance.LineSize;
726
                            }
727
                            break;
728
                        case ("PolygonControl"):
729
                            {
730
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).LineSize = ViewerDataModel.Instance.LineSize;
731
                            }
732
                            break;
733
                        case ("RectangleControl"):
734
                            {
735
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).LineSize = ViewerDataModel.Instance.LineSize;
736
                            }
737
                            break;
738
                        case ("RectCloudControl"):
739
                            {
740
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).LineSize = ViewerDataModel.Instance.LineSize;
741
                            }
742
                            break;
743
                        case ("TriControl"):
744
                            {
745
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).LineSize = ViewerDataModel.Instance.LineSize;
746
                            }
747
                            break;
748
                        case ("CircleControl"):
749
                            {
750
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).LineSize = ViewerDataModel.Instance.LineSize;
751
                            }
752
                            break;
753 f8769f8a ljiyeon
                        case ("ArrowTextControl"):
754
                            {
755
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).LineSize = ViewerDataModel.Instance.LineSize;
756
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).BorderSize = new Thickness(ViewerDataModel.Instance.LineSize);
757
                            }
758
                            break;
759
                        case ("TextControl"):
760
                            {
761
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).LineSize = new Thickness(ViewerDataModel.Instance.LineSize);
762
                            }
763
                            break;
764 684ef11c ljiyeon
                        case ("InsideWhiteControl"):
765
                            {
766
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).LineSize = ViewerDataModel.Instance.LineSize;
767
                            }
768
                            break;
769
                        case ("OverlapWhiteControl"):
770
                            {
771
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).LineSize = ViewerDataModel.Instance.LineSize;
772
                            }
773
                            break;
774
                        case ("ClipWhiteControl"):
775
                            {
776
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).LineSize = ViewerDataModel.Instance.LineSize;
777
                            }
778
                            break;
779
                        case ("CoordinateControl"):
780
                            {
781
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).LineSize = 10; //ViewerDataModel.Instance.LineSize
782
                            }
783
                            break;
784 787a4489 KangIngu
                    }
785
                    
786
787 873011c4 humkyung
                    multi_UndoData.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
788
                    UndoData.MarkupDataColl.Add(multi_UndoData);
789 b79d6e7f humkyung
                    multi_UndoData = new UndoData();
790 787a4489 KangIngu
                }
791
792
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
793
                {
794
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
795
                });
796
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
797 5822e146 ljiyeon
798
                
799 787a4489 KangIngu
            }
800 5822e146 ljiyeon
            KCOM.Properties.Settings.Default.LineSize = (double)cbLineSize.Value;
801
            Properties.Settings.Default.Save();
802 787a4489 KangIngu
        }
803
804 5ce56a3a KangIngu
805
        private void cbIntervalSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
806
        {
807 be04d12c djkim
            if (string.IsNullOrEmpty(cbIntervalSize.Value.ToString()))
808
            {
809
                cbIntervalSize.Value = cbIntervalSize.Minimum;
810
            }
811 5ce56a3a KangIngu
            List<AdornerMember> AdonerList = GetAdornerItem();
812
            if (AdonerList.Count > 0)
813
            {
814
815 873011c4 humkyung
                UndoDataGroup UndoData = new UndoDataGroup()
816 5ce56a3a KangIngu
                {
817
                    IsUndo = false,
818 873011c4 humkyung
                    Event = EventType.Operation,
819 5ce56a3a KangIngu
                    EventTime = DateTime.Now,
820
                    Interval = ViewerDataModel.Instance.Interval,
821 b79d6e7f humkyung
                    MarkupDataColl = new List<UndoData>()
822 5ce56a3a KangIngu
                };
823 b79d6e7f humkyung
                UndoData multi_UndoData = new UndoData();
824 5ce56a3a KangIngu
825
                foreach (AdornerMember InnerItem in AdonerList)
826
                {
827
                    switch (InnerItem.DrawingData.GetType().Name)
828
                    {
829
                        case ("LineControl"):
830
                            {
831
                                (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).Interval = ViewerDataModel.Instance.Interval;
832
833 873011c4 humkyung
                                multi_UndoData.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
834
                                UndoData.MarkupDataColl.Add(multi_UndoData);
835 b79d6e7f humkyung
                                multi_UndoData = new UndoData();
836 5ce56a3a KangIngu
                            }
837
                            break;
838
                    }
839
                }
840
841
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
842
                {
843
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
844
                });
845
                ViewerDataModel.Instance.UndoDataList.Add(UndoData);
846
            }
847 5822e146 ljiyeon
            KCOM.Properties.Settings.Default.Interval = (double)cbIntervalSize.Value;
848
            Properties.Settings.Default.Save();
849 5ce56a3a KangIngu
        }
850 537f4cd8 djkim
        
851 b79d6e7f humkyung
        /// <summary>
852
        /// ArcLength가 수정되었을때
853
        /// </summary>
854
        /// <param name="sender"></param>
855
        /// <param name="e"></param>
856 9f473fb7 KangIngu
        private void cbArcLength_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
857
        {
858 be04d12c djkim
            if (string.IsNullOrEmpty(cbArcLength.Value.ToString()))
859
            {
860
                cbArcLength.Value = cbArcLength.Minimum;
861
            }
862 b79d6e7f humkyung
863 9f473fb7 KangIngu
            List<AdornerMember> AdonerList = GetAdornerItem();
864
            if (AdonerList.Count > 0)
865
            {
866 b79d6e7f humkyung
                var comments = (from drawing in AdonerList
867
                                select drawing.DrawingData as CommentUserInfo)
868
                                .Where(x => x is RectCloudControl || x is CloudControl ||
869
                                x is MarkupToPDF.Controls.Text.TextControl || x is MarkupToPDF.Controls.Text.ArrowTextControl)
870
                                .ToList();
871 34ac8db7 humkyung
                UndoCommand.Instance.Push(EventType.Operation, comments);
872 9f473fb7 KangIngu
873
                foreach (AdornerMember InnerItem in AdonerList)
874
                {
875
                    switch (InnerItem.DrawingData.GetType().Name)
876
                    {
877
                        case ("RectCloudControl"):
878
                            {
879 b79d6e7f humkyung
                                var item = InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl;
880
                                item.ArcLength = ViewerDataModel.Instance.ArcLength;
881 9f473fb7 KangIngu
                            }
882 b79d6e7f humkyung
                        break;
883 9f473fb7 KangIngu
                        case ("CloudControl"):
884 b79d6e7f humkyung
                        {
885
                                var item = InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl;
886
                                item.ArcLength = ViewerDataModel.Instance.ArcLength;
887
                        }
888
                        break;
889
                        case ("TextControl"):
890
                        {
891
                                var item = InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl;
892
                                item.ArcLength = ViewerDataModel.Instance.ArcLength;
893
                        }
894
                        break;
895
                        case ("ArrowTextControl"):
896
                        {
897
                                var item = InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl;
898
                                item.ArcLength = ViewerDataModel.Instance.ArcLength;
899
                        }
900
                        break;
901 9f473fb7 KangIngu
                    }
902
                }
903
            }
904 5822e146 ljiyeon
905
            KCOM.Properties.Settings.Default.ArcLength = (double)cbArcLength.Value;
906
            Properties.Settings.Default.Save();
907 9f473fb7 KangIngu
        }
908
909 787a4489 KangIngu
        //강인구 추가(Undo End)
910
        private void cbDashStyle_SelectionChanged(object sender, SelectionChangedEventArgs e)
911
        {
912
            //강인구 추가
913
            if (this.ParentOfType<MainWindow>() != null)
914
            {
915
                ViewerDataModel.Instance.DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
916
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
917
                {
918 873011c4 humkyung
                    UndoDataGroup UndoData = new UndoDataGroup()
919 787a4489 KangIngu
                    {
920
                        IsUndo = false,
921 873011c4 humkyung
                        Event = EventType.Operation,
922 787a4489 KangIngu
                        EventTime = DateTime.Now,
923
                        DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData,
924 b79d6e7f humkyung
                        MarkupDataColl = new List<UndoData>()
925 787a4489 KangIngu
                    };
926 b79d6e7f humkyung
                    UndoData multi_UndoData = new UndoData();
927 787a4489 KangIngu
928
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
929
                    {
930
                        if (item.GetType().Name == "AdornerFinal")
931
                        {
932 4913851c humkyung
                            foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
933 787a4489 KangIngu
                            {
934
                                switch (InnerItem.DrawingData.GetType().Name)
935
                                {
936
                                    case ("LineControl"):
937
                                        {
938
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
939
                                        }
940
                                        break;
941
                                    case ("ArcControl"):
942
                                        {
943
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
944
                                        }
945
                                        break;
946 40b3ce25 ljiyeon
                                    case ("ArrowArcControl"):
947
                                        {
948
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
949
                                        }
950
                                        break;
951 787a4489 KangIngu
                                    case ("ArrowControl_Multi"):
952
                                        {
953
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
954
                                        }
955
                                        break;
956
                                    case ("CloudControl"):
957
                                        {
958
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
959
                                        }
960
                                        break;
961
                                    case ("PolygonControl"):
962
                                        {
963
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
964
                                        }
965
                                        break;
966
                                    case ("RectangleControl"):
967
                                        {
968
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
969
                                        }
970
                                        break;
971
                                    case ("RectCloudControl"):
972
                                        {
973
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
974
                                        }
975
                                        break;
976
                                    case ("TriControl"):
977
                                        {
978
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
979
                                        }
980
                                        break;
981
                                    case ("CircleControl"):
982
                                        {
983
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
984
                                        }
985 684ef11c ljiyeon
                                        break;
986
                                    case ("InsideWhiteControl"):
987
                                        {
988
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
989
                                        }
990
                                        break;
991
                                    case ("OverlapWhiteControl"):
992
                                        {
993
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
994
                                        }
995
                                        break;
996
                                    case ("ClipWhiteControl"):
997
                                        {
998
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
999
                                        }
1000
                                        break;
1001
                                    case ("CoordinateControl"):
1002
                                        {
1003
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData;
1004
                                        }
1005
                                        break;
1006 787a4489 KangIngu
                                }
1007
1008 873011c4 humkyung
                                multi_UndoData.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo;
1009
                                UndoData.MarkupDataColl.Add(multi_UndoData);
1010 b79d6e7f humkyung
                                multi_UndoData = new UndoData();
1011 787a4489 KangIngu
                            }
1012
1013
                            ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
1014
                            {
1015
                                ViewerDataModel.Instance.UndoDataList.Remove(i);
1016
                            });
1017
                            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
1018
                        }
1019
                    }
1020
                }
1021
            }
1022
        }
1023
1024
        //강인구 추가
1025
        private void comboFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
1026
        {
1027 d4b0c723 KangIngu
            //if (this.ParentOfType<MainWindow>() != null)
1028
            //{
1029
            //    if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1030
            //    {
1031
            //        foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1032
            //        {
1033
            //            if (item.GetType().Name == "AdornerFinal")
1034
            //            {
1035
            //                foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
1036
            //                {
1037
            //                    switch (InnerItem.DrawingData.GetType().Name)
1038
            //                    {
1039
            //                        case ("TextControl"):
1040
            //                            {
1041
            //                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Text);
1042
            //                            }
1043
            //                            break;
1044
            //                        case ("ArrowTextControl"):
1045
            //                            {
1046
            //                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Text);
1047
            //                            }
1048
            //                            break;
1049
            //                    }
1050
            //                }
1051
            //            }
1052
            //        }
1053
            //    }
1054
            //}
1055 787a4489 KangIngu
        }
1056
1057
        //강인구 추가
1058
        private void btnBold_Checked(object sender, RoutedEventArgs e)
1059
        {
1060
            if (this.ParentOfType<MainWindow>() != null)
1061
            {
1062
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1063
                {
1064
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1065
                    {
1066
                        if (item.GetType().Name == "AdornerFinal")
1067
                        {
1068 4913851c humkyung
                            foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
1069 787a4489 KangIngu
                            {
1070
                                switch (InnerItem.DrawingData.GetType().Name)
1071
                                {
1072
                                    case ("TextControl"):
1073
                                        {
1074 d4b0c723 KangIngu
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight == FontWeights.Bold)
1075 787a4489 KangIngu
                                            {
1076
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Normal;
1077 5ba8f2d5 taeseongkim
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1078 787a4489 KangIngu
                                            }
1079
                                            else
1080
                                            {
1081 d4b0c723 KangIngu
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Bold;
1082 5ba8f2d5 taeseongkim
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1083 787a4489 KangIngu
                                            }
1084
1085
                                        }
1086
                                        break;
1087
                                    case ("ArrowTextControl"):
1088
                                        {
1089 d4b0c723 KangIngu
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight == FontWeights.Bold)
1090 787a4489 KangIngu
                                            {
1091
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Normal;
1092 5ba8f2d5 taeseongkim
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1093 787a4489 KangIngu
                                            }
1094
                                            else
1095
                                            {
1096 d4b0c723 KangIngu
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Bold;
1097 5ba8f2d5 taeseongkim
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1098 787a4489 KangIngu
                                            }
1099
                                        }
1100
                                        break;
1101
                                }
1102
                            }
1103
                        }
1104
                    }
1105
                }
1106
            }
1107
        }
1108
1109
        //강인구 추가
1110
        private void btnItalic_Checked(object sender, RoutedEventArgs e)
1111
        {
1112
            if (this.ParentOfType<MainWindow>() != null)
1113
            {
1114
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1115
                {
1116
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1117
                    {
1118
                        if (item.GetType().Name == "AdornerFinal")
1119
                        {
1120 4913851c humkyung
                            foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
1121 787a4489 KangIngu
                            {
1122
                                switch (InnerItem.DrawingData.GetType().Name)
1123
                                {
1124
                                    case ("TextControl"):
1125
                                        {
1126
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle == FontStyles.Italic)
1127
                                            {
1128
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = System.Windows.FontStyles.Normal;
1129 5ba8f2d5 taeseongkim
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1130 787a4489 KangIngu
                                            }
1131
                                            else
1132
                                            {
1133
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = FontStyles.Italic;
1134 5ba8f2d5 taeseongkim
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1135 787a4489 KangIngu
                                            }
1136
1137
                                        }
1138
                                        break;
1139
                                    case ("ArrowTextControl"):
1140
                                        {
1141
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle == FontStyles.Italic)
1142
                                            {
1143
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Normal;
1144 5ba8f2d5 taeseongkim
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1145 787a4489 KangIngu
                                            }
1146
                                            else
1147
                                            {
1148
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Italic;
1149 5ba8f2d5 taeseongkim
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1150 787a4489 KangIngu
                                            }
1151
                                        }
1152
                                        break;
1153
                                }
1154
                            }
1155
                        }
1156
                    }
1157
                }
1158
            }
1159
        }
1160
1161
        //강인구 추가
1162
        private void btnUnderLine_Checked(object sender, RoutedEventArgs e)
1163
        {
1164
            if (this.ParentOfType<MainWindow>() != null)
1165
            {
1166
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1167
                {
1168
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1169
                    {
1170
                        if (item.GetType().Name == "AdornerFinal")
1171
                        {
1172 4913851c humkyung
                            foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
1173 787a4489 KangIngu
                            {
1174
                                switch (InnerItem.DrawingData.GetType().Name)
1175
                                {
1176
                                    case ("TextControl"):
1177
                                        {
1178
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine == TextDecorations.Underline)
1179
                                            {
1180
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = null;
1181
                                            }
1182
                                            else
1183
                                            {
1184
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline;
1185
                                            }
1186
                                        }
1187
                                        break;
1188
                                    case ("ArrowTextControl"):
1189
                                        {
1190
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline)
1191
                                            {
1192
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null;
1193
                                            }
1194
                                            else
1195
                                            {
1196
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline;
1197
                                            }
1198
                                        }
1199
                                        break;
1200
                                }
1201 5ba8f2d5 taeseongkim
1202
                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1203 787a4489 KangIngu
                            }
1204
                        }
1205
                    }
1206
                }
1207
            }
1208
        }
1209 5ce56a3a KangIngu
1210 a24b6750 swate0609
1211
        private void cbLineSize_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
1212
        {
1213
            if (e.Key == Key.Space || e.Key == Key.ImeProcessed)
1214
            {
1215
                e.Handled = true;
1216
            }
1217
1218
        }
1219
1220
        private void cbLineSize_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
1221
        {
1222
            var regex = new Regex(@"[^a-zA-Z0-9\s]");
1223
            if (regex.IsMatch(e.Text))
1224
            {
1225
                e.Handled = true;
1226
            }
1227
1228
        }
1229
1230
        private void cbArcLength_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
1231
        {
1232
            if (e.Key == Key.Space || e.Key == Key.ImeProcessed)
1233
            {
1234
                e.Handled = true;
1235
            }
1236
        }
1237
1238
        private void cbArcLength_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
1239
        {
1240
            var regex = new Regex(@"[^a-zA-Z0-9\s]");
1241
            if (regex.IsMatch(e.Text))
1242
            {
1243
                e.Handled = true;
1244
            }
1245
        }
1246
1247 9380813b swate0609
        private void comboFontSize_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
1248
        {
1249
            if (e.Key == Key.Space || e.Key == Key.ImeProcessed)
1250
            {
1251
                e.Handled = true;
1252
            }
1253
        }
1254
1255 a24b6750 swate0609
        private void cbIntervalSize_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
1256
        {
1257
            if (e.Key == Key.Space || e.Key == Key.ImeProcessed)
1258
            {
1259
                e.Handled = true;
1260
            }
1261
        }
1262
1263
        private void cbIntervalSize_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
1264
        {
1265
            var regex = new Regex(@"[^a-zA-Z0-9\s]");
1266
            if (regex.IsMatch(e.Text))
1267
            {
1268
                e.Handled = true;
1269
            }
1270
        }
1271
1272 9380813b swate0609
        private void comboFontSize_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
1273
        {
1274
            var regex = new Regex(@"[^a-zA-Z0-9\s]");
1275
            if (regex.IsMatch(e.Text))
1276
            {
1277
                e.Handled = true;
1278
            }
1279
        }
1280
1281 d4b0c723 KangIngu
        private void comboFontSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
1282
        {
1283 be04d12c djkim
            if (string.IsNullOrEmpty(comboFontSize.Value.ToString()))
1284
            {
1285
                comboFontSize.Value = comboFontSize.Minimum;
1286
            }
1287 d4b0c723 KangIngu
            if (this.ParentOfType<MainWindow>() != null)
1288
            {
1289
                if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
1290
                {
1291
                    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
1292
                    {
1293
                        if (item.GetType().Name == "AdornerFinal")
1294
                        {
1295 4913851c humkyung
                            foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
1296 d4b0c723 KangIngu
                            {
1297
                                switch (InnerItem.DrawingData.GetType().Name)
1298
                                {
1299
                                    case ("TextControl"):
1300
                                        {
1301
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Value.ToString());
1302
                                        }
1303
                                        break;
1304
                                    case ("ArrowTextControl"):
1305
                                        {
1306
                                            (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Value.ToString());
1307
                                        }
1308
                                        break;
1309
                                }
1310
                            }
1311 c5519c44 taeseongkim
1312
                            ChangeComment(item as Controls.AdornerFinal);
1313 d4b0c723 KangIngu
                        }
1314
                    }
1315
                }
1316
            }
1317 c5519c44 taeseongkim
1318 5822e146 ljiyeon
            KCOM.Properties.Settings.Default.TextSize = (double)comboFontSize.Value;
1319
            Properties.Settings.Default.Save();
1320 d4b0c723 KangIngu
        }
1321
1322 787a4489 KangIngu
        //강인구 추가
1323 4fcb686a taeseongkim
        private void comboFontFamily_SelectionChanged(object sender, SelectionChangedEventArgs e)
1324 787a4489 KangIngu
        {
1325 4fcb686a taeseongkim
            
1326
            if (comboFontFamily.SelectedItem != null && !IsSuspendChange)
1327 787a4489 KangIngu
            {
1328 4fcb686a taeseongkim
                var main = this.ParentOfType<MainWindow>()?.dzMainMenu;
1329 24c5e56c taeseongkim
                var font = comboFontFamily.SelectedItem as Markus.Fonts.MarkusFont;
1330 4fcb686a taeseongkim
                var lstTextCtrl = SelectTextControl();
1331 24c5e56c taeseongkim
1332 4fcb686a taeseongkim
                foreach (var item in lstTextCtrl)
1333 787a4489 KangIngu
                {
1334 4fcb686a taeseongkim
                    if (item is MarkupToPDF.Controls.Text.ArrowTextControl ctrl1)
1335 787a4489 KangIngu
                    {
1336 5ba8f2d5 taeseongkim
                        ViewerDataModel.Instance.IsMarkupUpdate = true;
1337 4fcb686a taeseongkim
                        ctrl1.SetFontFamily(font.FontFamily);
1338
                    }
1339
                    else if (item is MarkupToPDF.Controls.Text.TextControl ctrl2)
1340
                    {
1341 5ba8f2d5 taeseongkim
                        ViewerDataModel.Instance.IsMarkupUpdate = true;
1342 4fcb686a taeseongkim
                        ctrl2.SetFontFamily(font.FontFamily);
1343 787a4489 KangIngu
                    }
1344
                }
1345 c5519c44 taeseongkim
1346 24c5e56c taeseongkim
                KCOM.Properties.Settings.Default.FontFamily = font.FontFamily.FontName();
1347
                Properties.Settings.Default.Save();
1348
            }
1349 787a4489 KangIngu
        }
1350
1351 4fcb686a taeseongkim
        private List<UIElement> SelectTextControl()
1352
        {
1353
            List<UIElement> lstTextCtrl = new List<UIElement>();
1354
1355
            var main = this.ParentOfType<MainWindow>()?.dzMainMenu;
1356
            var font = comboFontFamily.SelectedItem as Markus.Fonts.MarkusFont;
1357
1358
1359
            if (main.SelectLayer.FindChildByType<AdornerFinal>() != null)
1360
            {
1361
                lstTextCtrl.AddRange(main.SelectLayer.FindChildByType<AdornerFinal>().Members.Where(x => x.DrawingData is MarkupToPDF.Controls.Common.ITextControl).Select(x => x.DrawingData));
1362
            }
1363
1364
            lstTextCtrl.AddRange(main.zoomAndPanCanvas.FindAllChildren(x => x is MarkupToPDF.Controls.Common.ITextControl c && (c.IsSelected || c.IsEditingMode == true)).Select(x => (UIElement)x));
1365
1366
            return lstTextCtrl;
1367
        }
1368
1369 c5519c44 taeseongkim
1370 787a4489 KangIngu
        /// <summary>
1371
        /// 텍스트 컨트롤 하일라이트 처리
1372
        /// </summary>
1373
        /// <param name="sender"></param>
1374
        /// <param name="e"></param>
1375
        private void HighlightEvent(object sender, RoutedEventArgs e)
1376
        {
1377
1378
            ViewerDataModel.Instance.checkHighShape = (sender as CheckBox).IsChecked.Value;
1379
            SetHighlightEvent();
1380
            //if ((sender as CheckBox).IsChecked.Value)
1381
            //{
1382
            //    TaskMessage("HighLight가 설정되었습니다", TaskMessageType.Normal);
1383
            //}
1384
            //else
1385
            //{
1386
            //    TaskMessage("HighLight가 해제되었습니다", TaskMessageType.Caption);
1387
            //}
1388
            //if (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl != null)
1389
            //{
1390
            //    MarkupToPDF.Controls.Text.TextControl instance = (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl);
1391
            //    instance.IsHighLight = ViewerDataModel.Instance.checkHighShape;
1392
            //    instance.SetText();
1393
            //}
1394
        }
1395
1396 3026d214 ljiyeon
        //추가페이지 이동 엔터
1397 787a4489 KangIngu
        private void tlcurrentPage_KeyDown(object sender, KeyEventArgs e)
1398
        {
1399
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1400
            if (e.Key == Key.Enter)
1401
            {
1402
                try
1403
                {
1404
                    var instanceMain = this.ParentOfType<MainWindow>();
1405 baacbc36 송근호
                    var max = instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Max(f => f.PageNumber);
1406
                    if (string.IsNullOrEmpty(tlcurrentPage.Text))
1407
                    {
1408
                        RadWindow.Alert(new DialogParameters
1409
                        {
1410
                            Owner = Application.Current.MainWindow,
1411
                            Theme = new VisualStudio2013Theme(),
1412 eeb0a39c taeseongkim
                            Header = "Info",
1413
                            Content = "Enter the correct page number.",
1414 baacbc36 송근호
                        });
1415
                    }
1416
                    else
1417
                    {
1418
                        if (Convert.ToInt32(tlcurrentPage.Text) > max || Convert.ToInt32(tlcurrentPage.Text) == 0)
1419
                        {
1420
                            RadWindow.Alert(new DialogParameters
1421
                            {
1422
                                Owner = Application.Current.MainWindow,
1423
                                Theme = new VisualStudio2013Theme(),
1424 eeb0a39c taeseongkim
                                Header = "Info",
1425
                                Content = "Enter the correct page number.",
1426 baacbc36 송근호
                            });
1427
                        }
1428
                        else
1429
                        {
1430
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text));
1431
                        }
1432
                    }
1433
                    
1434 787a4489 KangIngu
                }
1435
                catch (Exception)
1436
                {
1437
                    RadWindow.Alert(new DialogParameters
1438
                    {
1439 b9b01f8e ljiyeon
                        Owner = Application.Current.MainWindow,
1440 787a4489 KangIngu
                        Theme = new VisualStudio2013Theme(),
1441 eeb0a39c taeseongkim
                        Header = "Info",
1442
                        Content = "Enter the correct page number.",
1443 787a4489 KangIngu
                    });
1444
                }
1445
                
1446
            }
1447
        }
1448 baacbc36 송근호
        private string previousText;
1449
        private void TlcurrentPage_PreviewTextInput(object sender, TextCompositionEventArgs e)
1450
        {
1451
            System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("[^0-9]+");
1452
            e.Handled = regex.IsMatch(e.Text);
1453
        }
1454
        private void TlcurrentPage_TextChanged(object sender, TextChangedEventArgs e)
1455
        {
1456
            double num = 0;
1457
            bool success = double.TryParse(((TextBox)sender).Text, out num);
1458
            if (success & num >= 0)
1459
                previousText = ((TextBox)sender).Text;
1460
            else
1461
            {
1462
                if (string.IsNullOrEmpty(((TextBox)sender).Text))
1463
                {
1464
                    ((TextBox)sender).Text = "";
1465
                }
1466
                else
1467
                {
1468
1469
                    ((TextBox)sender).Text = previousText;
1470
                }
1471
            }
1472
        }
1473
1474 3908a575 humkyung
        /// <summary>
1475
        /// 입력한 페이지로 이동한다
1476
        /// </summary>
1477
        /// <param name="sender"></param>
1478
        /// <param name="e"></param>
1479 3026d214 ljiyeon
        private void tlcurrentPage_readonly_KeyDown(object sender, KeyEventArgs e)
1480
        {
1481
            if (e.Key == Key.Enter)
1482
            {
1483
                try
1484
                {
1485
                    var instanceMain = this.ParentOfType<MainWindow>();
1486
                    instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage_readonly.Text));
1487
                }
1488
                catch (Exception)
1489
                {
1490
                    RadWindow.Alert(new DialogParameters
1491
                    {
1492 b9b01f8e ljiyeon
                        Owner = Application.Current.MainWindow,
1493 3026d214 ljiyeon
                        Theme = new VisualStudio2013Theme(),
1494 eeb0a39c taeseongkim
                        Header = "Info",
1495
                        Content = "Enter the correct page number.",
1496 3026d214 ljiyeon
                    });
1497
                }
1498
            }
1499
        }
1500
        
1501 787a4489 KangIngu
        private void PanoramaEvent(object sender, RoutedEventArgs e)
1502
        {
1503
            PanoramaShow();
1504
        }
1505
1506
        public void PanoramaShow()
1507
        {
1508
            Panorama check = new Panorama();
1509
            double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
1510
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
1511
            //double windowWidth = this.Width;
1512
            //double windowHeight = this.Height;
1513
1514
            var PanoramaPop = new RadWindow
1515
            {
1516
                //MinWidth = 600,
1517
                //MinHeight = 400,
1518
                //Header = "My Check List",
1519
                Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1520
                Content = check,
1521
                Owner = this,
1522
                ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1523
                //ResizeMode = System.Windows.ResizeMode.NoResize,
1524
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1525
                IsTopmost = false,
1526
                //Left = (screenWidth / 2) - (windowWidth / 2),
1527
                //Top = (screenHeight / 2) - (windowHeight / 2),
1528
                //Left = (screenWidth / 2),
1529
                //Top = (screenHeight / 2),
1530
                Width = screenWidth * 0.4,
1531
                Height = screenHeight * 0.4,
1532
            };
1533
            StyleManager.SetTheme(PanoramaPop, new VisualStudio2013Theme());
1534
            //CheckPop.ShowDialog();
1535 b9b01f8e ljiyeon
            PanoramaPop.Owner = Application.Current.MainWindow;
1536 787a4489 KangIngu
            PanoramaPop.Show();
1537
        }
1538 d4b0c723 KangIngu
1539 787a4489 KangIngu
        private void CheckEvent(object sender, RoutedEventArgs e)
1540
        {
1541
            //창이 떠있을 경우 재 실행 방지
1542
            if (isClosed)
1543
            {
1544
                //토글 및 마우스 상태 초기화
1545
                var toggleList = this.Parent.ChildrenOfType<RadToggleButton>();
1546
                foreach(var togle in toggleList)
1547
                {
1548
                    togle.IsChecked = false;
1549
                }
1550
                this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1551
1552
                isClosed = false;
1553
1554
                
1555 77922798 송근호
                CheckList check = new CheckList(this.ParentOfType<MainWindow>());
1556 787a4489 KangIngu
1557
                CheckPop = new RadWindow
1558
                {
1559
                    MinWidth = 1200,
1560
                    MinHeight = 500,
1561
                    //Header = "My Check List",
1562
                    Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION,
1563
                    Content = check,
1564
                    //Owner = this,
1565
                    //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1566
                    ResizeMode = System.Windows.ResizeMode.NoResize,
1567
                    WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1568
                    IsTopmost = true,
1569
                };
1570
                StyleManager.SetTheme(CheckPop, new Office2013Theme());
1571
                CheckPop.Closed += CheckPop_Closed;
1572 29010418 ljiyeon
                
1573 787a4489 KangIngu
                //CheckPop.ShowDialog();
1574
                CheckPop.Show();
1575
            }
1576
        }
1577
1578 a197bf6f taeseongkim
        private void SignManagerEvent(object sender, RoutedEventArgs e)
1579 cf1cc862 taeseongkim
        {
1580 a197bf6f taeseongkim
            OpenSignManager();
1581
        }
1582
1583
        private void OpenSignManager()
1584
        { 
1585 cf1cc862 taeseongkim
            SignManager signManager = new SignManager();
1586
1587 74abcf6f taeseongkim
            RadWindow signManagerPop = new RadWindow
1588 cf1cc862 taeseongkim
            {
1589
                MinWidth = 1200,
1590
                MinHeight = 500,
1591
                //Header = "My Check List",
1592
                Header = "",
1593
                Content = signManager,
1594
                Owner = this,
1595
                //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
1596
                ResizeMode = System.Windows.ResizeMode.CanResize,
1597
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
1598
            };
1599 74abcf6f taeseongkim
            StyleManager.SetTheme(signManagerPop, new Office2013Theme());
1600 cf1cc862 taeseongkim
1601
            //CheckPop.ShowDialog();
1602 74abcf6f taeseongkim
            signManagerPop.ShowDialog();
1603 cf1cc862 taeseongkim
        }
1604
1605 53880c83 ljiyeon
        private void OptionPop_Closed(object sender, WindowClosedEventArgs e)
1606
        {
1607
            isClosed = true;
1608
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
1609
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1610
            ViewerDataModel.Instance.Capture_Opacity = 0;
1611
        }
1612
1613 787a4489 KangIngu
        private void CheckPop_Closed(object sender, WindowClosedEventArgs e)
1614
        {
1615
            isClosed = true;
1616
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
1617
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1618
            ViewerDataModel.Instance.Capture_Opacity = 0;
1619
        }
1620
1621 64f6713a humkyung
        /// <summary>
1622
        /// 사용자가 선택한 페이지로 이동(썸네일 동기화 시킴)
1623
        /// </summary>
1624
        /// <param name="sender"></param>
1625
        /// <param name="e"></param>
1626 787a4489 KangIngu
        private void PageGoEvent(object sender, RoutedEventArgs e)
1627
        {
1628
            RadButton button = sender as RadButton;
1629
            var instanceMain = this.ParentOfType<MainWindow>();
1630
            
1631
            //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch
1632
            try
1633
            {
1634
                switch (button.CommandParameter.ToString())
1635
                {
1636
                    case "Down":
1637
                        {
1638
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) + 1);
1639
                        }
1640
                        break;
1641
                    case "Up":
1642
                        {
1643
                            instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) - 1);
1644
                        }
1645
                        break;
1646
                }
1647
            }
1648
            catch (Exception)
1649
            {
1650
                RadWindow.Alert(new DialogParameters
1651
                {
1652 b9b01f8e ljiyeon
                    Owner = Application.Current.MainWindow,
1653 787a4489 KangIngu
                    Theme = new VisualStudio2013Theme(),
1654 eeb0a39c taeseongkim
                    Header = "Info",
1655
                    Content = "Enter the correct page number.",
1656 787a4489 KangIngu
                });
1657
            }
1658
        }
1659
1660
        private void viewEvent(object sender, RoutedEventArgs e)
1661
        {
1662 9f473fb7 KangIngu
            RadRibbonToggleButton viewButton = sender as RadRibbonToggleButton;
1663 787a4489 KangIngu
            var instanceMain = this.ParentOfType<MainWindow>();
1664
1665
            Point point = new Point(instanceMain.dzMainMenu.zoomAndPanCanvas.Width / 2, instanceMain.dzMainMenu.zoomAndPanCanvas.Height / 2);
1666
1667 9f473fb7 KangIngu
            //if ((sender as RadRibbonToggleButton) != null)
1668
            //{
1669
            //    Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString();
1670
            //    instanceToggle = (sender as RadRibbonToggleButton);
1671
            //}
1672
1673
            //instanceToggle.IsChecked = false;
1674
1675 787a4489 KangIngu
            switch (viewButton.CommandParameter.ToString())
1676
            {
1677
                case "zoomout":
1678
                    {
1679
                        //장원
1680
                        //instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(new Rect(0, 0, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualWidth, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualHeight));
1681
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale -= 0.1, point);
1682 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1683 787a4489 KangIngu
                        //Common.ViewerDataModel.Instance.zom
1684
                    }
1685
                    break;
1686
                case "zoomin":
1687
                    {
1688
                        instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale += 0.1, point);
1689 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1690 787a4489 KangIngu
                    }
1691 e755dd44 이지연
                    break;             
1692 787a4489 KangIngu
                case "fitWidth":
1693
                    {
1694
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1695 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1696 787a4489 KangIngu
                    }
1697
                    break;
1698
                case "fitHeight":
1699
                    {
1700
                        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1701 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1702 787a4489 KangIngu
                    }
1703
                    break;
1704
                case "boundzoom":
1705
                    {
1706 9f473fb7 KangIngu
1707 787a4489 KangIngu
                    }
1708
                    break;
1709
                case "Rotate_M":
1710
                    {
1711
                        drawingPannelRotate(false);
1712 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1713 787a4489 KangIngu
                    }
1714
                    break;
1715
                case "Rotate_P":
1716
                    {
1717
                        drawingPannelRotate(true);
1718 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1719 787a4489 KangIngu
                    }
1720
                    break;
1721
                case "Rotate_half":
1722
                    {
1723
                        drawingPannelRotate(true);
1724
                        drawingPannelRotate(true);
1725 9f473fb7 KangIngu
                        viewButton.IsChecked = false;
1726 787a4489 KangIngu
                    }
1727
                    break;
1728 e755dd44 이지연
                    //case "fullscreen":
1729
                    //    {
1730
                    //        instanceMain.WindowStyle = WindowStyle.None;
1731
                    //        instanceMain.WindowState = WindowState.Maximized;
1732
                    //        instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit();
1733
                    //        viewButton.IsChecked = false;
1734
                    //    }
1735
                    //    break;
1736 787a4489 KangIngu
            }
1737
        }
1738
1739 d4b0c723 KangIngu
        private void Control_Event(object sender, RoutedEventArgs e)
1740
        {
1741
1742
        }
1743
1744 787a4489 KangIngu
        #region 대기
1745
1746
        public void drawingPannelRotate(bool Flag)
1747
        {
1748
            var instanceMain = this.ParentOfType<MainWindow>();
1749
1750
            //if (rotateOffSet > 3)
1751
            //    rotateOffSet = 0;
1752
1753
            //if (rotateOffSet < 0)
1754
            //    rotateOffSet = 3;
1755
1756
            if(Flag)
1757
            {
1758
                if (instanceMain.dzMainMenu.rotate.Angle == 270)
1759
                {
1760
                    instanceMain.dzMainMenu.rotate.Angle = 0;
1761
                }
1762
                else
1763
                {
1764
                    instanceMain.dzMainMenu.rotate.Angle += 90;
1765
                }
1766
            }
1767
            else
1768
            {
1769
                if(instanceMain.dzMainMenu.rotate.Angle == 0)
1770
                {
1771
                    instanceMain.dzMainMenu.rotate.Angle = 270;
1772
                }
1773
                else
1774
                {
1775
                    instanceMain.dzMainMenu.rotate.Angle -= 90;
1776
                }
1777
            }
1778
            //double angle = (double)rotateValue.GetValue(rotateOffSet);
1779
            //instanceMain.dzMainMenu.rotate.Angle = angle;
1780
            var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90));
1781
1782
            if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth)
1783
            {
1784
                double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1785
                instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1786
                instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize;
1787
            }
1788
            if (instanceMain.dzMainMenu.rotate.Angle == 0)
1789
            {
1790
                instanceMain.dzMainMenu.translate.X = 0;
1791
                instanceMain.dzMainMenu.translate.Y = 0;
1792
            }
1793
            else if (instanceMain.dzMainMenu.rotate.Angle == 90)
1794
            {
1795
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1796
                instanceMain.dzMainMenu.translate.Y = 0;
1797
            }
1798
            else if (instanceMain.dzMainMenu.rotate.Angle == 180)
1799
            {
1800
                instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1801
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1802
            }
1803
            else
1804
            {
1805
                instanceMain.dzMainMenu.translate.X = 0;
1806
                instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1807
            }
1808
1809
            //instanceMain.dzMainMenu.zoomAndPanControl.RenderTransformOrigin = new Point(0.5, 0.5);
1810
            instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle;
1811
            //대기(강인구)
1812
            //instanceMain.dzMainMenu.imageViewer.RotateAngle = instanceMain.dzMainMenu.rotate.Angle;
1813
1814
1815
            //instanceMain.dzMainMenu.imageViewer.RenderTransformOrigin = new Point(0.5, 0.5);
1816
            //RotateTransform rotateTransform = new RotateTransform(instanceMain.dzMainMenu.rotate.Angle);
1817
            //instanceMain.dzMainMenu.imageViewer.RenderTransform = rotateTransform;
1818
1819
1820
            ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
1821
            ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1822
            ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X;
1823
            ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y;
1824 4f017ed3 taeseongkim
            ViewerDataModel.Instance.PageAngle = instanceMain.dzMainMenu.rotate.Angle;
1825 787a4489 KangIngu
            //ViewerDataModel.Instance.Document_Info.Clear();
1826
            //ViewerDataModel.Instance.Document_Info.Where(i => i.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(value =>
1827
            //{
1828
            //    value.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1829
            //});
1830
1831
1832
            //이미지 각도 변경 시 실시간 Thumbnail 각도 변경(강인구 추가)
1833 6c687be8 taeseongkim
            var thumbnaillist = instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Where(info => info.PageNumber == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber);
1834
1835
            foreach (var data in thumbnaillist)
1836 787a4489 KangIngu
            {
1837
                data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1838
1839 6c687be8 taeseongkim
                //instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems;
1840 787a4489 KangIngu
                var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault();
1841
                instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
1842
1843 3908a575 humkyung
                instanceMain.dzMainMenu.pageNavigator.GotoPage(data.PageNumber);
1844 2b19f5f2 djkim
1845
                //rotation page add or update
1846
                var rotationdoc = ViewerDataModel.Instance.RotationDocs.Where(d => d.ID == instance.ID).FirstOrDefault();
1847
                if (rotationdoc != null)
1848
                {
1849
                    rotationdoc.PAGE_ANGLE = instance.PAGE_ANGLE;
1850
                }
1851
                else
1852
                {
1853
                    ViewerDataModel.Instance.RotationDocs.Add(instance);
1854
                }
1855 6c687be8 taeseongkim
            }
1856 787a4489 KangIngu
        }
1857
        #endregion
1858
1859 83d916a3 ljiyeon
        private void ImageConverter(RadToggleButton instanceToggle)
1860 787a4489 KangIngu
        {
1861 83d916a3 ljiyeon
            try
1862
            {           
1863
                var instanceMain = this.ParentOfType<MainWindow>();
1864
1865
                Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
1866
                dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png";
1867
                Nullable<bool> result = dlg.ShowDialog();
1868
                if (result == true)
1869
                {
1870
                    instanceMain.dzMainMenu.filename = dlg.FileName;
1871
                    instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1872 787a4489 KangIngu
1873 83d916a3 ljiyeon
                    System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename);
1874
                    String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename);
1875
                    long numByte = fileInfo.Length;
1876
                    double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
1877 76dc223b taeseongkim
                    kr.co.devdoftech.cloud.FileUpload fileUploader = App.FileUploader;
1878
             
1879 83d916a3 ljiyeon
                    if (dLen < 4)
1880
                    {
1881
                        System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
1882
                        System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
1883
                        byte[] data = br.ReadBytes((int)numByte);
1884
                        br.Close();
1885
1886
                        string filepath = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data);
1887 c73426a9 ljiyeon
1888
                        Check_Uri.UriCheck(filepath);
1889
1890 83d916a3 ljiyeon
                        instanceMain.dzMainMenu.filename = filepath;
1891 787a4489 KangIngu
1892 83d916a3 ljiyeon
                        fStream.Close();
1893
                        fStream.Dispose();
1894
                    }
1895
                    else
1896
                    {
1897
                        this.ParentOfType<MainWindow>().DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert");
1898
                    }
1899 787a4489 KangIngu
                }
1900 08af623d ljiyeon
                else
1901
                {
1902
                    instanceToggle.IsChecked = false;
1903
                    Common.ViewerDataModel.Instance.SelectedControl = "";
1904
                    Common.ViewerDataModel.Instance.ControlTag = null;
1905
                    this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1906
                    this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1907 4c1692a1 ljiyeon
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("No Image selected.", "Alert");
1908 08af623d ljiyeon
                }
1909 787a4489 KangIngu
            }
1910 83d916a3 ljiyeon
            catch(Exception ex)
1911
            {
1912
                instanceToggle.IsChecked = false;
1913
                Common.ViewerDataModel.Instance.SelectedControl = "";
1914
                Common.ViewerDataModel.Instance.ControlTag = null;
1915
                this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1916
                this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1917 76dc223b taeseongkim
                App.FileLogger.Error("Image Converter ",ex);
1918
1919 ab7fe8c0 humkyung
                this.ParentOfType<MainWindow>().DialogMessage_Alert(ex.Message, "Alert");
1920 83d916a3 ljiyeon
            }
1921 787a4489 KangIngu
        }
1922
1923 d4b0c723 KangIngu
        private void Control_Init(RadToggleButton instanceToggle, object sender)
1924
        {
1925
1926
        }
1927
1928 787a4489 KangIngu
        private void ControlEvent(object sender, RoutedEventArgs e)
1929
        {
1930
            RadToggleButton instanceToggle = sender as RadToggleButton;
1931
            var instanceMain = this.ParentOfType<MainWindow>();
1932
1933
            #region Ctrl + A 눌렀을 때 대처 방법 
1934
            //원인 : Ctrl + A를 누르면 UIElementSet에 등록을 시키지 않는다(이유는 한꺼번에 많은 양의 컨트롤의 동작이 유입되기 때문에
1935
            //       시스템의 성능저하를 불러올 수 있기 때문이다. 그래서 선택 후 다른 컨트롤을 누르면 등록되지 않은 컨트롤이기 때문에 삭제된다
1936
            //       이를 대처하는 방법으로 아래 코드를 사용한다.
1937
            if (Common.ViewerDataModel.Instance.MarkupControls.Count == 0 && Common.ViewerDataModel.Instance.MarkupControls.Count >= 1)
1938
            {
1939
                //var lstItem = instanceMain.DeepLayer._SelectLayer.ChildrenOfType<AdornerFinal>().ToList();
1940
                //foreach (var item in lstItem)
1941
                //{
1942
                //    foreach (var member in item.MemberSet)
1943
                //    {
1944
                //        if (!instanceMain.DeepLayer.UIElementSet.Contains(member.DrawingData))
1945
                //        {
1946
                //            instanceMain.DeepLayer.UIElementSet.Add(member.DrawingData);
1947
                //        }
1948
                //    }
1949
                //}
1950
            }
1951
            #endregion
1952
1953
            //if (!instanceMain.IsFreeSelectionMode)
1954
            //{
1955
            //    instanceMain.IsSwingMode = true;
1956
            //}
1957
1958 b643fcca taeseongkim
            //#region 다른 컨트롤 버튼 선택 해제
1959
            //System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.SelectedControl).Subscribe(ControlState =>
1960
            //{
1961
            //    if (ControlState == null)
1962
            //    {
1963
            //        instanceToggle.IsChecked = false;
1964
            //        HiddenControlHide();
1965
            //    }
1966
            //});
1967
            //#endregion
1968 d4b0c723 KangIngu
1969 787a4489 KangIngu
            Release_ToggleButton(sender); //-> 해당 컨트롤을 제외한 모든 컨트롤에 대해 해제 처리
1970 d4b0c723 KangIngu
1971 787a4489 KangIngu
            if (instanceToggle != null)
1972
            {
1973
                Common.ViewerDataModel.Instance.ControlTag = instanceToggle.Tag.ToString();
1974
            }
1975
            else if ((sender as RadRibbonToggleButton) != null)
1976
            {
1977
                Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString();
1978
                instanceToggle = (sender as RadRibbonToggleButton);
1979
            }
1980
            else if ((sender as RadRibbonButton) != null)
1981
            {
1982
                RadRibbonButton instanceButton = sender as RadRibbonButton;
1983
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1984
            }
1985
            else
1986
            {
1987
                RadButton instanceButton = sender as RadButton;
1988
                Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString();
1989
            }
1990
1991
1992 b643fcca taeseongkim
            //System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleVisibility).Subscribe(isSee =>
1993
            //{
1994
            //    if (instanceToggle.CommandParameter.ToString() == "ChainLine")
1995
            //    {
1996 6b6e937c taeseongkim
1997 b643fcca taeseongkim
            //    }
1998
            //    else
1999
            //    {
2000
            //        System.Diagnostics.Debug.WriteLine(" instanceMain.dzMainMenu.MainAngle.Visibility   " + isSee);
2001
2002
            //        if (instanceMain.dzMainMenu.MainAngle.Visibility != isSee)
2003
            //        {
2004
            //            instanceMain.dzMainMenu.MainAngle.Visibility = isSee;
2005
            //        }
2006
            //    }
2007
            //    //System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleValue).Subscribe(p =>
2008
            //    //{
2009
            //    //    instanceMain.dzMainMenu.MainAngle.AngleValue = p;
2010
            //    //});
2011
            //});
2012 6b6e937c taeseongkim
2013 787a4489 KangIngu
            instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
2014
2015
            instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
2016
2017
            if (instanceToggle.IsChecked != false)
2018
            {
2019 b74a9c91 taeseongkim
                string param = instanceToggle.CommandParameter.ToString();
2020
                string MacroIndex = "";
2021
2022
                if (param.StartsWith("MACRO"))
2023
                {
2024
                    param = "MACRO";
2025
                    MacroIndex = param.Replace("MACRO;","");
2026
2027
                    //Common.ViewerDataModel.Instance.MacroItems = MacroHelper.LoadMacroItems(MacroIndex);
2028
                    //var items = MacroHelper.TopMenuItems();
2029
2030
                    Common.ViewerDataModel.Instance.MacroItems = new List<MacroItem>
2031
                    {
2032
                        new MacroItem
2033
                        {
2034
                            Desc = "Cloud Rectangle",
2035
                            ControlType = MarkupToPDF.Controls.Common.ControlType.RectCloud
2036
                        },
2037
                        new MacroItem
2038
                        {
2039
                             Desc = "Arrow TextBox",
2040
                            ControlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl
2041
                        }
2042
                    };
2043
                }
2044
2045 787a4489 KangIngu
                #region 컨트롤이 체크되었다면
2046 b74a9c91 taeseongkim
                switch (param)
2047 787a4489 KangIngu
                {
2048
                    #region Line
2049
                    case "Line":
2050
                        Common.ViewerDataModel.Instance.SelectedControl = "Line";
2051
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2052
                        if (instanceToggle.Tag.ToString() == "LineDelete")
2053
                        {
2054
                            //HiddenInterval.Visibility = Visibility.Visible;
2055
                        }
2056
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.SingleLine;
2057
                        break;
2058
                    #endregion
2059
                    #region ChainLine
2060
                    case "ChainLine":
2061
                        Common.ViewerDataModel.Instance.SelectedControl = "ChainLine";
2062
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2063
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ChainLine;
2064
                        break;
2065
                    #endregion
2066
                    #region DimLine
2067
                    case "DimLine":
2068
                        Common.ViewerDataModel.Instance.SelectedControl = "DimLine";
2069
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2070
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.DimLine;
2071
                        break;
2072
                    #endregion
2073
                    #region TwinLine
2074
                    case "TwinLine":
2075
                        Common.ViewerDataModel.Instance.SelectedControl = "TwinLine";
2076
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2077
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TwinLine;
2078
                        break;
2079
                    #endregion
2080
                    #region CancelLine
2081
                    case "CancelLine":
2082
                        Common.ViewerDataModel.Instance.SelectedControl = "CancelLine";
2083
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2084
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.CancelLine;
2085
                        break;
2086
                    #endregion
2087
                    #region PolygonCloud
2088
                    case "PolygonCloud":
2089
                        Common.ViewerDataModel.Instance.SelectedControl = "PolygonCloud";
2090
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2091
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonCloud;
2092
                        break;
2093
                    #endregion
2094
                    #region RectCloud
2095
                    case "RectCloud":
2096
                        Common.ViewerDataModel.Instance.SelectedControl = "RectCloud";
2097
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2098
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.RectCloud;
2099
                        break;
2100
                    #endregion
2101 4318fdeb KangIngu
                    #region Rectangle
2102 787a4489 KangIngu
                    case "Rectangle":
2103
                        Common.ViewerDataModel.Instance.SelectedControl = "Rectangle";
2104
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2105
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Rectangle;
2106
                        break;
2107
                    #endregion
2108 4318fdeb KangIngu
                    #region Triangle
2109 787a4489 KangIngu
                    case "Triangle":
2110
                        Common.ViewerDataModel.Instance.SelectedControl = "Triangle";
2111
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2112
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Triangle;
2113
                        break;
2114
                    #endregion
2115
                    #region RectCloud
2116
                    case "Circle":
2117
                        Common.ViewerDataModel.Instance.SelectedControl = "Circle";
2118
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2119
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Circle;
2120
                        break;
2121
                    #endregion
2122
                    #region Symbol
2123
                    case "Symbol":
2124
                        Common.ViewerDataModel.Instance.SelectedControl = "Symbol";
2125
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2126
                        break;
2127
                    #endregion
2128
                    #region SymbolN
2129
                    case "SymbolN":
2130
                        Common.ViewerDataModel.Instance.SelectedControl = "SymbolN";
2131
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Stamp;
2132
                        break;
2133
                    #endregion
2134
                    #region Text
2135
                    case "Text":
2136
                        Common.ViewerDataModel.Instance.SelectedControl = "Text";
2137
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
2138
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextControl;
2139
                        break;
2140
                    #endregion
2141
                    #region TextBorder
2142
                    case "TextBorder":
2143
                        Common.ViewerDataModel.Instance.SelectedControl = "TextBorder";
2144
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
2145
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextBorder;
2146
                        break;
2147
                    #endregion
2148
                    #region TextCloud
2149
                    case "TextCloud":
2150
                        Common.ViewerDataModel.Instance.SelectedControl = "TextCloud";
2151
                        TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal);
2152
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextCloud;
2153
                        break;
2154
                    #endregion
2155
                    #region Date
2156
                    case "Date":
2157
                        Common.ViewerDataModel.Instance.SelectedControl = "Date";
2158
                        TaskMessage("날짜 컨트롤을 더블 클릭하면 날짜를 변경할 수 있습니다", TaskMessageType.Normal);
2159
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Date;
2160
                        break;
2161
                    #endregion
2162
                    #region ArrowText
2163
                    case "ArrowText":
2164
                        TaskMessage("ArrowText 컨트롤은 그린 후 컨트롤을 선택하였을 시 중간점을 조정할 수 있습니다", TaskMessageType.Normal);
2165
                        if (instanceToggle.Tag.ToString() == "ArrowText_Cloud")
2166
                        {
2167
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowText_Cloud";
2168
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl;
2169
                        }
2170
                        else if (instanceToggle.Tag.ToString() == "ArrowText_Border")
2171
                        {
2172
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTextBorderControl";
2173
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl;
2174
                        }
2175
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Normal")
2176
                        {
2177
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextControl";
2178
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl;
2179
                        }
2180
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Border")
2181
                        {
2182
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextBorderControl";
2183
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl;
2184
                        }
2185
                        else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Cloud")
2186
                        {
2187
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextCloudControl";
2188
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl;
2189
                        }
2190
                        else
2191
                        {
2192
                            Common.ViewerDataModel.Instance.SelectedControl = "ArrowText";
2193
                            instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextControl;
2194
                            //HiddenAxisLock.Visibility = Visibility.Visible;
2195
                        }
2196
                        break;
2197
                    #endregion
2198
                    #region Arrow
2199
                    case "Arrow":
2200
                        Common.ViewerDataModel.Instance.SelectedControl = "Arrow";
2201
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2202
                        //HiddenDimSize.Visibility = Visibility.Visible;
2203
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowLine;
2204
                        break;
2205
                    #endregion
2206
                    #region Shape
2207
                    case "Shape":
2208
                        Common.ViewerDataModel.Instance.SelectedControl = "Shape";
2209
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
2210
                        break;
2211
                    #endregion
2212
                    #region Polygon
2213
                    case "Polygon":
2214
                        Common.ViewerDataModel.Instance.SelectedControl = "Polygon";
2215
                        TaskMessage("자유형 코멘트 도구는 오른쪽 마우스 클릭을 통해 그리기를 마칠 수 있습니다", TaskMessageType.Normal);
2216
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2217
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonControl;
2218
                        break;
2219
                    #endregion
2220
                    #region Arc
2221
                    case "Arc":
2222
                        Common.ViewerDataModel.Instance.SelectedControl = "Arc";
2223
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcLine;
2224
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2225
                        TaskMessage("Arc 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal);
2226
                        break;
2227
                    #endregion
2228 40b3ce25 ljiyeon
                    #region ArrowArc
2229
                    case "ArrowArc":
2230
                        Common.ViewerDataModel.Instance.SelectedControl = "ArrowArc";
2231
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcArrow;
2232
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2233
                        TaskMessage("ArcArrow 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal);
2234
                        break;
2235
                    #endregion
2236 787a4489 KangIngu
                    #region ArrowMulti
2237
                    case "ArrowMulti":
2238
                        Common.ViewerDataModel.Instance.SelectedControl = "ArrowMulti";
2239
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowMultiLine;
2240
                        //HiddenAxisLock.Visibility = Visibility.Visible;
2241
                        break;
2242
                    #endregion
2243
                    #region Etc
2244
                    case "Etc":
2245
                        Common.ViewerDataModel.Instance.SelectedControl = "Etc";
2246
                        break;
2247
                    #endregion
2248
                    #region Ink
2249
                    case "Ink":
2250
                        if (instanceToggle.Tag.ToString() == "EraserClear")
2251
                        {
2252
                            TaskMessage("해당 컨트롤은 점 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal);
2253
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
2254
                            instanceMain.dzMainMenu.inkBoard.Tag = "EraseByPoint";
2255
                        }
2256
                        else if (instanceToggle.Tag.ToString() == "Eraser")
2257
                        {
2258
                            TaskMessage("해당 컨트롤은 선 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal);
2259
                            instanceMain.dzMainMenu.inkBoard.Tag = "EraseByStroke";
2260
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
2261
                        }
2262
                        else
2263
                        {
2264
                            instanceMain.dzMainMenu.inkBoard.Tag = "Ink";
2265
                            //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.Ink;
2266
                        }
2267
2268
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = true;
2269
2270
                        Common.ViewerDataModel.Instance.SelectedControl = "Ink";
2271
                        Common.ViewerDataModel.Instance.LineSize = (double)cbLineSize.Value;
2272
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PenControl;
2273
                        break;
2274
                    #endregion
2275
                    #region Select
2276
                    case "Select":
2277 409bb3e7 이지연
                        if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2278 65246dc9 KangIngu
                        {
2279 409bb3e7 이지연
                            if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl is MarkupToPDF.Controls.Text.TextControl
2280
                                && !string.IsNullOrEmpty(((MarkupToPDF.Controls.Text.TextControl)this.ParentOfType<MainWindow>().dzMainMenu.currentControl).Text))
2281
                            {
2282
                                DependencyObject focusScope1 = FocusManager.GetFocusScope((MarkupToPDF.Controls.Text.TextControl)this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2283
                                FocusManager.SetFocusedElement(focusScope1, (MarkupToPDF.Controls.Text.TextControl)this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2284
2285
                                this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2286
                                Keyboard.ClearFocus();
2287
2288
                            }
2289
                            else
2290
                            {
2291
                                ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2292
                                this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2293
                            }
2294 65246dc9 KangIngu
                        }
2295 409bb3e7 이지연
2296 787a4489 KangIngu
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting;
2297
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2298 9f473fb7 KangIngu
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2299 787a4489 KangIngu
                        break;
2300
                    #endregion
2301
                    #region Image
2302
                    case "Image":
2303
                        Common.ViewerDataModel.Instance.SelectedControl = "ImgControl";
2304
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
2305 83d916a3 ljiyeon
                        ImageConverter(instanceToggle);
2306 787a4489 KangIngu
                        break;
2307
                    #endregion
2308
                    #region Sign
2309
                    case "Sign":
2310
                        Common.ViewerDataModel.Instance.SelectedControl = "Sign";
2311
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
2312
                        //강인구 추가
2313
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Sign;
2314
                        //instanceMain.BaseClient.GetUserSignCompleted += (sen, ea) =>
2315
                        //{
2316
                        //    if (ea.Result == null)
2317
                        //    {
2318
2319
                        //        this.ParentOfType<MainPage>().DialogMessage_Alert("You Don't Have Sign Data", "Alert");
2320
                        //    }
2321
                        //    else
2322
                        //    {
2323
                        //        byte[] imageBytes = System.Convert.FromBase64String(ea.Result);
2324
                        //        using (MemoryStream ms = new MemoryStream(imageBytes))
2325
                        //        {
2326
                        //            BitmapImage im = new BitmapImage();
2327
                        //            im.SetSource(ms);
2328
                        //            instanceMain.DeepLayer.SignImage = im;
2329
                        //            ms.Close();
2330
                        //        }
2331
                        //    }
2332
                        //};
2333
                        //instanceMain.BaseClient.GetUserSignAsync(instanceMain._ViewInfo.UserID);
2334
                        break;
2335
                    #endregion
2336
                    #region Check
2337
                    case "Check":
2338
                        Common.ViewerDataModel.Instance.SelectedControl = "Check";
2339
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
2340
                        //강인구 추가
2341
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Symbol;
2342
                        break;
2343
                    #endregion
2344
                    #region Batch
2345
                    case "Batch":
2346
                        Common.ViewerDataModel.Instance.SelectedControl = "Batch";
2347
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
2348
                        //강인구 추가
2349
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark;
2350
                        instanceMain.dzMainMenu.txtBatch.Visibility = Visibility.Visible;
2351 999c9e40 humkyung
                        instanceMain.dzMainMenu.txtBatch.Text = "Place Mark";
2352 787a4489 KangIngu
                        break;
2353 d4b0c723 KangIngu
                    #endregion
2354 b74a9c91 taeseongkim
2355
                    #region MACRO -MACRO1
2356
                    case "MACRO":
2357
                        Common.ViewerDataModel.Instance.SelectedControl = "MACRO";
2358
                        Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번
2359
2360
                        MacroHelper.MacroAction();
2361
2362
                        break;
2363
                    #endregion
2364
2365 d4b0c723 KangIngu
                    #region Copy
2366
                    case "Copy":
2367 5b48dae7 taeseongkim
                        CopyCommand.Instance.Execute();
2368
                        //Copy_Start();
2369 d4b0c723 KangIngu
                        instanceToggle.IsChecked = false;
2370
                        ViewerDataModel.Instance.SelectedControl = "";
2371
                        ViewerDataModel.Instance.ControlTag = null;
2372
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2373
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2374
                        break;
2375
                    #endregion
2376
                    #region Cut
2377
                    case "Cut":
2378 93420e5a ljiyeon
                        //Cut_Start();
2379
                        CutCommand.Instance.Execute();
2380 d4b0c723 KangIngu
                        instanceToggle.IsChecked = false;
2381
                        ViewerDataModel.Instance.SelectedControl = "";
2382
                        ViewerDataModel.Instance.ControlTag = null;
2383
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2384
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2385
                        break;
2386
                    #endregion
2387
                    #region Paste
2388
                    case "Paste":
2389 5b48dae7 taeseongkim
                        PasteCommand.Instance.Execute();
2390
                        //Paste_Start();
2391 d4b0c723 KangIngu
                        instanceToggle.IsChecked = false;
2392
                        ViewerDataModel.Instance.SelectedControl = "";
2393
                        ViewerDataModel.Instance.ControlTag = null;
2394
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2395 ccf944bb ljiyeon
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;                        
2396 d4b0c723 KangIngu
                        break;
2397
                    #endregion
2398
                    #region Delete
2399
                    case "Delete":
2400 34ac8db7 humkyung
                        UndoCommand.Instance.Push(EventType.Delete, SelectionSet.Instance.SelectedItems);
2401 24678e06 humkyung
                        this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear();
2402
2403 d4b0c723 KangIngu
                        instanceToggle.IsChecked = false;
2404
                        ViewerDataModel.Instance.SelectedControl = "";
2405
                        ViewerDataModel.Instance.ControlTag = null;
2406
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2407
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2408
                        break;
2409
                    #endregion
2410
                    #region Undo
2411
                    case "Undo":
2412 f816dd63 humkyung
                        UndoCommand.Instance.Execute();
2413 d4b0c723 KangIngu
                        instanceToggle.IsChecked = false;
2414
                        ViewerDataModel.Instance.SelectedControl = "";
2415
                        ViewerDataModel.Instance.ControlTag = null;
2416
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2417
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2418
                        break;
2419
                    #endregion
2420
                    #region Redo
2421
                    case "Redo":
2422 f816dd63 humkyung
                        RedoCommand.Instance.Execute();
2423 d4b0c723 KangIngu
                        instanceToggle.IsChecked = false;
2424
                        ViewerDataModel.Instance.SelectedControl = "";
2425
                        ViewerDataModel.Instance.ControlTag = null;
2426
                        this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2427
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2428 9f473fb7 KangIngu
                        break;
2429
                    #endregion
2430
                    #region DragZoom
2431
                    case "DragZoom":
2432
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.DragZoom;
2433
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2434
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2435
                        break;
2436 d4b0c723 KangIngu
                    #endregion
2437 53880c83 ljiyeon
                    #region Grouping
2438
                    case "Group":
2439 c0977e97 djkim
                        //var GrouptoggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2440
                        //foreach (var togle in GrouptoggleList)
2441
                        //{
2442
                        //    togle.IsChecked = false;
2443
                        //}
2444 53880c83 ljiyeon
2445 c0977e97 djkim
                        //if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2446
                        //{
2447
                        //    ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2448
                        //    this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2449
                        //}
2450
                        //this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2451
                        //instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2452
                        //instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2453
                        //if (ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면
2454
                        //{
2455
                        //    this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Please Select Controls", "Alert");
2456
                        //}
2457
                        //else//if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2458
                        //{
2459
                        //    // string MarkupData = "";
2460
                        //    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2461
                        //    {
2462
                        //        if (item.GetType().Name == "AdornerFinal" && (item as AdornerFinal).MemberSet.Count >= 2) // 얘가 2개 이상이여야 그룹가능 버튼도 막을거긴하지만 일단..
2463
                        //        {
2464
                        //            //MARKUP_DATA_GROUP INSERT
2465
                        //            MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP
2466
                        //            {
2467
                        //                SYMBOL_ID = null,//InnerItem.Symbol_ID
2468
                        //                STATE = 0,
2469
                        //            };
2470
                        //            long group_id = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMarkupDataGroup(mARKUP_DATA_GROUP, App.ViewInfo.ProjectNO);
2471 664ea2e1 taeseongkim
                        //            //Logger.sendReqLog("AddMarkupDataGroup: ", "", 1);
2472 c0977e97 djkim
                        //            if (group_id > 0)
2473
                        //            {
2474
                        //                foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2475
                        //                {
2476
                        //                    if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2477
                        //                    {
2478
                        //                        //MARKUP_DATA UPDATE
2479
                        //                        //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, group_id, App.ViewInfo.ProjectNO);
2480 664ea2e1 taeseongkim
                        //                        ////Logger.sendReqLog("UpdateMarkupData: ", "", 1);
2481 c0977e97 djkim
                        //                        ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = group_id;
2482
                        //                        ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true;
2483
                        //                    }
2484
                        //                }
2485
                        //            }
2486
                        //        }
2487
                        //    }
2488
                        //}
2489 53880c83 ljiyeon
                        break;
2490
                    case "UnGroup":
2491 c0977e97 djkim
                        //var UnGrouptoggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2492
                        //foreach (var togle in UnGrouptoggleList)
2493
                        //{
2494
                        //    togle.IsChecked = false;
2495
                        //}
2496
                        //if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2497
                        //{
2498
                        //    ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2499
                        //    this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2500
                        //}
2501
                        //this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2502
                        //instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2503
                        //instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2504
2505
                        //if (ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면
2506
                        //{
2507
                        //    this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Please Select Controls", "Alert");
2508
                        //}
2509
                        //else//if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2510
                        //{
2511
                        //    // string MarkupData = "";
2512
                        //    foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2513
                        //    {
2514
                        //        if (item.GetType().Name == "AdornerFinal" && (item as AdornerFinal).MemberSet.Count >= 1) // 1개 이상 
2515
                        //        {
2516
                        //            //MARKUP_DATA UPDATE
2517
                        //            foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2518
                        //            {
2519
                        //                if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2520
                        //                {
2521
                        //                    long group_id = ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault().Group_ID;
2522
                        //                    //MARKUP_DATA UPDATE
2523
                        //                    //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, 0, App.ViewInfo.ProjectNO);
2524 664ea2e1 taeseongkim
                        //                    ////Logger.sendReqLog("UpdateMarkupData: ", "", 1);
2525 c0977e97 djkim
                        //                    ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = 0;
2526
                        //                    ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true;
2527
2528
2529
                        //                    //MARKUP_DATA_GROUP UPDATE
2530
                        //                    //bool value = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupDataGroup(group_id, App.ViewInfo.ProjectNO);
2531 664ea2e1 taeseongkim
                        //                    ////Logger.sendReqLog("AddMarkupDataGroup: ", value.ToString(), 1);
2532 c0977e97 djkim
                        //                }
2533
                        //            }
2534
                        //        }
2535
                        //    }
2536
                        //}
2537 53880c83 ljiyeon
                        break;
2538
                    #endregion
2539
                    #region Capture
2540
                    case "Capture":
2541
                        SyncInit();
2542
                        //   instanceToggle.IsChecked = false;
2543
                        var CaptureList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2544
                        foreach (var togle in CaptureList)
2545
                        {
2546
                            togle.IsChecked = false;
2547
                        }
2548
2549
                        if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2550
                        {
2551
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2552
                            this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2553
                        }
2554
2555
                        ViewerDataModel.Instance.SelectedControl = "ImgControl";
2556
                   //     ViewerDataModel.Instance.ControlTag = null;
2557
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
2558
2559
                        /*
2560
                        //캡쳐 하기 전에 코멘트 저장
2561
                        if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (Application.Current.MainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0)
2562
                        {
2563
                            var menu = (Application.Current.MainWindow as MainWindow).dzMainMenu;
2564
                            menu.ReleaseAdorner();
2565
                            if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
2566
                            {
2567
                                (Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu);
2568
                            }
2569
                            else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
2570
                            {
2571
2572
                            }
2573
                            else
2574
                            {
2575
                                (Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu);
2576
                            }
2577
                        }*/
2578
2579
                        //Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).ID;
2580
                        //Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Image).DataContext as Customer).ID;
2581
                        //Common.ViewerDataModel.Instance.PageNumber = ((e.Source as Image).DataContext as Customer).PAGENUMBER;
2582
                        Application.Current.MainWindow.Focus();
2583
                        Common.ViewerDataModel.Instance.Capture_Opacity = 0.49;
2584
                        (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture;
2585
                        break;
2586
                    #endregion
2587 f65e6c02 taeseongkim
                    #region Cad
2588
                    case "Inside":
2589
                        //instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
2590
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
2591
                        Common.ViewerDataModel.Instance.SelectedControl = "InsideWhite";
2592
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.InsideWhite;
2593
                        break;
2594
                    case "Overlap":
2595
                        //instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
2596
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
2597
                        Common.ViewerDataModel.Instance.SelectedControl = "OverlapWhite";
2598
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.OverlapWhite;
2599
                        break;
2600
                    case "Clip":
2601
                        //instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing;
2602
                        //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false;
2603
                        Common.ViewerDataModel.Instance.SelectedControl = "ClipWhite";
2604
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ClipWhite;
2605
                        break;
2606
                    case "CadExport":
2607
                        //if (isClosed)
2608
                        //{
2609
                        //    //토글 및 마우스 상태 초기화
2610
                        //    var toggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2611
                        //    foreach (var togle in toggleList)
2612
                        //    {
2613
                        //        togle.IsChecked = false;
2614
                        //    }
2615
                        //    this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2616
2617
                        //    isClosed = false;
2618
                        //    //Control 파일 먼저 생성
2619
                        //    CollapsedButton_Click();
2620
                        //    CadViewer check = new CadViewer();
2621
                        //    check.WindowStartupLocation = WindowStartupLocation.CenterScreen;
2622
                        //    check.Title = "Export Viewer";
2623
                        //    //check.Topmost = true;
2624
                        //    check.Show();
2625
                        //    check.Closed += Check_Closed;
2626
                        //    instanceToggle.IsChecked = false;
2627
                        //}
2628
                        //break;
2629
                    case "CadViewer":
2630
                        //if (isClosed)
2631
                        //{
2632
                        //    //토글 및 마우스 상태 초기화
2633
                        //    var toggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2634
                        //    foreach (var togle in toggleList)
2635
                        //    {
2636
                        //        togle.IsChecked = false;
2637
                        //    }
2638
                        //    this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2639
2640
                        //    isClosed = false;
2641
                        //    CadResultViewer check = new CadResultViewer();
2642
                        //    check.WindowStartupLocation = WindowStartupLocation.CenterScreen;
2643
                        //    check.Title = "Viewer";
2644
                        //    check.Show();
2645
2646
                        //    check.Closed += Check_Closed;
2647
2648
                        //}
2649
                        break;
2650
                    #endregion
2651 787a4489 KangIngu
                    default:
2652
                        break;
2653
                }
2654
                #endregion
2655
            }
2656
            else
2657
            {
2658 fc4e50f2 taeseongkim
                if (Common.ViewerDataModel.Instance.IsMacroCommand)
2659
                {
2660
                    MacroHelper.Clear();
2661
                }
2662 992a98b4 KangIngu
2663 787a4489 KangIngu
                if (!instanceMain.dzMainMenu.IsFreeSelectionMode)
2664
                {
2665
                    instanceMain.dzMainMenu.IsSwingMode = false;
2666
                    Common.ViewerDataModel.Instance.SelectedControl = "";
2667
                    Common.ViewerDataModel.Instance.ControlTag = null;
2668
                    this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2669
                    this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2670
                }
2671
            }
2672 eeb0a39c taeseongkim
2673 787a4489 KangIngu
        }
2674
2675 53880c83 ljiyeon
        private void SyncInit()
2676
        {
2677
            try
2678
            {
2679
                if (!ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden)
2680
                {
2681
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden = true;
2682
                    ViewerDataModel.Instance.PageBalanceMode = false;
2683
                    ViewerDataModel.Instance.PageBalanceNumber = 0;
2684 752b18ef taeseongkim
                    ViewerDataModel.Instance.SyncPageNumber = 0;
2685 53880c83 ljiyeon
                    ViewerDataModel.Instance.MarkupControls_Sync.Clear();
2686
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewRevMarkup.Visibility = Visibility.Collapsed;
2687
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.UserList.IsChecked = false;
2688
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.BalanceMode.IsChecked = false;
2689
                }
2690
            }
2691
            catch (Exception ex)
2692
            {
2693 664ea2e1 taeseongkim
                //Logger.sendResLog("SyncInit", ex.Message, 0);
2694 53880c83 ljiyeon
            }
2695
2696
        }
2697
2698 b79d6e7f humkyung
        UndoData multi_UndoData = new UndoData();
2699 684ef11c ljiyeon
        CommentUserInfo currentControl { get; set; }
2700
        private void Check_Closed(object sender, EventArgs e)
2701
        {
2702
            isClosed = true;
2703
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
2704
            //토글 및 마우스 상태 초기화
2705
            var toggleList = this.Parent.ChildrenOfType<RadToggleButton>();
2706
            foreach (var togle in toggleList)
2707
            {
2708
                togle.IsChecked = false;
2709
            }
2710
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2711
            ViewerDataModel.Instance.Capture_Opacity = 0;
2712
2713
        }
2714
2715
        /* public class test 
2716
         {
2717
             public double width { get; set; }
2718
             public double height { get; set; }
2719
         }
2720
         */
2721 ac4f1e13 taeseongkim
        private async void CollapsedButton_Click()
2722 684ef11c ljiyeon
        {
2723
            this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); // 저장하지 못한 데이터가 있다면 저장
2724
2725
            string[] data = new string[0];
2726
2727
            int cnt = 0;
2728
            var menu = this.ParentOfType<MainWindow>().dzMainMenu;
2729
2730
            List<MarkupInfoItem> gridSelectionItem = menu.gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
2731
2732
            foreach (var item in gridSelectionItem)
2733
            {
2734
                if ((item.UserID == App.ViewInfo.UserID) && (ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage != null))
2735
                {
2736 d62c0439 humkyung
                    var instance = ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber &&
2737 684ef11c ljiyeon
                    d.MarkupInfoID == item.MarkupInfoID).ToList();
2738
                    data = new string[instance.Count];
2739
                    foreach (var markup in instance)
2740
                    {
2741 d2050059 taeseongkim
                        data[cnt++] = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(markup.Data,ViewerDataModel.Instance.NewMarkupCancelToken());
2742 684ef11c ljiyeon
                    }
2743
                }
2744
            }
2745
2746 cf2671a6 ljiyeon
            if (data != null && KCOM.Properties.Settings.Default.cad == 1)
2747 684ef11c ljiyeon
            {
2748
                string FilePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Cad");
2749
                string FileName = FilePath + "\\commentstring.json"; // Default file name
2750
                if (!File.Exists(FilePath))
2751
                {
2752
                    Directory.CreateDirectory(FilePath);
2753
                }
2754
2755
                if (!string.IsNullOrEmpty(FileName))
2756
                {
2757
                    //  File.WriteAllText(SaveDig.FileName, data);
2758
                    File.WriteAllLines(FileName, data);
2759
                }
2760
            }
2761
        }
2762
2763
        private double minHeight;
2764
        private double minWidth;
2765
2766
        private double maxHeight;
2767
        private double maxWidth;
2768
2769
        public bool CanVResize { get; private set; }
2770
        public bool CanHResize { get; private set; }
2771
2772
        public void DesignerComponent(FrameworkElement content)
2773
        {
2774
            this.InitializeComponent();
2775
2776
            if (!double.IsNaN(content.Width))
2777
            {
2778
                CanHResize = false;
2779
                this.Width = content.Width;
2780
            }
2781
            else
2782
            {
2783
                CanHResize = true;
2784
                this.Width = 23.0;
2785
            }
2786
            if (!double.IsNaN(content.Height))
2787
            {
2788
                CanVResize = false;
2789
                this.Height = content.Height; ;
2790
            }
2791
            else
2792
            {
2793
                CanVResize = true;
2794
                this.Height = 23.0;
2795
            }
2796
2797
            minWidth = content.MinWidth < 10.0 ? 10.0 : content.MinWidth;
2798
            minHeight = content.MinHeight < 10.0 ? 10.0 : content.MinHeight;
2799
            maxWidth = content.MaxWidth;
2800
            maxHeight = content.MaxHeight;
2801
2802
            double top = (double)content.GetValue(Canvas.TopProperty);
2803
            if (double.IsNaN(top))
2804
                top = 0.0;
2805
            double left = (double)content.GetValue(Canvas.LeftProperty);
2806
            if (double.IsNaN(left))
2807
                left = 0.0;
2808
            SetValue(Canvas.TopProperty, top);
2809
            SetValue(Canvas.LeftProperty, left);
2810
2811
            //Set the actual content. Note that "Content" property is a new property. See below
2812
            this.Content = content;
2813
        }
2814
        private void Thumb_DragDelta(object sender, DragDeltaEventArgs e)
2815
        {
2816
            string name = ((Thumb)sender).Name;
2817
            if (name.Contains("Top"))
2818
            {
2819
                double newHeight = this.Height - e.VerticalChange;
2820
                if (newHeight >= minHeight && newHeight <= maxHeight)
2821
                {
2822
                    this.Height = newHeight;
2823
                    SetValue(Canvas.TopProperty,
2824
                (double)GetValue(Canvas.TopProperty) + e.VerticalChange);
2825
                }
2826
            }
2827
            if (name.Contains("Right"))
2828
            {
2829
                double newWidth = this.Width + e.HorizontalChange;
2830
                if (newWidth >= minWidth && newWidth <= maxWidth)
2831
                    this.Width = newWidth;
2832
            }
2833
            if (name.Contains("Bottom"))
2834
            {
2835
                double newHeight = this.Height + e.VerticalChange;
2836
                if (newHeight >= minHeight && newHeight <= maxHeight)
2837
                    this.Height = newHeight;
2838
            }
2839
            if (name.Contains("Left"))
2840
            {
2841
                double newWidth = this.Width - e.HorizontalChange;
2842
                if (newWidth >= minWidth && newWidth <= maxWidth)
2843
                {
2844
                    this.Width = newWidth;
2845
                    SetValue(Canvas.LeftProperty,
2846
                (double)GetValue(Canvas.LeftProperty) + e.HorizontalChange);
2847
                }
2848
            }
2849
        }
2850
2851
        private void drawControlBorder(object sender)
2852
        {
2853
            System.Windows.Controls.Control control = (System.Windows.Controls.Control)sender;
2854
        }
2855
2856
        private void ResizeThumb_DragDelta(object sender, MouseButtonEventArgs e)
2857
        {
2858
            System.Windows.Controls.Control designerItem = (System.Windows.Controls.Control)sender;
2859
            if (designerItem != null)
2860
            {
2861
                double deltaVertical, deltaHorizontal;
2862
2863
                switch (VerticalAlignment)
2864
                {
2865
                    case VerticalAlignment.Bottom:
2866
                        deltaVertical = designerItem.ActualHeight - designerItem.MinHeight;
2867
                        designerItem.Height -= deltaVertical;
2868
                        break;
2869
                    case VerticalAlignment.Top:
2870
                        deltaVertical = designerItem.ActualHeight - designerItem.MinHeight;
2871
                        Canvas.SetTop(designerItem, Canvas.GetTop(designerItem) + deltaVertical);
2872
                        designerItem.Height -= deltaVertical;
2873
                        break;
2874
                    default:
2875
                        break;
2876
                }
2877
2878
                switch (HorizontalAlignment)
2879
                {
2880
                    case HorizontalAlignment.Left:
2881
                        deltaHorizontal = designerItem.ActualWidth - designerItem.MinWidth;
2882
                        Canvas.SetLeft(designerItem, Canvas.GetLeft(designerItem) + deltaHorizontal);
2883
                        designerItem.Width -= deltaHorizontal;
2884
                        break;
2885
                    case HorizontalAlignment.Right:
2886
                        deltaHorizontal = designerItem.ActualWidth - designerItem.MinWidth;
2887
                        designerItem.Width -= deltaHorizontal;
2888
                        break;
2889
                    default:
2890
                        break;
2891
                }
2892
            }
2893
            e.Handled = true;
2894
        }
2895
2896
        SaveFileDialog SaveDig = new SaveFileDialog(); //파일 세이브 다이얼로그
2897
2898
        void ExportMethod()
2899
        {
2900
            //FileDialogFilter filterImage = new FileDialogFilter("Image Files", "*.jpg", "*.png");
2901
            SaveDig.Filter = "PDF file format|*.pdf";
2902
            SaveDig.Title = "Save an DWG File";
2903
            SaveDig.ShowDialog();
2904
        }
2905
2906 537f4cd8 djkim
        private void cbAutoSave_Checked(object sender, RoutedEventArgs e)
2907 be04d12c djkim
        {            
2908
            if (cbAutoSave.IsChecked == true)
2909 537f4cd8 djkim
            {
2910
                SaveTime(true, (int)cbSaveInterval.Value);
2911
            }
2912
            else
2913
            {
2914
                SaveTime(false, (int)cbSaveInterval.Value);
2915
            }
2916
        }
2917
        private void cbSaveInterval_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e)
2918
        {
2919 be04d12c djkim
            if(string.IsNullOrEmpty(cbSaveInterval.Value.ToString()))
2920
            {
2921
                cbSaveInterval.Value = cbSaveInterval.Minimum;
2922
            }
2923 537f4cd8 djkim
            if (cbAutoSave.IsChecked == true)
2924
            {
2925
                SaveTime(true, (int)cbSaveInterval.Value);
2926 5822e146 ljiyeon
            }
2927
2928
            KCOM.Properties.Settings.Default.SaveInterval = (double)cbSaveInterval.Value;
2929
            Properties.Settings.Default.Save();
2930 537f4cd8 djkim
        }
2931 787a4489 KangIngu
        //강인구 자동 저장 추가
2932
        private void AutoSave(object sender, RoutedEventArgs e)
2933
        {
2934
            RadToggleButton instanceToggle = sender as RadToggleButton;
2935
2936
            if(instanceToggle.IsChecked == true)
2937
            {
2938
                SaveTime(true);
2939
            }
2940
            else
2941
            {
2942
                SaveTime(false);
2943
            }
2944
        }
2945
2946 d4b0c723 KangIngu
        public void Copy_Start()
2947
        {
2948
            if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2949
            {
2950
                string MarkupData = "";
2951
2952
                foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2953
                {
2954 5b48dae7 taeseongkim
                    string id = string.Empty;
2955 d4b0c723 KangIngu
                    if (item.GetType().Name == "AdornerFinal")
2956
                    {
2957 4913851c humkyung
                        foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
2958 d4b0c723 KangIngu
2959
                        {
2960
                            if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2961
                            {
2962 129ca191 humkyung
                                MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn res = MarkupParser.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID);
2963 5b48dae7 taeseongkim
                                id = (InnerItem.Symbol_ID != null) ? "|SymbolID|" + InnerItem.Symbol_ID : "";
2964
                                MarkupData += "|OR|" + res.ConvertData + id;
2965 d4b0c723 KangIngu
                            }
2966
                        }
2967 5b48dae7 taeseongkim
2968
                        this.Dispatcher.Invoke(() =>
2969
                        {
2970
                            Clipboard.SetData(DataFormats.StringFormat, MarkupData);
2971
                        }, DispatcherPriority.Background);
2972 d4b0c723 KangIngu
                    }
2973
                }
2974
            }
2975
        }
2976
2977
        public void Cut_Start()
2978
        {
2979
            if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2980
            {
2981
                foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2982
                {
2983
                    string MarkupData = "";
2984
2985
                    if (item.GetType().Name == "AdornerFinal")
2986
                    {
2987 4913851c humkyung
                        foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
2988 d4b0c723 KangIngu
                        {
2989
                            if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2990
                            {
2991 129ca191 humkyung
                                MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn res = MarkupParser.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID);
2992
                                MarkupData += "|OR|" + res.ConvertData;
2993 d4b0c723 KangIngu
                            }
2994
                        }
2995 ccf944bb ljiyeon
                        //클립보드에 넣음
2996 8f7f8073 taeseongkim
                        Clipboard.SetDataObject(MarkupData);
2997 d4b0c723 KangIngu
                    }
2998
                }
2999
                this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear();
3000
            }
3001
        }
3002
3003 ac4f1e13 taeseongkim
        public async void Paste_Start()
3004 d4b0c723 KangIngu
        {
3005
            //마크업 붙여넣기
3006 5b48dae7 taeseongkim
3007
            var markupData = Clipboard.GetData(DataFormats.StringFormat);
3008
3009
            if (markupData.GetType() == typeof(string) && markupData.ToString().Contains("|OR||DZ|"))
3010 d4b0c723 KangIngu
            {
3011
                List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>();
3012
3013
                string[] delimiterChars = { "|OR|" };
3014 5b48dae7 taeseongkim
                string[] data = markupData.ToString().Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
3015 d4b0c723 KangIngu
3016 077896be humkyung
                SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu);
3017 d4b0c723 KangIngu
3018 b79d6e7f humkyung
                UndoData multi_UndoData = new UndoData();
3019 d4b0c723 KangIngu
3020
                //강인구 Undo/Redo 보류
3021 873011c4 humkyung
                MarkupToPDF.Common.UndoDataGroup UndoData = new UndoDataGroup()
3022 d4b0c723 KangIngu
                {
3023
                    IsUndo = false,
3024 873011c4 humkyung
                    Event = EventType.Create,
3025 d4b0c723 KangIngu
                    EventTime = DateTime.Now,
3026 b79d6e7f humkyung
                    MarkupDataColl = new List<UndoData>()
3027 d4b0c723 KangIngu
                };
3028
3029
                ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i =>
3030
                {
3031
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
3032
                });
3033
3034
                foreach (string parse in data)
3035
                {
3036
                    if (parse != "")
3037
                    {
3038 58dd9e89 humkyung
                        System.Windows.Controls.Control item = await MarkupParser.ParseExAsync(App.BaseAddress,ViewerDataModel.Instance.NewMarkupCancelToken(),App.ViewInfo.ProjectNO, parse, ViewerDataModel.Instance.MarkupControls_USER, ViewerDataModel.Instance.PageAngle, string.Empty, string.Empty,
3039
                            STAMP_Contents: App.SystemInfo.STAMP_CONTENTS);
3040 5a223b60 humkyung
                        (item as MarkupToPDF.Common.CommentUserInfo).CommentID = Commons.ShortGuid();
3041 d4b0c723 KangIngu
3042
                        ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo);
3043
                        ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo);
3044
3045
                        adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo);
3046
3047 873011c4 humkyung
                        multi_UndoData = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo);
3048 d4b0c723 KangIngu
3049 873011c4 humkyung
                        UndoData.MarkupDataColl.Add(multi_UndoData);
3050 6707a5c7 ljiyeon
                        ViewerDataModel.Instance.UndoDataList.Add(UndoData);                        
3051 d4b0c723 KangIngu
                    }
3052
                }
3053
                Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet);
3054
3055
                if(this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X < 0)
3056
                {
3057
                    Canvas.SetLeft(final, 0);
3058
                    Canvas.SetTop(final, 0);
3059
                }
3060
                else
3061
                {
3062
                    double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2);
3063
                    double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2);
3064 0d00f9c8 humkyung
                    final.TranslateItems(realPointX, realPointY);
3065 d4b0c723 KangIngu
3066 4913851c humkyung
                    if (final.Members.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null)
3067 d4b0c723 KangIngu
                    {
3068 0d00f9c8 humkyung
                        final.TranslateItems(0.001, 0.001); //dummy
3069 d4b0c723 KangIngu
                    }
3070
                }
3071
3072
                this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final);
3073
            }
3074
            //외부 이미지 붙여넣기
3075
            else if (Clipboard.GetImage() != null)
3076
            {
3077 c73426a9 ljiyeon
                try
3078 d4b0c723 KangIngu
                {
3079 b79d6e7f humkyung
                    UndoData multi_UndoData = new UndoData();
3080 d4b0c723 KangIngu
3081 c73426a9 ljiyeon
                    //강인구 Undo/Redo 보류
3082 873011c4 humkyung
                    MarkupToPDF.Common.UndoDataGroup UndoData = new UndoDataGroup()
3083 c73426a9 ljiyeon
                    {
3084
                        IsUndo = false,
3085 873011c4 humkyung
                        Event = EventType.Create,
3086 c73426a9 ljiyeon
                        EventTime = DateTime.Now,
3087 b79d6e7f humkyung
                        MarkupDataColl = new List<UndoData>()
3088 c73426a9 ljiyeon
                    };
3089 d4b0c723 KangIngu
3090
3091 c73426a9 ljiyeon
                    string temppath = System.IO.Path.GetTempPath();
3092
                    //string filename = KCOM.Events.Save.shortCommentKey();
3093 5a223b60 humkyung
                    string filename = Commons.ShortFileKey();
3094 d4b0c723 KangIngu
3095 c73426a9 ljiyeon
                    System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage();
3096
                    clipboardImage.Save(temppath + "\\" + filename);
3097 d4b0c723 KangIngu
3098 c73426a9 ljiyeon
                    System.IO.FileInfo fileInfo = new System.IO.FileInfo(temppath + "\\" + filename);
3099
                    String strFile = System.IO.Path.GetFileName(fileInfo.FullName);
3100
                    long numByte = fileInfo.Length;
3101
                    double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
3102 76dc223b taeseongkim
                    kr.co.devdoftech.cloud.FileUpload fileUploader = App.FileUploader;
3103 d4b0c723 KangIngu
3104 c73426a9 ljiyeon
                    if (dLen < 4)
3105
                    {
3106
                        System.IO.FileStream fStream = new System.IO.FileStream(fileInfo.FullName,
3107 43e1d368 taeseongkim
                        System.IO.FileMode.Open, System.IO.FileAccess.Read,FileShare.Read);
3108 c73426a9 ljiyeon
                        System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
3109
                        byte[] data = br.ReadBytes((int)numByte);
3110 d4b0c723 KangIngu
3111 c73426a9 ljiyeon
                        filename = fileUploader.Run(App.ViewInfo.ProjectNO, this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile + ".png", data);
3112
                        Check_Uri.UriCheck(filename);
3113
                        br.Close();
3114
                        fStream.Close();
3115
                        fStream.Dispose();
3116
                    }
3117
                    else
3118
                    {
3119
                        this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert");
3120
                        return;
3121
                    }
3122 d4b0c723 KangIngu
3123 c73426a9 ljiyeon
                    fileInfo.Delete();
3124
3125
                    System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(clipboardImage);
3126
                    IntPtr hBitmap = bmp.GetHbitmap();
3127
                    System.Windows.Media.ImageSource WpfBitmap = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
3128
                    Image img = new Image();
3129
                    if (filename.Contains(".svg"))
3130 53880c83 ljiyeon
                    {
3131 f1f822e9 taeseongkim
                        SharpVectors.Converters.SvgImageExtension svgImage = new SharpVectors.Converters.SvgImageExtension(filename);
3132
                        img.Source = (DrawingImage)svgImage.ProvideValue(null);
3133 c73426a9 ljiyeon
                    }
3134
                    else
3135
                    {
3136
                        img.Source = new BitmapImage(new Uri(filename));
3137 53880c83 ljiyeon
                    }
3138 d4b0c723 KangIngu
3139 c73426a9 ljiyeon
                    var currentControl = new MarkupToPDF.Controls.Etc.ImgControl
3140
                    {
3141
                        PointSet = new List<Point>(),
3142
                        FilePath = filename,
3143
                        ImageData = img.Source,
3144
                        StartPoint = new Point(100, 100),
3145
                        EndPoint = new Point(200, 200),
3146
                        TopRightPoint = new Point(100, 200),
3147
                        LeftBottomPoint = new Point(200, 100)
3148
                    };
3149 d4b0c723 KangIngu
3150 c73426a9 ljiyeon
                    currentControl.TopRightPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y);
3151
                    currentControl.LeftBottomPoint = new Point(currentControl.StartPoint.X, currentControl.StartPoint.Y + clipboardImage.Height);
3152
                    currentControl.EndPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y + clipboardImage.Height);
3153 d4b0c723 KangIngu
3154 c73426a9 ljiyeon
                    currentControl.PointSet = new List<Point>
3155 d4b0c723 KangIngu
                                        {
3156
                                            currentControl.StartPoint,
3157
                                            currentControl.LeftBottomPoint,
3158
                                            currentControl.EndPoint,
3159
                                            currentControl.TopRightPoint,
3160
                                        };
3161
3162 873011c4 humkyung
                    multi_UndoData = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo);
3163
                    UndoData.MarkupDataColl.Add(multi_UndoData);
3164 c73426a9 ljiyeon
                    ViewerDataModel.Instance.UndoDataList.Add(UndoData);
3165 d4b0c723 KangIngu
3166 c73426a9 ljiyeon
                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo);
3167 5a223b60 humkyung
                    currentControl.CommentID = Commons.ShortGuid();
3168 d4b0c723 KangIngu
3169 c73426a9 ljiyeon
                    currentControl.ApplyTemplate();
3170
                    currentControl.SetImage();
3171 d4b0c723 KangIngu
3172 c73426a9 ljiyeon
                    ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo);
3173
                    Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo);
3174
                    this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final);
3175 ccf944bb ljiyeon
3176 c73426a9 ljiyeon
                    double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2);
3177
                    double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2);
3178 0d00f9c8 humkyung
                    final.TranslateItems(realPointX, realPointY);
3179 c73426a9 ljiyeon
                }
3180
                catch(Exception ex)
3181
                {
3182
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("" + ex, "Alert");
3183
                }
3184 d4b0c723 KangIngu
            }
3185
        }
3186 787a4489 KangIngu
    }
3187
}
클립보드 이미지 추가 (최대 크기: 500 MB)