프로젝트

일반

사용자정보

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

markus / KCOM / Events / Event_KeyEvent.cs @ c7b02506

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

1 787a4489 KangIngu
using KCOM.Common;
2 8118ba81 swate0609
using KCOM.Controls;
3 f816dd63 humkyung
using KCOM.Events;
4 787a4489 KangIngu
using MarkupToPDF.Common;
5 8118ba81 swate0609
using MarkupToPDF.Controls.Cad;
6
using MarkupToPDF.Controls.Line;
7 036650a0 humkyung
using MarkupToPDF.Controls.Parsing;
8 8118ba81 swate0609
using MarkupToPDF.Controls.Polygon;
9
using MarkupToPDF.Controls.Shape;
10 38d69491 taeseongkim
using MarkupToPDF.Controls.Text;
11 787a4489 KangIngu
using System;
12
using System.Collections.Generic;
13
using System.ComponentModel;
14
using System.Linq;
15
using System.Text;
16
using System.Windows;
17
using System.Windows.Controls;
18
using System.Windows.Input;
19 53880c83 ljiyeon
using System.Windows.Media;
20
using System.Windows.Media.Imaging;
21 787a4489 KangIngu
using Telerik.Windows.Controls;
22 0c997b99 ljiyeon
//using static KCOM.Views.MainMenu;
23 787a4489 KangIngu
24
namespace KCOM
25
{
26 68302e9d taeseongkim
    public partial class MainWindow : KCOM.Controls.CustomizedWindow.CustomWindow
27 787a4489 KangIngu
    {
28
        public double CumulativeWheel = 0;
29 036650a0 humkyung
        MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn markupReturn = new MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn();
30 da92cfb7 ljiyeon
                
31 b2d0f316 humkyung
        /// <summary>
32
        /// 입력한 키 처리
33
        /// </summary>
34
        /// <param name="sender"></param>
35
        /// <param name="e"></param>
36 91e84544 taeseongkim
        public async void KeyEventDownAction(object sender, KeyEventArgs e)
37 787a4489 KangIngu
        {
38 91e84544 taeseongkim
            //if (e.IsRepeat && !ViewerDataModel.Instance.IsPressCtrl && !ViewerDataModel.Instance.IsPressShift)
39
            //    return;
40
            await this.Dispatcher.InvokeAsync(() => {
41 787a4489 KangIngu
            switch (e.Key)
42
            {
43 5a65e058 taeseongkim
                    //강인구 추가
44 787a4489 KangIngu
                #region 단축키 선택
45
46 872b94b9 taeseongkim
                case Key.I:
47 5a65e058 taeseongkim
                    {
48
                        if (ViewerDataModel.Instance.IsPressCtrl && ViewerDataModel.Instance.IsPressShift)
49
                        {
50 c206d293 taeseongkim
                                if (!ViewerDataModel.Instance.IsAdmin)
51 872b94b9 taeseongkim
                                {
52 c206d293 taeseongkim
                                    EventHandler<WindowClosedEventArgs> closeEventHandler = (snd, evt) =>
53
                                    {
54
                                        if (evt.PromptResult == "markus01#")
55
                                        {
56
                                            ViewerDataModel.Instance.IsAdmin = true;
57
                                        }
58
                                    };
59
60
                                    var parameters = new DialogParameters()
61
                                    {
62
                                        ContentStyle = (Style)this.FindResource("RadPasswordPromptStyle"),
63
                                        Content = "Enter password: ",
64
                                        Closed = closeEventHandler
65
                                    };
66
67
                                    RadWindow.Prompt(parameters);
68 872b94b9 taeseongkim
                                }
69
                                else
70
                                {
71
                                    ViewerDataModel.Instance.IsAdmin = false;
72
                                }
73
                            }
74 5a65e058 taeseongkim
                    }
75
                    break;
76
77 b2d0f316 humkyung
                #region 전체 선택(Ctrl + A)
78 787a4489 KangIngu
                case Key.A:
79
                    {
80 53393bae KangIngu
                        if (ViewerDataModel.Instance.IsPressCtrl && (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission))
81 787a4489 KangIngu
                        {
82 f959ea6f humkyung
                            this.dzMainMenu.ConvertInkControlToPolygon();
83 787a4489 KangIngu
84
                            if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0)
85
                            {
86 92c9cab8 taeseongkim
                                var text_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as TextControl) != null && (data as TextControl).IsEditingMode == true).FirstOrDefault();
87
                                if (text_item_ != null)
88
                                {
89 2a2e72c2 swate0609
                                    //2024-04-25 IRON
90
                                    //TextBox가 편집중일 때 Control + A (전체 선택) 하면 전체 텍스트가 선택되도록 수정. 
91
                                    return;
92 92c9cab8 taeseongkim
                                    (text_item_ as TextControl).Base_TextBlock.Visibility = Visibility.Visible;
93
                                    (text_item_ as TextControl).Base_TextBox.Visibility = Visibility.Collapsed;
94 2a2e72c2 swate0609
                                    //(text_item_ as TextControl).UnEditingMode();
95 92c9cab8 taeseongkim
96 2a2e72c2 swate0609
                                    //SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu);
97
98
99
                                    //return;
100 92c9cab8 taeseongkim
                                }
101
102
                                var Arrowtext_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as ArrowTextControl) != null && (data as ArrowTextControl).IsEditingMode == true).FirstOrDefault();
103 c4a8d205 swate0609
                                //if (Arrowtext_item_ != null && ((Arrowtext_item_ as ArrowTextControl).IsNew == false))
104
                                if(Arrowtext_item_ != null)
105 92c9cab8 taeseongkim
                                {
106 8e924295 swate0609
                                    //2024-04-25 IRON
107
                                    //TextBox가 편집중일 때 Control + A (전체 선택) 하면 전체 텍스트가 선택되도록 수정. 
108
                                    return;
109
                                    //(Arrowtext_item_ as ArrowTextControl).IsEditingMode = false;
110
                                    //(Arrowtext_item_ as ArrowTextControl).Base_TextBox.Focusable = false;
111
                                    //(Arrowtext_item_ as ArrowTextControl).UnEditingMode();
112 92c9cab8 taeseongkim
113 8e924295 swate0609
                                    //SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu);
114 92c9cab8 taeseongkim
                                }
115
116
                                    /// 전체 선택 시 선택된 토글 해제
117 787a4489 KangIngu
                                var TogList = this.dzTopMenu.Parent.ChildrenOfType<RadToggleButton>();
118
                                this.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
119
                                this.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
120
121 92c9cab8 taeseongkim
                                if (text_item_ == null && Arrowtext_item_ == null)
122
                                {
123
                                    /// 컨트롤을 그리는 도중일 경우 컨트롤 삭제
124
                                    ViewerDataModel.Instance.MarkupControls_USER.Remove(this.dzMainMenu.currentControl);
125
                                }
126
127 787a4489 KangIngu
                                this.dzMainMenu.currentControl = null;
128
129
                                foreach (var tog in TogList)
130
                                {
131
                                    tog.IsChecked = false;
132
                                }
133 077896be humkyung
134 b37ef4b3 humkyung
                                SelectionSet.Instance.SelectAll();
135 787a4489 KangIngu
                            }
136
                        }
137
                    }
138
                    break;
139
                #endregion
140
141
                #region 복사하기(Ctrl + C)
142
                case Key.C:
143
                    {
144 b37ef4b3 humkyung
                        if (ViewerDataModel.Instance.IsPressCtrl) CopyCommand.Instance.Execute();
145 787a4489 KangIngu
                    }
146
                    break;
147
                #endregion
148
149
                #region 잘라내기(Ctrl + X)
150
                case Key.X:
151
                    {
152 b37ef4b3 humkyung
                        if (ViewerDataModel.Instance.IsPressCtrl) CutCommand.Instance.Execute();
153 787a4489 KangIngu
                    }
154
                    break;
155
                #endregion
156
157
                #region 붙여넣기(Ctrl + V)
158
                case Key.V:
159
                    {
160 53393bae KangIngu
                        if (ViewerDataModel.Instance.IsPressCtrl && (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission))
161 787a4489 KangIngu
                        {
162 b37ef4b3 humkyung
                            PasteCommand.Instance.Execute();
163 37b65344 humkyung
                        }
164 787a4489 KangIngu
                    }
165
                    break;
166
                #endregion
167
168
                #region 저장하기(Ctrl + S)
169
                case Key.S:
170
                    {
171 37b65344 humkyung
                        if (ViewerDataModel.Instance.IsPressCtrl && (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission))
172 787a4489 KangIngu
                        {
173 38d69491 taeseongkim
                            var text_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as TextControl) != null && (data as TextControl).IsEditingMode == true).FirstOrDefault();
174
                            if (text_item_ != null)
175
                            {
176
                                (text_item_ as TextControl).Base_TextBlock.Visibility = Visibility.Visible;
177
                                (text_item_ as TextControl).Base_TextBox.Visibility = Visibility.Collapsed;
178
                                (text_item_ as TextControl).UnEditingMode();
179
180
                                SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu);
181
                            }
