프로젝트

일반

사용자정보

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

markus / KCOM / Events / Implementation / TopMenuEvent.cs @ 490208bd

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