182
183
                            var Arrowtext_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as ArrowTextControl) != null && (data as ArrowTextControl).IsEditingMode == true).FirstOrDefault();
184
                            if (Arrowtext_item_ != null && ((Arrowtext_item_ as ArrowTextControl).IsNew == false))
185
                            {
186
                                (Arrowtext_item_ as ArrowTextControl).IsEditingMode = false;
187
                                (Arrowtext_item_ as ArrowTextControl).Base_TextBox.Focusable = false;
188
                                (Arrowtext_item_ as ArrowTextControl).UnEditingMode();
189
190
                                SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu);
191
                            }
192
193
                            if (text_item_ == null && Arrowtext_item_ == null)
194
                            {                                 //컨트롤을 그리는 도중일 경우 컨트롤 삭제
195
                                ViewerDataModel.Instance.MarkupControls_USER.Remove(this.dzMainMenu.currentControl);
196
                            }
197
198 787a4489 KangIngu
                            this.dzMainMenu.currentControl = null;
199
200 316d0f5c KangIngu
                            //this.dzTopMenu.SaveEvent(null, null);
201 65eb8dd6 ljiyeon
                            if (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission)
202
                            {
203 5ba8f2d5 taeseongkim
                                ViewerDataModel.Instance.IsMarkupUpdate = true;
204 cb5c7f06 humkyung
                                this.dzTopMenu.SaveEventCallback(new object(), null);
205 65eb8dd6 ljiyeon
                            }
206 6707a5c7 ljiyeon
207
                            //저장완료후 임시파일 삭제
208 2b1f30fe taeseongkim
                            //TempFile.Remove();
209 37b65344 humkyung
                        }
210 787a4489 KangIngu
                    }
211
                    break;
212
                #endregion
213
214
                #region 프린트하기(Ctrl + P)
215
                case Key.P:
216
                    {
217
                        if (ViewerDataModel.Instance.IsPressCtrl)
218
                        {
219
                            this.dzTopMenu.Print_Start("Print");
220
                        }
221
                    }
222
                    break;
223 e1b36bc0 humkyung
                    #endregion
224
                case Key.G:
225
                    {
226
                        #region Grouping 해제
227
                        if (ViewerDataModel.Instance.IsPressCtrl && ViewerDataModel.Instance.IsPressShift)
228
                        {
229 8118ba81 swate0609
                            if (ViewerDataModel.Instance.UndoDataList == null)
230
                            {
231
                                return;
232
                            }
233
234
                            UndoCommand.Instance.Push(EventType.Operation, SelectionSet.Instance.SelectedItems);
235
236 e1b36bc0 humkyung
                            SelectionSet.Instance.SelectedItems.ForEach(x => x.GroupID = string.Empty);
237
                        }
238
                        #endregion
239
                        #region Grouping
240
                        else if (ViewerDataModel.Instance.IsPressCtrl)
241
                        {
242 8118ba81 swate0609
                            if (ViewerDataModel.Instance.UndoDataList == null)
243
                            {
244
                                return;
245
                            }
246
247
                            UndoCommand.Instance.Push(EventType.Operation, SelectionSet.Instance.SelectedItems);
248
249 e1b36bc0 humkyung
                            string GroupID = Guid.NewGuid().ToString();
250
                            SelectionSet.Instance.SelectedItems.ForEach(x => x.GroupID = GroupID);
251
                        }
252
                        #endregion
253
                    }
254
                    break;
255 787a4489 KangIngu
256
                #region Undo(Ctrl + Z)
257 e1b36bc0 humkyung
                    case Key.Z:
258 787a4489 KangIngu
                    {
259 f816dd63 humkyung
                        if (ViewerDataModel.Instance.IsPressCtrl) UndoCommand.Instance.Execute();
260 787a4489 KangIngu
                    }
261
                    break;
262
                #endregion
263
264
                #region Redo(Ctrl + Y)
265
                case Key.Y:
266
                    {
267 f816dd63 humkyung
                        if (ViewerDataModel.Instance.IsPressCtrl) RedoCommand.Instance.Execute();
268 787a4489 KangIngu
                    }
269
                    break;
270
                #endregion
271
272
                #region 삭제하기(Delete)
273
                case Key.Delete:
274
                    {
275 8e6884a5 taeseongkim
                        List<CommentUserInfo> selectItems = SelectionSet.Instance.SelectedItems;
276 85132173 humkyung
                        SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu);
277 f816dd63 humkyung
                        this.dzMainMenu.SelectLayer.Children.Clear();
278 8e6884a5 taeseongkim
279 34ac8db7 humkyung
                        UndoCommand.Instance.Push(EventType.Delete, selectItems);
280 787a4489 KangIngu
                    }
281
                    break;
282
                #endregion
283
284
                #region 선택된 컨트롤 모두 해제 하기(ESC)
285
                case Key.Escape:
286
                    {
287
                        //캡쳐모드 일 경우 초기화
288 37b65344 humkyung
                        if (this.dzMainMenu.mouseHandlingMode == IKCOM.MouseHandlingMode.Capture)
289 787a4489 KangIngu
                        {
290
                            //dzMainMenu.PN_Navi.IsEnabled = true;
291
                            this.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
292
                            ViewerDataModel.Instance.Capture_Opacity = 0;
293
                        }
294
295 b74a9c91 taeseongkim
                        if (Common.ViewerDataModel.Instance.SelectedControl == "Batch"
296
                                || Common.ViewerDataModel.Instance.SelectedControl == "MACRO")
297 787a4489 KangIngu
                        {
298
                            this.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
299
                            this.dzMainMenu.txtBatch.Visibility = Visibility.Collapsed;
300
                            this.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
301
                            var TogList = this.dzTopMenu.Parent.ChildrenOfType<RadToggleButton>();
302
                            foreach (var tog in TogList)
303
                            {
304
                                tog.IsChecked = false;
305
                            }
306
                        }
307
308 077896be humkyung
                        SelectionSet.Instance.UnSelect(this.dzMainMenu);
309 787a4489 KangIngu
310
                        //코멘트 그리는 도중일 경우 코멘트 삭제 및 초기화
311 49b217ad humkyung
                        if (this.dzMainMenu.currentControl != null)
312
                        {
313
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(this.dzMainMenu.currentControl);
314
                            this.dzMainMenu.currentControl = null;
315
                        }
316 787a4489 KangIngu
317 2eac4f76 KangIngu
                        //모든 컨트롤 초기화 하고 Selection모드로 변경
318
                        dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting;
319
                        dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
320
321
                        var toggleList = this.ChildrenOfType<RadToggleButton>();
322
                        var toggleList2 = this.ChildrenOfType<RadRibbonToggleButton>();
323
324 17a22987 KangIngu
                        foreach (var item in toggleList)
325
                        {
326
                            if (item.Name == "btnSelection")
327 2eac4f76 KangIngu
                            {
328
                                item.IsChecked = true;
329
                            }
330 17a22987 KangIngu
                            else
331 2eac4f76 KangIngu
                            {
332
                                item.IsChecked = false;
333
                            }
334 17a22987 KangIngu
                        }
335 9f473fb7 KangIngu
                        dzMainMenu.isLeftMouseButtonDownOnWindow = false;
336 b643fcca taeseongkim
                            //foreach (var item in toggleList2)
337
                            //{
338
                            //    item.IsChecked = false;
339
                            //}
340
                            ViewerDataModel.Instance.SetAngleVisible(Visibility.Collapsed);
341 787a4489 KangIngu
                    }
342
                    break;
343 992a98b4 KangIngu
                #endregion
344
345
                #region FIND(Ctrl + F)
346
                case Key.F:
347
                    {
348 469b2bbf KangIngu
                        if (ViewerDataModel.Instance.IsPressCtrl)
349 992a98b4 KangIngu
                        {
350 469b2bbf KangIngu
                            if (!this.dzMainMenu.searchPane.IsPinned)
351 992a98b4 KangIngu
                            {
352 469b2bbf KangIngu
                                this.dzMainMenu.searchPane.IsPinned = true;
353
                                if (ViewerDataModel.Instance.searchPDF != null)
354
                                {
355 8bd25583 taeseongkim
                                    Application.Current.Dispatcher.BeginInvoke(new Action(() =>
356
                                    {
357
                                        this.dzMainMenu.searchPanel_Instance.tbSearch.Focusable = true;
358
                                        this.dzMainMenu.searchPanel_Instance.tbSearch.Focus();
359
                                        Keyboard.Focus(this.dzMainMenu.searchPanel_Instance.tbSearch);
360
                                    }), System.Windows.Threading.DispatcherPriority.Render);
361 469b2bbf KangIngu
                                }
362
                                else
363
                                {
364
                                    this.dzMainMenu.searchPanel_Instance.btnSearch.Focus();
365
                                }
366 992a98b4 KangIngu
                            }
367
                            else
368
                            {
369 469b2bbf KangIngu
                                this.dzMainMenu.searchPane.IsPinned = false;
370
                                this.dzMainMenu.searchPane.IsActive = false;
371
                                //this.dzMainMenu.searchPane.IsHidden = true;
372 992a98b4 KangIngu
                            }
373
                        }
374
                    }
375
                    break;
376
                #endregion
377 787a4489 KangIngu
378
                #endregion
379
380
                //강인구 추가
381
                #region Control Move
382 1edefbdf taeseongkim
                //case Key.NumPad4:
383
                //case Key.NumPad5:
384
                //case Key.NumPad6:
385
                //case Key.NumPad8:
386 d543f923 ljiyeon
                case Key.Right:
387
                case Key.Left:
388
                case Key.Up:
389
                case Key.Down:
390
                    {
391 d60f94ee taeseongkim
						if(System.Windows.Input.Keyboard.FocusedElement is System.Windows.Controls.TextBox)
392
						{
393
							return;
394
						}
395
						
396 91e84544 taeseongkim
                        if(sender is UIElement)
397
                        {
398
                            (sender as UIElement).SetValue(TabNavigationExtensions.IsTabStopProperty, false);
399
                        }
400
401 f87dfb18 taeseongkim
                        Point? MovePoint = null;
402
                        if ((e.Key == Key.NumPad5) || (e.Key == Key.Down))
403 d543f923 ljiyeon
                        {
404 f87dfb18 taeseongkim
                            MovePoint = new Point(0, 5);
405
                        }
406
                        else if ((e.Key == Key.NumPad8) || (e.Key == Key.Up))
407
                        {
408
                            MovePoint = new Point(0, -5);
409
                        }
410
                        else if ((e.Key == Key.NumPad4) || (e.Key == Key.Left))
411
                        {
412
                            MovePoint = new Point(-5, 0);
413
                        }
414
                        else if ((e.Key == Key.NumPad6) || (e.Key == Key.Right))
415
                        {
416
                            MovePoint = new Point(5, 0);
417
                        }
418
419
                        if (MovePoint != null && MovePoint.HasValue)
420
                        {
421
                            if (this.dzMainMenu.SelectLayer.Children.Count > 0 && ViewerDataModel.Instance.IsPressShift)
422 37b65344 humkyung
                            {
423 f87dfb18 taeseongkim
424
                                this.TranslateOrRotateItems(MovePoint.Value, this.dzMainMenu.rotate.Angle);
425 37b65344 humkyung
                            }
426 f87dfb18 taeseongkim
                            else
427 37b65344 humkyung
                            {
428 91e84544 taeseongkim
                                //if (ViewerDataModel.Instance.IsPressCtrl)
429
                                //{
430 f87dfb18 taeseongkim
                                    bool IsMovePossibility = false;
431
432
                                    var instance = ViewerDataModel.Instance;
433
434
                                    if ((e.Key == Key.NumPad5) || (e.Key == Key.Down))
435
                                    {
436 f06cce07 taeseongkim
                                        if (instance.ContentHeight > instance.ContentOffsetY + instance.ContentViewportHeight)
437 f87dfb18 taeseongkim
                                        {
438
                                            IsMovePossibility = true;
439
                                        }
440
                                    }
441
                                    else if ((e.Key == Key.NumPad8) || (e.Key == Key.Up))
442
                                    {
443
                                        if (0 < instance.ContentOffsetY)
444
                                        {
445
                                            IsMovePossibility = true;
446
                                        }
447
                                    }
448
                                    else if ((e.Key == Key.NumPad4) || (e.Key == Key.Left))
449
                                    {
450
                                        if (0 < instance.ContentOffsetX)
451
                                        {
452
                                            IsMovePossibility = true;
453
                                        }
454
                                    }
455
                                    else if ((e.Key == Key.NumPad6) || (e.Key == Key.Right))
456
                                    {
457 f06cce07 taeseongkim
                                        if (instance.ContentWidth > instance.ContentOffsetX + instance.ContentViewportWidth)
458 f87dfb18 taeseongkim
                                        {
459
                                            IsMovePossibility = true;
460
                                        }
461
                                    }
462
463
                                    if (IsMovePossibility)
464
                                    {
465
                                        Vector dragOffset = new Vector(MovePoint.Value.X * -10, MovePoint.Value.Y * -10);
466
467
                                        this.dzMainMenu.MoveZoomAndPanControl(dragOffset);
468
469
                                        this.dzMainMenu.MainDocumentPanel.Focus();
470
471
                                        System.Diagnostics.Debug.WriteLine(this.dzMainMenu.zoomAndPanControl.ContentOffsetX);
472
                                    }
473 91e84544 taeseongkim
                                //}
474 37b65344 humkyung
                            }
475 d543f923 ljiyeon
                        }
476
                    }
477
                    break;
478 da92cfb7 ljiyeon
                #endregion
479
                case Key.PageUp:
480 2d584f1a djkim
                    
481 da92cfb7 ljiyeon
                    this.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber) - 1);
482
                    break;
483
                case Key.PageDown:
484
                    this.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber) + 1);
485
                    break;
486 b2d0f316 humkyung
                #region ZIndex 설정
487
                case Key.Add:
488
                    foreach (var item in SelectionSet.Instance.SelectedItems)
489
                    {
490
                        if (item.ZIndex < 100)
491
                        {
492
                            item.ZIndex++;
493
                            Canvas.SetZIndex(item, item.ZIndex);
494
                        }
495
                    }
496
                    ViewerDataModel.Instance.IsMarkupUpdate = true;
497
                    break;
498
                case Key.Subtract:
499
                    foreach(var item in SelectionSet.Instance.SelectedItems)
500
                    {
501
                        if (item.ZIndex > 0)
502
                        {
503
                            item.ZIndex--;
504
                            Canvas.SetZIndex(item, item.ZIndex);
505
                        }
506
                    }
507
                    ViewerDataModel.Instance.IsMarkupUpdate = true;
508
                    break;
509
                #endregion
510
                }
511 91e84544 taeseongkim
            });
512 787a4489 KangIngu
        }
513
514 f87dfb18 taeseongkim
515 37b65344 humkyung
        /// <summary>
516
        /// translate or rotate items by given pt and angle
517
        /// </summary>
518
        /// <author>humkyung</author>
519
        /// <date>2019.07.03</date>
520
        /// <param name="pt">control point</param>
521
        /// <param name="dAngle">angle in degree</param>
522
        private void TranslateOrRotateItems(Point pt, double dAngle)
523
        {
524
            Point control = MarkupToPDF.Controls.Common.MathSet.RotateAbout(new Point(0, 0), pt, dAngle);
525
            foreach (var item in this.dzMainMenu.SelectLayer.Children)
526
            {
527
                if (item.GetType().Name == "AdornerFinal")
528
                {
529
                    if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
530
                    {
531
                        (item as Controls.AdornerFinal).MoveRotate(new System.Windows.Controls.Primitives.DragDeltaEventArgs(control.X * 2, control.Y * 2));
532
                    }
533
                    else
534
                    {
535 6b6e937c taeseongkim
                        (item as Controls.AdornerFinal).TranslateItems(control.X, control.Y);
536 37b65344 humkyung
                    }
537
538
                }
539
            }
540
        }
541 787a4489 KangIngu
    }
542
}
클립보드 이미지 추가 (최대 크기: 500 MB)