프로젝트

일반

사용자정보

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

markus / KCOM / Controls / AdornerFinal.xaml.cs @ b1c2c6fe

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

1 787a4489 KangIngu
using KCOM.Common;
2 d128ceb2 humkyung
using KCOM.Events;
3 787a4489 KangIngu
using MarkupToPDF.Common;
4 684ef11c ljiyeon
using MarkupToPDF.Controls.Cad;
5 787a4489 KangIngu
using MarkupToPDF.Controls.Common;
6
using MarkupToPDF.Controls.Etc;
7
using MarkupToPDF.Controls.Line;
8 105359ce ljiyeon
using MarkupToPDF.Controls.Parsing;
9 787a4489 KangIngu
using MarkupToPDF.Controls.Polygon;
10
using MarkupToPDF.Controls.Shape;
11
using MarkupToPDF.Controls.Text;
12
using System;
13
using System.Collections.Generic;
14 53880c83 ljiyeon
using System.Diagnostics;
15 787a4489 KangIngu
using System.Linq;
16
using System.Text;
17 8e5a4a6a taeseongkim
using System.Threading.Tasks;
18 787a4489 KangIngu
using System.Windows;
19
using System.Windows.Controls;
20
using System.Windows.Controls.Primitives;
21
using System.Windows.Input;
22
using System.Windows.Media;
23
using Telerik.Windows.Controls;
24
25
namespace KCOM.Controls
26
{
27 f513c215 humkyung
    public class MyThumb : Thumb
28
    {
29
        public MyThumb()
30
        {
31
            this.Opacity = 0.6;
32
            this.MouseEnter += MyThumb_MouseEnter;
33
            this.MouseLeave += MyThumb_MouseLeave;
34
        }
35
36 3dbace4e taeseongkim
        public void Translate(double dx, double dy, double angle)
37
        {
38
            var ratotePoint = MathHelper.RotatePoint(new Point(dx, dy), new Point(), angle);
39
40
            Canvas.SetLeft(this, Canvas.GetLeft(this) + ratotePoint.X);
41
            Canvas.SetTop(this, Canvas.GetTop(this) + ratotePoint.Y);
42
        }
43
44
45 d2114d3b humkyung
        /// <summary>
46 f513c215 humkyung
        /// </summary>
47
        /// <param name="sender"></param>
48
        /// <param name="e"></param>
49
        private void MyThumb_MouseLeave(object sender, MouseEventArgs e)
50
        {
51
            this.Opacity = 0.6;
52
        }
53
54
        /// <summary>
55
        /// 
56
        /// </summary>
57
        /// <param name="sender"></param>
58
        /// <param name="e"></param>
59
        private void MyThumb_MouseEnter(object sender, MouseEventArgs e)
60
        {
61
            this.Opacity = 1.0;
62
        }
63
    }
64
65 787a4489 KangIngu
    /// <summary>
66
    /// Interaction logic for AdornerFinal.xaml
67
    /// </summary>
68
    public class AdornerMember
69
    {
70
        public UIElement DrawingData { get; set; }
71
        public ControlType Drawingtype { get; set; }
72
        public double DrawingAngle { get; set; }
73 f513c215 humkyung
        public List<MyThumb> ThumbList { get; set; }
74 c8e9b3e4 ljiyeon
        public string Symbol_ID { get; set; }
75 53880c83 ljiyeon
        public long Group_ID { get; set; }
76 508c3ac5 humkyung
77
        /// <summary>
78
        /// update thumb
79
        /// </summary>
80
        public void UpdateThumb()
81
        {
82
            var path = this.DrawingData as IPath;
83
            for (int i = 0; i < path.PointSet.Count; ++i)
84
            {
85
                Canvas.SetLeft(this.ThumbList[i], path.PointSet[i].X);
86
                Canvas.SetTop(this.ThumbList[i], path.PointSet[i].Y);
87
            }
88
89 3b797b23 humkyung
            if (this.DrawingData is ArrowTextControl ArrowTextCtrl)
90 508c3ac5 humkyung
            {
91 3b797b23 humkyung
                if (!ArrowTextCtrl.isTrans) //trans가 True인경우
92 508c3ac5 humkyung
                {
93
                    List<Point> ps = new List<Point>();
94
95
                    var temp = this.DrawingData as ArrowTextControl;
96
                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth / 2, Canvas.GetTop(temp.Base_TextBox))); //상단
97
                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth / 2, Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight)); // 하단
98
                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight / 2)); //좌단
99
                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth, Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight / 2));  //우단
100
101
                    if (temp.isFixed)
102
                    {
103
                        var endP = MathSet.getNearPoint(ps, temp.MidPoint);
104
                        var testP = endP;
105
                        if (ps[0] == endP) //상단
106
                        {
107
                            testP = new Point(endP.X, endP.Y - 50);
108
                        }
109
                        else if (ps[1] == endP) //하단
110
                        {
111
                            testP = new Point(endP.X, endP.Y + 50);
112
                        }
113
                        else if (ps[2] == endP) //좌단
114
                        {
115
                            testP = new Point(endP.X - 50, endP.Y);
116
                        }
117
                        else if (ps[3] == endP) //우단
118
                        {
119
                            testP = new Point(endP.X + 50, endP.Y);
120
                        }
121
                        Canvas.SetLeft(this.ThumbList[1], testP.X);
122
                        Canvas.SetTop(this.ThumbList[1], testP.Y);
123
                    }
124
                    else
125
                    {
126
                        var endP = MathSet.getNearPoint(ps, temp.MidPoint);
127
                        var tempP = MathSet.getMiddlePoint(temp.StartPoint, endP);
128
                        Canvas.SetLeft(this.ThumbList[1], tempP.X);
129
                        Canvas.SetTop(this.ThumbList[1], tempP.Y);
130
                    }
131
                }
132
            }
133
        }
134 554aae3b humkyung
135
        /// <summary>
136
        /// rotate members about given position and angle
137
        /// </summary>
138
        /// <param name="at"></param>
139
        /// <param name="angle">in degree</param>
140
        public void RotateAbout(Point at, double angle)
141
        {
142
            for (int i = 0; i < (this.DrawingData as IPath).PointSet.Count; i++)
143
            {
144
                (this.DrawingData as IPath).PointSet[i] = MathSet.RotateAbout(at, (this.DrawingData as IPath).PointSet[i], angle);
145
            }
146
            (this.DrawingData as CommentUserInfo).UpdateControl();
147
148
            this.UpdateThumb();
149
        }
150 787a4489 KangIngu
    }
151 4913851c humkyung
152 787a4489 KangIngu
    public partial class AdornerFinal : UserControl
153
    {
154
        public TextBox editTextBox { get; set; }
155
        #region 공용 인스턴스
156 4913851c humkyung
        public List<AdornerMember> Members { get; } = new List<AdornerMember>();
157 787a4489 KangIngu
        public Dictionary<Thumb, DragData> _dragData = new Dictionary<Thumb, DragData>();
158 b643fcca taeseongkim
159 edef7af2 humkyung
        private List<double> AlignedAngles {get;} = new List<double>() { 0, 30, 45, 60, 90, 120, 135, 150, 180, 210, 225, 240, 270, 300, 315, 330, 360 };
160
161 e65e8c5c humkyung
        /// <summary>
162
        /// 회전 시작할때의 각도
163
        /// </summary>
164 b643fcca taeseongkim
165 e65e8c5c humkyung
        private double angleValue;
166 b643fcca taeseongkim
        public double AngleValue { get => angleValue;
167
            set
168
            {
169
                if(angleValue != value)
170
                {
171
                    angleValue = value;
172
                }
173
            }
174
        }
175
176 e65e8c5c humkyung
        /// <summary>
177
        /// Axis Lock을 적용하지 않는 실제 회전 각도
178
        /// </summary>
179
        private double _ActualAngle { get; set; }
180
181 787a4489 KangIngu
        public bool IsTextAngle = false;
182
        public Rect BorderSize { get; set; }
183
        public bool TextCompensation = false;
184
        public bool isDragging { get; set; }
185
        public Thumb DraggerThumb { get; set; }
186
        public RadDropDownButton dropData;
187
        public RadCalendar dropCalendar;
188
        public Thumb mainDragThumb { get; set; }
189
190 4913851c humkyung
        private bool disposed;
191
192 787a4489 KangIngu
        public Point reSizePoint { get; set; }
193 e65e8c5c humkyung
        private Point RotatedPoint { get; set; } /// 2018.05.09 added by humkyung
194 0d00f9c8 humkyung
        private Point MouseDownPoint = new Point();
195
        private Point CurrentMousePoint = new Point();
196 787a4489 KangIngu
        #endregion
197
        #region 생성자
198
        private void RadDropDownButton_Loaded(object sender, RoutedEventArgs e)
199
        {
200
            dropData = sender as RadDropDownButton;
201
        }
202 4913851c humkyung
203 787a4489 KangIngu
        private void Date_Calendar_Loaded(object sender, RoutedEventArgs e)
204
        {
205
            dropCalendar = sender as RadCalendar;
206
            dropCalendar.SelectionChanged += (sen, ea) =>
207
            {
208
                dropData.IsOpen = false;
209 4913851c humkyung
                if ((this.Members.First() as AdornerMember).DrawingData.GetType().Name == "DateControl")
210 787a4489 KangIngu
                {
211 4913851c humkyung
                    DateControl data = (this.Members.First() as AdornerMember).DrawingData as DateControl;
212 787a4489 KangIngu
                    data.Text = dropCalendar.SelectedDate.Value.ToShortDateString();
213
                }
214
            };
215
        }
216 4913851c humkyung
217 787a4489 KangIngu
        public AdornerFinal()
218
        {
219
            InitializeComponent();
220
            BorderSize = new Rect();
221
            _dragData.Add(rotateTop, new DragData() { CursorAngle = 0, DragType = DragType.Rotate, RotateIsLeft = true, RotateIsTop = true });
222 4913851c humkyung
        }
223
224
        ~AdornerFinal()
225
        {
226
            this.Dispose(false);
227
        }
228
229
        public void Dispose()
230
        {
231
            this.Dispose(true);
232
            GC.SuppressFinalize(this);
233
        }
234
235
        protected virtual void Dispose(bool disposing)
236
        {
237
            if (this.disposed) return;
238
            if (disposing)
239
            {
240
                foreach (var member in this.Members)
241
                {
242
                    if(!Common.ViewerDataModel.Instance.MarkupControls_USER.Contains(member.DrawingData))
243
                        Common.ViewerDataModel.Instance.MarkupControls_USER.Add(member.DrawingData as CommentUserInfo);
244
                }
245
                // IDisposable 인터페이스를 구현하는 멤버들을 여기서 정리합니다.
246
            }
247
            // .NET Framework에 의하여 관리되지 않는 외부 리소스들을 여기서 정리합니다.
248
            this.disposed = true;
249 787a4489 KangIngu
        }
250
251
        void DragThumb_Loaded(object sender, RoutedEventArgs e)
252
        {
253
            mainDragThumb = DragThumb;
254
        }
255
256
        public AdornerFinal(CommentUserInfo objectData) : this()
257
        {
258
            InitializeComponent();
259
            objectData.IsHitTestVisible = false;
260 1305c420 taeseongkim
261 787a4489 KangIngu
            if ((objectData as ArrowTextControl) != null)
262
            {
263
                (objectData as ArrowTextControl).Base_TextBox.Focusable = true;
264
            }
265 1305c420 taeseongkim
266 787a4489 KangIngu
            Canvas.SetZIndex(objectData, 84);
267
            try
268
            {
269 05009a0e ljiyeon
                ViewerDataModel.Instance.MarkupControls_USER.Remove(objectData);
270 787a4489 KangIngu
                this.ContainerContent.Children.Add(objectData);
271
            }
272 1066bae3 ljiyeon
            catch (Exception ex)
273 787a4489 KangIngu
            {
274
275
            }
276 1066bae3 ljiyeon
           
277 787a4489 KangIngu
            SetAdornerMember(objectData as CommentUserInfo);
278
            this.Focus();
279
        }
280 4913851c humkyung
281 9b7cda70 KangIngu
        public AdornerFinal(List<CommentUserInfo> objectData) : this()
282 787a4489 KangIngu
        {
283
            InitializeComponent();
284
            foreach (var item in objectData)
285
            {
286
                //item.IsHitTestVisible = false;
287
                if ((item as ArrowTextControl) != null)
288
                {
289
                    (item as ArrowTextControl).Base_TextBox.Focusable = true;
290
                }
291
                try
292
                {
293 a0bab669 KangIngu
                    Canvas.SetZIndex(item, 80);
294 05009a0e ljiyeon
                    ViewerDataModel.Instance.MarkupControls_USER.Remove(item);
295 787a4489 KangIngu
                    this.ContainerContent.Children.Add(item);
296
                }
297 53880c83 ljiyeon
                catch //(Exception ex)
298 787a4489 KangIngu
                {
299
                }
300 1066bae3 ljiyeon
                finally
301
                {
302
                    
303
                }
304 787a4489 KangIngu
            }
305 4913851c humkyung
            this.SetAdornerMember(objectData);
306 787a4489 KangIngu
            this.Focus();
307
        }
308
309 62b6bcde humkyung
        public Point Centeroid
310
        {
311
            get
312
            {
313
                List<Point> pts = new List<Point>();
314
315
                #region 센터 포인트 구하기 (그룹핑)
316
                foreach (var item in this.Members)
317
                {
318
                    if (item.DrawingData.GetType().Name == "TextControl")
319
                    {
320
                        if (AngleValue == 0)
321
                        {
322 fa48eb85 taeseongkim
                            AngleValue = (item.DrawingData as TextControl).CommentAngle;
323 62b6bcde humkyung
                        }
324
                        double X = Canvas.GetLeft((item.DrawingData as TextControl));
325
                        double Y = Canvas.GetTop((item.DrawingData as TextControl));
326
                        pts.Add(new Point(X, Y));
327
                    }
328
                    else
329
                    {
330
                        pts.AddRange((item.DrawingData as IPath).PointSet);
331
                    }
332
                }
333
                #endregion
334
335
                return MathSet.FindCentroid(pts);
336
            }
337
        }
338
339 b643fcca taeseongkim
        #endregion
340
        #region 메서드
341
        public Rect getAdornerSize()
342 787a4489 KangIngu
        {
343
            return BorderSize;
344
        }
345
        public void addMemberControl(UIElement objectData)
346
        {
347
            this.ContainerContent.Children.Add(objectData);
348
            SetAdornerMember(objectData as CommentUserInfo);
349
            this.Focus();
350
        }
351 902faaea taeseongkim
352
        private void TextControlLostFocus(object sender,RoutedEventArgs e)
353
        {
354
            TextCompensation = false;
355
            BorderUpdate();
356
357
            if (sender is TextBox)
358
            {
359
                if ((sender as TextBox).Text == "") //보류
360
                {
361
                    this.ContainerContent.Children.Remove((sender as TextBox).Parent as MarkupToPDF.Common.CommentUserInfo);
362
                    this.Visibility = Visibility.Collapsed;
363
                }
364
            }
365
        }
366
367
        private void TextControlPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
368
        {
369 24c5e56c taeseongkim
            if (sender is TextControl)
370 902faaea taeseongkim
            {
371
                TextCompensation = true;
372
                BorderUpdate();
373
            }
374
        }
375
376
        private void TextControlSelectionChanged(object sender, RoutedEventArgs e)
377
        {
378
            BorderUpdate();
379
        }
380
381 3b797b23 humkyung
        
382
        private void ViewBoxRotate(UIElement member)
383
        {
384
            AdornerBorder.RenderTransformOrigin = new Point(0.5, 0.5);
385
            DragThumb.RenderTransformOrigin = new Point(0.5, 0.5);
386
            AdornerBorder.RenderTransform = new RotateTransform() { Angle = (member as IViewBox).CommentAngle };
387
            DragThumb.RenderTransform = new RotateTransform() { Angle = (member as IViewBox).CommentAngle };
388
        }
389
390 787a4489 KangIngu
        /// <summary>
391
        /// UIElement를 종류에 맞게 등록시킴
392
        /// </summary>
393
        /// <param name="member">UIElement 타입으로 BaseLayer에 있는 것들이 들어옵니다.</param>
394
        public void SetAdornerMember(MarkupToPDF.Common.CommentUserInfo member)
395 53880c83 ljiyeon
        {
396 787a4489 KangIngu
            switch (member.GetType().Name)
397
            {
398
                #region 컨트롤 조건
399 554aae3b humkyung
                case "LineControl":
400
                case "PolygonControl":
401 787a4489 KangIngu
                case "ArrowControl":
402 554aae3b humkyung
                case "ArcControl":
403
                case "ArrowArcControl":
404
                case "ArrowControl_Multi":
405
                case "RectangleControl":
406
                case "TriControl":
407
                case "CircleControl":
408
                case "CloudControl":
409
                case "RectCloudControl":
410
                case "InkControl":
411
                case "InsideWhiteControl":
412
                case "OverlapWhiteControl":
413
                case "ClipWhiteControl":
414
                case "CoordinateControl":
415
                    this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
416 e65e8c5c humkyung
                    _ActualAngle = AngleValue = member.CommentAngle;
417 787a4489 KangIngu
                    break;
418
                case "ArrowTextControl":
419 4913851c humkyung
                    this.Members.Add(new AdornerMember
420 53880c83 ljiyeon
                    {
421
                        DrawingData = member,
422
                        Drawingtype = ControlType.ArrowTextControl,
423 f513c215 humkyung
                        ThumbList = new List<MyThumb>(),
424 53880c83 ljiyeon
                        Symbol_ID = member.SymbolID,
425
                        Group_ID = member.GroupID,
426
                    });
427 787a4489 KangIngu
                    (member as ArrowTextControl).Base_TextBox.IsHitTestVisible = false;
428 e65e8c5c humkyung
                    _ActualAngle = AngleValue = (member as ArrowTextControl).CommentAngle;
429 902faaea taeseongkim
430
                    ((ArrowTextControl)member).Base_TextBox.LostFocus += TextControlLostFocus;
431 787a4489 KangIngu
                    break;
432 554aae3b humkyung
                case "ImgControl":
433 2d2252ba ljiyeon
                    this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
434 e65e8c5c humkyung
                    _ActualAngle = AngleValue = (member as ImgControl).CommentAngle;
435 2d2252ba ljiyeon
                    break;
436 787a4489 KangIngu
                case "DateControl":
437 2d2252ba ljiyeon
                    this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
438 e65e8c5c humkyung
                    _ActualAngle = AngleValue = (member as DateControl).CommentAngle;
439 2d2252ba ljiyeon
                    break;
440 787a4489 KangIngu
                case "SignControl":
441 2d2252ba ljiyeon
                    this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
442 e65e8c5c humkyung
                    _ActualAngle = AngleValue = (member as SignControl).CommentAngle;
443 2d2252ba ljiyeon
                    break;
444 787a4489 KangIngu
                case "SymControl":
445 2d2252ba ljiyeon
                    this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
446 e65e8c5c humkyung
                    _ActualAngle = AngleValue = (member as SymControl).CommentAngle;
447 2d2252ba ljiyeon
                    break;
448 787a4489 KangIngu
                case "SymControlN":
449 554aae3b humkyung
                    this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
450 e65e8c5c humkyung
                    _ActualAngle = AngleValue = (member as SymControlN).CommentAngle;
451 787a4489 KangIngu
                    break;
452
                case "TextControl":
453 f513c215 humkyung
                    this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.TextControl, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
454 787a4489 KangIngu
                    RectangleGeometry Data = new RectangleGeometry
455
                    {
456
                        Rect = new Rect()
457
                        {
458
                            X = Canvas.GetLeft((member as TextControl)),
459
                            Y = Canvas.GetTop((member as TextControl)),
460
                            Width = (member as TextControl).Base_TextBlock.ActualWidth / 2,
461
                            Height = (member as TextControl).Base_TextBlock.ActualHeight / 2,
462
                        }
463
                    };
464
                    Point endPointV = new Point(Data.Bounds.Right, Data.Bounds.Bottom);
465
                    Point middle = MathSet.getMiddlePoint((member as TextControl).StartPoint, endPointV);
466
467
468
                    DragThumb.RenderTransformOrigin = new Point(0.0, 0.0);
469
                    DragThumb.RenderTransform = new RotateTransform()
470
                    {
471 fa48eb85 taeseongkim
                        Angle = (member as TextControl).CommentAngle,
472 787a4489 KangIngu
                    };
473
474
                    AdornerBorder.RenderTransformOrigin = new Point(0.0, 0.0);
475
                    AdornerBorder.RenderTransform = new RotateTransform()
476
                    {
477 fa48eb85 taeseongkim
                        Angle = (member as TextControl).CommentAngle,
478 787a4489 KangIngu
                    };
479 902faaea taeseongkim
480
                    ((TextControl)member).PropertyChanged += TextControlPropertyChanged;
481
                    ((TextControl)member).Base_TextBox.LostFocus += TextControlLostFocus;
482 787a4489 KangIngu
                    break;
483
                default:
484
                    break;
485
                    #endregion
486
            }
487 554aae3b humkyung
488 787a4489 KangIngu
            if (member.GetType().Name == "TextControl")
489
            {
490
                TextControl content = ((TextControl)member);
491
                content.StartPoint = new Point(Canvas.GetLeft(content), Canvas.GetTop(content));
492
                content.EndPoint = content.StartPoint;
493
            }
494
            else
495
            {
496
                RegistryPoint(member);
497
            }
498
            BorderUpdate();
499 4913851c humkyung
500 ab7fe8c0 humkyung
            if (Common.ViewerDataModel.Instance.MarkupControls_USER.Contains(member))
501
                Common.ViewerDataModel.Instance.MarkupControls_USER.Remove(member);
502 787a4489 KangIngu
        }
503
504 4913851c humkyung
505 787a4489 KangIngu
        public void SetAdornerMember(List<CommentUserInfo> members)
506
        {
507
            foreach (var member in members)
508
            {
509
                switch (member.GetType().Name)
510
                {
511
                    #region 컨트롤 조건
512 53880c83 ljiyeon
                    case "LineControl":
513 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.SingleLine, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
514 53880c83 ljiyeon
                        break;
515
                    case "ImgControl":
516 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ImgControl, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
517 787a4489 KangIngu
                        break;
518
                    case "ArrowControl":
519 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArrowLine, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
520 787a4489 KangIngu
                        break;
521 53880c83 ljiyeon
                    case "PolygonControl":
522 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.PolygonControl, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
523 787a4489 KangIngu
                        break;
524
                    case "ArrowTextControl":
525 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArrowTextControl, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
526 787a4489 KangIngu
                        (member as ArrowTextControl).Base_TextBox.IsHitTestVisible = false;
527
                        break;
528
                    case "ArcControl":
529 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArcLine, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
530 787a4489 KangIngu
                        break;
531 40b3ce25 ljiyeon
                    case "ArrowArcControl":
532 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArcArrow, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
533 40b3ce25 ljiyeon
                        break;
534 787a4489 KangIngu
                    case "DateControl":
535 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Date, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
536 787a4489 KangIngu
                        break;
537
                    case "ArrowControl_Multi":
538 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArrowMultiLine, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
539 787a4489 KangIngu
                        break;
540
                    case "RectangleControl":
541 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Rectangle, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
542 787a4489 KangIngu
                        break;
543
                    case "TriControl":
544 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Triangle, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
545 787a4489 KangIngu
                        break;
546
                    case "CircleControl":
547 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Circle, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
548 787a4489 KangIngu
                        break;
549
                    case "CloudControl":
550 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.PolygonCloud, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
551 787a4489 KangIngu
                        break;
552
                    case "RectCloudControl":
553 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.RectCloud, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
554 787a4489 KangIngu
                        break;
555
                    case "SignControl":
556 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Sign, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
557 787a4489 KangIngu
                        break;
558
                    case "SymControl":
559 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Symbol, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
560 787a4489 KangIngu
                        break;
561
                    case "SymControlN":
562 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Stamp, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
563 787a4489 KangIngu
                        break;
564 53880c83 ljiyeon
                    case "InkControl":
565 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Ink, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
566 787a4489 KangIngu
                        break;
567
                    case "TextControl":
568 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.TextControl, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
569 787a4489 KangIngu
570 902faaea taeseongkim
                        (member as TextControl).PropertyChanged += TextControlPropertyChanged;
571
                        (member as TextControl).Base_TextBox.SelectionChanged += TextControlSelectionChanged;
572
573
                        //Observable.FromEventPattern(((TextControl)member).Base_TextBox, "SelectionChanged").Subscribe(a =>
574
                        //{
575
                        //    BorderUpdate();
576
                        //});
577
                        //Observable.FromEventPattern(((TextControl)member), "PropertyChanged").Subscribe(a =>
578
                        //{
579
                        //    BorderUpdate();
580
                        //    try
581
                        //    {
582
                        //        ((TextControl)member).Base_TextBlock.TextDecorations = ((TextControl)member).UnderLine; 
583
                        //    }
584
                        //    catch (Exception)
585
                        //    {
586
587
                        //    }
588
589
                        //});
590
                        //Observable.FromEventPattern(((TextControl)member).Base_TextBox, "SelectionChanged").Subscribe(a =>
591
                        //{
592
                        //    BorderUpdate();
593
                        //});
594 787a4489 KangIngu
                        break;
595 684ef11c ljiyeon
                    case "InsideWhiteControl":
596 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.InsideWhite, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
597 684ef11c ljiyeon
                        break;
598
                    case "OverlapWhiteControl":
599 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.OverlapWhite, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
600 684ef11c ljiyeon
                        break;
601
                    case "ClipWhiteControl":
602 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ClipWhite, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
603 684ef11c ljiyeon
                        break;
604
                    case "CoordinateControl":
605 f513c215 humkyung
                        this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Coordinate, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID });
606 684ef11c ljiyeon
                        break;
607 787a4489 KangIngu
                    default:
608
                        break;
609
                        #endregion
610
                }
611
                if (member.GetType().Name == "TextControl")
612
                {
613
                    TextControl content = ((TextControl)member);
614
                    content.StartPoint = new Point(Canvas.GetLeft(content), Canvas.GetTop(content));
615
                    content.EndPoint = content.StartPoint;
616
                }
617
                else
618
                {
619
                    RegistryPoint(member, members.Count);
620
                }
621 4913851c humkyung
622 ab7fe8c0 humkyung
                if (Common.ViewerDataModel.Instance.MarkupControls_USER.Contains(member))
623
                    Common.ViewerDataModel.Instance.MarkupControls_USER.Remove(member); /// remove commment from mycontrols
624 787a4489 KangIngu
            }
625
626
            BorderUpdate();
627
        }
628
629 902faaea taeseongkim
630 787a4489 KangIngu
        /// <summary>
631
        /// Border 를 갱신
632
        /// </summary>
633
        public void BorderUpdate()
634
        {
635
            AdornerBorder.MinWidth = 10;
636
            AdornerBorder.MinHeight = 10;
637
638 992a98b4 KangIngu
            double minX = double.MaxValue;
639
            double minY = double.MaxValue;
640
            double maxX = double.MinValue;
641 a7bd032b 이지연
            double maxY = double.MinValue; 
642
            double LineSize = 0;
643 4913851c humkyung
            if (this.Members.Count == 1)
644 787a4489 KangIngu
            {
645 3b797b23 humkyung
                if (this.Members[0].DrawingData.GetType().Name == "TextControl")
646 787a4489 KangIngu
                {
647 3b797b23 humkyung
                    if ((this.Members[0].DrawingData as TextControl).CommentAngle != 0)
648 787a4489 KangIngu
                    {
649 3b797b23 humkyung
                        trRotate.Angle = (this.Members[0].DrawingData as TextControl).CommentAngle;
650
                        trRotateThumb.Angle = (this.Members[0].DrawingData as TextControl).CommentAngle;
651 787a4489 KangIngu
                    }
652
                    else
653
                    {
654
                        trRotate.Angle = 0;
655
                        trRotateThumb.Angle = 0;
656
                    }
657
                }
658
            }
659 3b797b23 humkyung
660 4913851c humkyung
            foreach (var item in this.Members)
661 787a4489 KangIngu
            {
662
                UIElement currentControl = (item as AdornerMember).DrawingData;
663 a7bd032b 이지연
                
664 b643fcca taeseongkim
                Point startP = (currentControl as IPath).StartPoint;
665
                Point endP = (currentControl as IPath).EndPoint;
666
667 902faaea taeseongkim
                // ViewerDataModel.Instance.Angle = MathSet.returnAngle(startP, ref endP, ViewerDataModel.Instance.IsPressShift);
668
669
                // 컨트롤의 angle변환시 상단 anglecontrol에 출력
670 4f017ed3 taeseongkim
                ViewerDataModel.Instance.MarkupAngle = (currentControl as CommentUserInfo).CommentAngle;
671 b643fcca taeseongkim
672 787a4489 KangIngu
                if (item.DrawingData.GetType().Name == "TextControl")
673
                {
674
                    double textControlWidth;
675
                    double textControlHeight;
676 fa48eb85 taeseongkim
677 787a4489 KangIngu
                    if (((currentControl as TextControl).Base_TextBox.ActualWidth) == 0)
678
                    {
679
                        textControlWidth = ((currentControl as TextControl).Base_TextBlock.ActualWidth);
680
                        textControlHeight = ((currentControl as TextControl).Base_TextBlock.ActualHeight);
681
                    }
682
                    else
683
                    {
684
                        textControlWidth = ((currentControl as TextControl).Base_TextBox.ActualWidth);
685
                        textControlHeight = ((currentControl as TextControl).Base_TextBox.ActualHeight);
686
                    }
687 29010418 ljiyeon
                    
688 787a4489 KangIngu
                    if ((currentControl as TextControl).EndPoint.X < minX)
689
                    {
690
                        minX = (currentControl as TextControl).EndPoint.X;
691
                    }
692 fa48eb85 taeseongkim
693 787a4489 KangIngu
                    if ((currentControl as TextControl).EndPoint.Y < minY)
694
                    {
695
                        minY = (currentControl as TextControl).EndPoint.Y;
696
                    }
697 fa48eb85 taeseongkim
698 787a4489 KangIngu
                    if (textControlWidth + (currentControl as TextControl).EndPoint.X > maxX)
699
                    {
700
                        maxX = textControlWidth + (currentControl as TextControl).EndPoint.X;
701
                    }
702 fa48eb85 taeseongkim
703 787a4489 KangIngu
                    if (textControlHeight + (currentControl as TextControl).EndPoint.Y > maxY)
704
                    {
705
                        maxY = textControlHeight + (currentControl as TextControl).EndPoint.Y;
706
                    }
707
                }
708
                else if ((currentControl as IViewBox) != null)
709
                {
710
                    IViewBox instance = currentControl as IViewBox;
711
                    List<Point> am = (currentControl as IPath).PointSet;
712
                    List<double> xSet = am.Select(p => p.X).ToList();
713
                    List<double> ySet = am.Select(p => p.Y).ToList();
714
                    if (xSet.Min() < minX) minX = xSet.Min();
715
                    if (ySet.Min() < minY) minY = ySet.Min();
716
                    if (xSet.Max() > maxX) maxX = xSet.Max();
717
                    if (ySet.Max() > maxY) maxY = ySet.Max();
718
                }
719
                else if ((currentControl as IPath).PathData == null)
720
                {
721
                    Rect rt = new Rect
722
                    {
723
                        X = (currentControl as IPath).StartPoint.X,
724
                        Y = (currentControl as IPath).StartPoint.Y,
725
                        Width = Math.Max((currentControl as IPath).EndPoint.X, (currentControl as IPath).StartPoint.X) - Math.Min((currentControl as IPath).EndPoint.X, (currentControl as IPath).StartPoint.X),
726
                        Height = Math.Max((currentControl as IPath).EndPoint.Y, (currentControl as IPath).StartPoint.Y) - Math.Min((currentControl as IPath).EndPoint.Y, (currentControl as IPath).StartPoint.Y),
727
                    };
728
                    if (rt.Left < minX) minX = rt.Left;
729
                    if (rt.Top < minY) minY = rt.Top;
730
                    if (rt.Right > maxX) maxX = rt.Right;
731
                    if (rt.Bottom > maxY) maxY = rt.Bottom;
732
                }
733
                else if ((currentControl as IPath) == null)
734
                {
735
                    Rect rt = new Rect
736
                    {
737
                        X = (currentControl as IPath).StartPoint.X,
738
                        Y = (currentControl as IPath).StartPoint.Y,
739
                        Width = (currentControl as IPath).EndPoint.X - (currentControl as IPath).StartPoint.X,
740
                        Height = (currentControl as IPath).EndPoint.Y - (currentControl as IPath).StartPoint.Y
741
                    };
742
                    if (rt.Left < minX) minX = rt.Left;
743
                    if (rt.Top < minY) minY = rt.Top;
744
                    if (rt.Right > maxX) maxX = rt.Right;
745
                    if (rt.Bottom > maxY) maxY = rt.Bottom;
746
                }
747 3b797b23 humkyung
                else if (currentControl is CircleControl CircleCtrl)
748
                {
749
                    List<Point> am = CircleCtrl.PointSet;
750 a7bd032b 이지연
                    LineSize = CircleCtrl.LineSize;
751 3b797b23 humkyung
                    minX = am.Min(x => x.X);
752
                    minY = am.Min(x => x.Y);
753
                    maxX = am.Max(x => x.X);
754
                    maxY = am.Max(x => x.Y);
755 787a4489 KangIngu
                }
756 a7bd032b 이지연
                else 
757 787a4489 KangIngu
                {
758 b79d6e7f humkyung
                    if(item.DrawingData.GetType().Name == "TriControl")
759
                        LineSize = ((MarkupToPDF.Controls.Shape.TriControl)currentControl).LineSize;
760
                    else if(item.DrawingData.GetType().Name == "RectangleControl")
761
                        LineSize = ((MarkupToPDF.Controls.Shape.RectangleControl)currentControl).LineSize;
762
                    else if (item.DrawingData.GetType().Name == "RectCloudControl")
763
                        LineSize = ((MarkupToPDF.Controls.Shape.RectCloudControl)currentControl).LineSize;
764
                    else if (item.DrawingData.GetType().Name == "CloudControl")
765
                        LineSize = ((MarkupToPDF.Controls.Polygon.CloudControl)currentControl).LineSize;
766
                    else if (item.DrawingData.GetType().Name == "PolygonControl")
767
                        LineSize = ((MarkupToPDF.Controls.Polygon.PolygonControl)currentControl).LineSize;
768 a7bd032b 이지연
769 787a4489 KangIngu
                    if ((currentControl as IPath).PathData.Bounds.Left < minX) minX = (currentControl as IPath).PathData.Bounds.Left;
770
                    if ((currentControl as IPath).PathData.Bounds.Top < minY) minY = (currentControl as IPath).PathData.Bounds.Top;
771
                    if ((currentControl as IPath).PathData.Bounds.Right > maxX) maxX = (currentControl as IPath).PathData.Bounds.Right;
772
                    if ((currentControl as IPath).PathData.Bounds.Bottom > maxY) maxY = (currentControl as IPath).PathData.Bounds.Bottom;
773
                }
774
            }
775
776
            Rect ac = new Rect(minX, minY, maxX - minX, maxY - minY);
777
            bool addWidthSize = false;
778
            bool addHeightSize = false;
779
            if (ac.Width <= 10)
780
            {
781
                ac.Width += 10;
782
                addWidthSize = true;
783
            }
784
            if (ac.Height <= 10)
785
            {
786
                ac.Height += 10;
787
                addHeightSize = true;
788
            }
789
            BorderSize = ac;
790 a7bd032b 이지연
            ac.Width += LineSize;
791
            ac.Height += LineSize;
792 787a4489 KangIngu
            AdornerBorder.MinWidth = 10;
793
            AdornerBorder.MinHeight = 10;
794
            AdornerBorder.Width = ac.Width;
795
            AdornerBorder.Height = ac.Height;
796 a7bd032b 이지연
797
            minX -= LineSize / 2;
798
            minY -= LineSize / 2;
799 787a4489 KangIngu
            Canvas.SetLeft(AdornerBorder, minX);
800
            Canvas.SetTop(AdornerBorder, minY);
801
802
            DragThumb.Width = ac.Width;
803
            DragThumb.Height = ac.Height;
804
805
            DragThumb.MinWidth = 10;
806
            DragThumb.MinHeight = 10;
807
            if (addWidthSize)
808
            {
809
                Canvas.SetLeft(DragThumb, minX - 5);
810
            }
811
            else
812
            {
813
                Canvas.SetLeft(DragThumb, minX);
814
            }
815
816
            if (addHeightSize)
817
            {
818
                Canvas.SetTop(DragThumb, minY - 5);
819
            }
820
            else
821
            {
822
                Canvas.SetTop(DragThumb, minY);
823
            }
824
        }
825 3b797b23 humkyung
826 787a4489 KangIngu
        /// <summary>
827
        /// UIElement 해제
828
        /// </summary>
829
        public void unRegister()
830
        {
831
            foreach (var item in this.ContainerContent.Children)
832
            {
833
                if (item is MarkupToPDF.Common.CommentUserInfo)
834
                {
835
                    (item as MarkupToPDF.Common.CommentUserInfo).IsHitTestVisible = true;
836
                }
837
            }
838
            this.ContainerContent.Children.Clear();
839
        }
840 f513c215 humkyung
841 787a4489 KangIngu
        /// <summary>
842
        /// 각 포인트들을 등록합니다.
843
        /// </summary>
844
        /// <param name="pointset">Drawing Point</param>
845
        public void RegistryPoint(CommentUserInfo member, int cnt = 1)
846 53880c83 ljiyeon
        {
847 787a4489 KangIngu
            int count = 0;
848 e65e8c5c humkyung
            List<Point> pts = (member as IPath).PointSet;
849 787a4489 KangIngu
            if (member.GetType().Name == "InkControl")
850
            {
851 e65e8c5c humkyung
                pts.Clear();
852
                pts.Add(new Point((member as IPath).PathData.Bounds.X, (member as IPath).PathData.Bounds.Y));
853
                pts.Add(new Point((member as IPath).PathData.Bounds.Left, (member as IPath).PathData.Bounds.Bottom));
854
                pts.Add(new Point((member as IPath).PathData.Bounds.Right, (member as IPath).PathData.Bounds.Bottom));
855
                pts.Add(new Point((member as IPath).PathData.Bounds.Right, (member as IPath).PathData.Bounds.Top));
856 787a4489 KangIngu
            }
857 3b797b23 humkyung
            ControlType markT = this.Members.First(p => p.DrawingData == member).Drawingtype;
858 e65e8c5c humkyung
            double Minx = pts.Min(x => x.X);
859
            double Miny = pts.Min(x => x.Y);
860 3b797b23 humkyung
861 e65e8c5c humkyung
            for (int i = 0; i < pts.Count; i++)
862 787a4489 KangIngu
            {
863 f513c215 humkyung
                MyThumb tm = new MyThumb
864 787a4489 KangIngu
                {
865
                    Style = (Style)this.LayoutRoot.Resources["ThumbResizeStyle"],
866
                };
867
868 4913851c humkyung
                this.Members.Last().ThumbList.Add(tm);
869 29010418 ljiyeon
870 e65e8c5c humkyung
                if ((markT == ControlType.ArcLine && pts[i] == (member as ArcControl).MidPoint) || (markT == ControlType.ArcArrow && pts[i] == (member as ArrowArcControl).MiddlePoint))
871 787a4489 KangIngu
                {
872
                    tm.Style = (Style)this.LayoutRoot.Resources["ThumbArcControlStyle"];
873
                }
874
                if (member.GetType().Name == "ArrowTextControl" && i == 1)
875
                {
876 4913851c humkyung
                    //if (this.Members.Count()<=1)
877 787a4489 KangIngu
                    //{
878
                    tm.Style = (Style)this.LayoutRoot.Resources["ThumbArcControlStyle"];
879
                    List<Point> ps = new List<Point>();
880
881 4913851c humkyung
                    if ((this.Members.First() as AdornerMember).DrawingData as ArrowTextControl != null)
882 787a4489 KangIngu
                    {
883 4913851c humkyung
                        var temp = (this.Members.First() as AdornerMember).DrawingData as ArrowTextControl;
884 787a4489 KangIngu
885 fa48eb85 taeseongkim
                        switch (Math.Abs(temp.CommentAngle).ToString())
886 787a4489 KangIngu
                        {
887
                            case "90":
888
                                {
889
                                    ps.Clear();
890
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox))); //위 왼쪽
891
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) - temp.BoxWidth / 2)); // 위 중간
892
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) - temp.BoxWidth)); // 위 오른쪽
893
894
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxHeight / 2, Canvas.GetTop(temp.Base_TextBox))); //왼쪽 중간
895
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox))); //왼쪽 하단
896
897
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox) - temp.BoxWidth / 2)); //중간 하단
898
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox) - temp.BoxWidth)); //오른쪽 하단
899
900
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxHeight / 2, Canvas.GetTop(temp.Base_TextBox) - temp.BoxWidth)); //오른쪽 중간
901
                                }
902
                                break;
903
                            case "270":
904
                                {
905
                                    ps.Clear();
906
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox))); //위 왼쪽
907
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) + temp.BoxWidth / 2)); // 위 중간
908
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) + temp.BoxWidth)); // 위 오른쪽
909
910
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) - temp.BoxHeight / 2, Canvas.GetTop(temp.Base_TextBox))); //왼쪽 중간
911
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) - temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox))); //왼쪽 하단
912
913
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) - temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox) + temp.BoxWidth / 2)); //중간 하단
914
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) - temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox) + temp.BoxWidth)); //오른쪽 하단
915
916
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) - temp.BoxHeight / 2, Canvas.GetTop(temp.Base_TextBox) + temp.BoxWidth)); //오른쪽 중간
917
                                }
918
                                break;
919
                            default:
920
                                {
921
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth / 2, Canvas.GetTop(temp.Base_TextBox))); //상단
922
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth / 2, Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight)); // 하단
923
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight / 2)); //좌단
924
                                    ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth, Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight / 2));  //우단
925
                                }
926
                                break;
927
                        }
928
929
                        ArrowTextControl instance = (member as ArrowTextControl);
930
                        if (instance.isTrans)
931
                        {
932
                            //var endP = MathSet.getNearPoint(ps, temp.MidPoint);
933
                            //var tempP = MathSet.getMiddlePoint(temp.StartPoint, endP);
934
                            //list[count] = tempP;
935 e65e8c5c humkyung
                            pts[count] = temp.MidPoint;
936 787a4489 KangIngu
                        }
937
                        else
938
                        {
939
                            if (temp.isFixed)
940
                            {
941
                                var endP = MathSet.getNearPoint(ps, temp.MidPoint);
942
                                var testP = endP;
943
                                if (ps[0] == endP) //상단
944
                                {
945
                                    testP = new Point(endP.X, endP.Y - 50);
946
                                }
947
                                else if (ps[1] == endP) //하단
948
                                {
949
                                    testP = new Point(endP.X, endP.Y + 50);
950
                                }
951
                                else if (ps[2] == endP) //좌단
952
                                {
953
                                    testP = new Point(endP.X - 50, endP.Y);
954
                                }
955
                                else if (ps[3] == endP) //우단
956
                                {
957
                                    testP = new Point(endP.X + 50, endP.Y);
958
                                }
959 e65e8c5c humkyung
                                pts[count] = testP;
960 787a4489 KangIngu
                            }
961
                            else
962
                            {
963
                                var endP = MathSet.getNearPoint(ps, instance.MidPoint);
964 e65e8c5c humkyung
                                pts[count] = MathSet.getMiddlePoint(instance.StartPoint, endP);
965 787a4489 KangIngu
                            }
966
                        }
967
                    }
968
                }
969 39f208de taeseongkim
970
                /// ArrowTextControl text box 화면 출력
971 e65e8c5c humkyung
                if (member.GetType().Name == "ArrowTextControl" && pts[i] == pts.Last())
972 787a4489 KangIngu
                {
973
                    tm.Style = (Style)this.LayoutRoot.Resources["ThumbTextStyle"];
974
                    tm.Width = (member as ArrowTextControl).BoxWidth;
975
                    tm.Height = (member as ArrowTextControl).BoxHeight;
976 fa48eb85 taeseongkim
                    var angle = (member as ArrowTextControl).PageAngle;
977 787a4489 KangIngu
                    if (Math.Abs(angle).ToString() == "90")
978
                    {
979
                        tm.RenderTransformOrigin = new Point(0, 0);
980
                        tm.RenderTransform = new RotateTransform { Angle = 270 };
981
                    }
982
                    else if (Math.Abs(angle).ToString() == "270")
983
                    {
984
                        tm.RenderTransformOrigin = new Point(0, 0);
985
                        tm.RenderTransform = new RotateTransform { Angle = 90 };
986
                    }
987
                    else
988
                    {
989
                        tm.RenderTransformOrigin = new Point(0.5, 0.5);
990
                        tm.RenderTransform = new RotateTransform()
991
                        {
992 fa48eb85 taeseongkim
                            Angle = angle
993 787a4489 KangIngu
                        };
994
                    }
995
                }
996 29010418 ljiyeon
                
997 787a4489 KangIngu
                if (member.GetType().Name == "CloudControl")
998
                {
999 e65e8c5c humkyung
                    if (i == pts.Count() - 1)
1000 787a4489 KangIngu
                    {
1001
                        tm.Visibility = System.Windows.Visibility.Collapsed;
1002
                    }
1003
                }
1004
                if (member.GetType().Name == "PolygonControl")
1005
                {
1006 e65e8c5c humkyung
                    if (i == pts.Count() - 1)
1007 787a4489 KangIngu
                    {
1008
                        if ((member as PolygonControl).ControlType == ControlType.ChainLine)
1009
                        {
1010
1011
                        }
1012
                        else
1013
                        {
1014
                            tm.Visibility = System.Windows.Visibility.Collapsed;
1015
                        }
1016
                    }
1017
                    if ((member as PolygonControl).ControlType == ControlType.Ink)
1018
                    {
1019
                        tm.Visibility = System.Windows.Visibility.Collapsed;
1020
                    }
1021
                }
1022 29010418 ljiyeon
                
1023 787a4489 KangIngu
                this.ContainerContent.Children.Add(tm);
1024 e65e8c5c humkyung
                Canvas.SetLeft(tm, pts[count].X);
1025
                Canvas.SetTop(tm, pts[count].Y);
1026
                if (member.GetType().Name == "ArrowTextControl" && pts[i] == (member as ArrowTextControl).MidPoint)
1027 787a4489 KangIngu
                {
1028
                    Canvas.SetZIndex(tm, 95);
1029 1b2cf911 taeseongkim
                    //tm.Opacity = 0;
1030 3dbace4e taeseongkim
                    tm.DragDelta += MidPoint_DragDelta;
1031 787a4489 KangIngu
                }
1032
                else
1033
                {
1034 3dbace4e taeseongkim
                    tm.DragDelta += ResizeTm_DragDelta;
1035 787a4489 KangIngu
                    Canvas.SetZIndex(tm, 99);
1036
                }
1037
1038
                tm.DragStarted += new DragStartedEventHandler(tm_DragStarted);
1039
                tm.DragCompleted += new DragCompletedEventHandler(tm_DragCompleted);
1040 3dbace4e taeseongkim
                
1041 787a4489 KangIngu
                tm.MouseMove += new MouseEventHandler(resize_MouseMove);
1042
                count++;
1043
            }
1044
        }
1045
1046 3dbace4e taeseongkim
        private void MidPoint_DragDelta(object sender, DragDeltaEventArgs e)
1047
        {
1048
            MyThumb thumb = sender as MyThumb;
1049
            double newHorizontalChange = e.HorizontalChange;
1050
            double newVerticalChange = e.VerticalChange;
1051
1052 41c4405e taeseongkim
            var newpoint = MathHelper.RotatePoint(new Point(newHorizontalChange, newVerticalChange), new Point(), 0);// commentInfo.VisualPageAngle);
1053 3dbace4e taeseongkim
1054
            var direction = VisualHelper.GetPointDirection(newpoint, ViewerDataModel.Instance.PageAngle);
1055
1056
            System.Diagnostics.Debug.WriteLine("뱡향 : " + direction.ToString());
1057
1058
            AdornerMember control = CurrentAdornerMember(thumb);
1059
            var commentInfo = (control.DrawingData) as CommentUserInfo;
1060
1061
            if (commentInfo is ArrowTextControl)
1062
            {
1063
                Point getThumbPoint = GetPosition(thumb);
1064
1065
                var arrowText = commentInfo as ArrowTextControl;
1066
1067
                //var midPoint = MathSet.getMiddlePoint(arrowText.StartPoint, arrowText.EndPoint);
1068
                //arrowText.MidPoint = newpoint;
1069
                thumb.Translate(newpoint.X, newpoint.Y, this.AngleValue);
1070 41c4405e taeseongkim
          
1071 3dbace4e taeseongkim
                commentInfo.OnMoveCtrlPoint(getThumbPoint, newpoint.X, newpoint.Y, ViewerDataModel.Instance.IsAxisLock || ViewerDataModel.Instance.IsPressShift);
1072
1073
                control.UpdateThumb();
1074
1075
                System.Diagnostics.Debug.WriteLine($"text {Canvas.GetLeft(arrowText.Base_TextBox)},{Canvas.GetTop(arrowText.Base_TextBox)}");
1076
1077
                System.Diagnostics.Debug.WriteLine($"Page Angle : {ViewerDataModel.Instance.PageAngle} GetPoint : {getThumbPoint.X},{getThumbPoint.Y}  Change Value : {newpoint.X},{newpoint.Y}");
1078
            }
1079
1080
        }
1081
        
1082
1083 ab7fe8c0 humkyung
        /// <summary>
1084
        /// 제어점을 조정하여 크기를 수정한다.
1085
        /// </summary>
1086
        /// <param name="sender"></param>
1087
        /// <param name="e"></param>
1088 787a4489 KangIngu
        private void ResizeTm_DragDelta(object sender, DragDeltaEventArgs e)
1089
        {
1090 7bb40d38 taeseongkim
            if (sender.GetType() != typeof(MyThumb)) return;
1091
1092
            MyThumb thumb = sender as MyThumb;
1093
1094 d2114d3b humkyung
            if (this.Members.Count > 1) return;
1095 7bb40d38 taeseongkim
1096
            System.Diagnostics.Debug.WriteLine($"Value {e.HorizontalChange},{e.VerticalChange}");
1097
1098
            double newHorizontalChange = e.HorizontalChange;
1099
            double newVerticalChange = e.VerticalChange;
1100
1101 39f208de taeseongkim
            //if (reSizePoint != new Point(0, 0))
1102
            //{
1103 15bbef90 taeseongkim
                //Point setPoint = Mouse.GetPosition(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanCanvas);
1104
1105 39f208de taeseongkim
                Point setPoint = GetPosition(thumb);
1106 8de55603 taeseongkim
1107
                //System.Diagnostics.Debug.WriteLine($"1. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}  Change Value : {newHorizontalChange},{newVerticalChange}");
1108 15bbef90 taeseongkim
1109 8de55603 taeseongkim
                AdornerMember control = CurrentAdornerMember(thumb);
1110
                var commentInfo = (control.DrawingData) as CommentUserInfo;
1111 15bbef90 taeseongkim
1112 39f208de taeseongkim
                double ratatePointAngle = 0;
1113 233ef333 taeseongkim
1114 39f208de taeseongkim
                if (commentInfo is ArrowTextControl)
1115 8de55603 taeseongkim
                {
1116 39f208de taeseongkim
                    var textControl = (commentInfo as ArrowTextControl);
1117 233ef333 taeseongkim
1118 39f208de taeseongkim
                    if (textControl.EndPoint == MathSet.getNearPoint(textControl.PointSet, setPoint)) //(textControl.MidPoint == MathSet.getNearPoint(textControl.PointSet,setPoint) ||
1119
1120
                    {
1121 3dbace4e taeseongkim
                        textControl.CommentAngle = 0;
1122
                        this.AngleValue = 0;
1123
                        ratatePointAngle = commentInfo.VisualPageAngle;
1124 39f208de taeseongkim
                    }
1125
                    else
1126 41c4405e taeseongkim
                    {   
1127 39f208de taeseongkim
                        //textControl.CommentAngle = commentInfo.VisualPageAngle + MathSet.returnAngle(textControl.StartPoint, ref tempPoint, ViewerDataModel.Instance.IsPressShift);
1128 41c4405e taeseongkim
                        textControl.OnCreatingMouseMove(textControl.EndPoint, ViewerDataModel.Instance.IsPressShift);
1129 39f208de taeseongkim
                        this.AngleValue = textControl.CommentAngle;
1130
                        commentInfo.CommentAngle = this.AngleValue;
1131
                    }
1132
                        //CommentAngle = MathSet.returnAngle(this.StartPoint, ref tempPoint, bAxisLocked);
1133 8de55603 taeseongkim
                }
1134 39f208de taeseongkim
                System.Diagnostics.Debug.WriteLine("## Angle : " + this.AngleValue + " ##");
1135
                thumb.Translate(newHorizontalChange, newVerticalChange, this.AngleValue);
1136
1137
                // 페이지회전에 따른 화살표텍스트 박스의 이동 수정
1138 43e1d368 taeseongkim
1139 39f208de taeseongkim
                var newpoint = MathHelper.RotatePoint(new Point(newHorizontalChange, newVerticalChange), new Point(), ratatePointAngle);// commentInfo.VisualPageAngle);
1140
     
1141
                Point thumbPoint = MathHelper.RotatePoint(setPoint, new Point(), ratatePointAngle);// commentInfo.VisualPageAngle);
1142
1143
                //thumbPoint.X = Math.Abs(thumbPoint.X);
1144
                //thumbPoint.Y = Math.Abs(thumbPoint.Y);
1145
1146
                //if ((setPoint.X + newpoint.X) < 0 || (Math.Abs(thumbPoint.X) + newpoint.X) - ViewerDataModel.Instance.ImageViewWidth > 0)
1147
                //{
1148
                //    newpoint.X = 0;
1149
                //}
1150
1151
                //if (setPoint.Y + newpoint.Y < 0 || (Math.Abs(thumbPoint.Y) + newpoint.Y) - ViewerDataModel.Instance.ImageViewHeight > 0)
1152
                //{
1153
                //    newpoint.Y = 0;
1154
                //}
1155 8de55603 taeseongkim
1156
                commentInfo.OnMoveCtrlPoint(setPoint, newpoint.X, newpoint.Y, ViewerDataModel.Instance.IsAxisLock || ViewerDataModel.Instance.IsPressShift);
1157
1158
                //System.Diagnostics.Debug.WriteLine($"3. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}");
1159 508c3ac5 humkyung
                control.UpdateThumb();
1160 15bbef90 taeseongkim
1161 8de55603 taeseongkim
                //System.Diagnostics.Debug.WriteLine($"4. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}");
1162 508c3ac5 humkyung
                this.BorderUpdate();
1163 15bbef90 taeseongkim
1164 8de55603 taeseongkim
               //System.Diagnostics.Debug.WriteLine($"5. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}");
1165 39f208de taeseongkim
            //}
1166 8de55603 taeseongkim
        }
1167
1168
        private AdornerMember CurrentAdornerMember(MyThumb thumb)
1169
        {
1170
            AdornerMember result = null;
1171
1172
            try
1173
            {
1174
                result = (from userThumb in this.Members
1175
                            where userThumb.ThumbList.Contains(thumb)
1176
                            select userThumb).FirstOrDefault();
1177
            }
1178
            catch (Exception ex)
1179
            {
1180
                App.FileLogger.Error(ex);
1181 787a4489 KangIngu
            }
1182 8de55603 taeseongkim
1183
            return result;
1184 787a4489 KangIngu
        }
1185
1186 15bbef90 taeseongkim
        private Point GetPosition(Thumb thumb)
1187
        {
1188
            return new Point(Canvas.GetLeft(thumb), Canvas.GetTop(thumb));
1189
        }
1190
1191 787a4489 KangIngu
        #endregion
1192
        #region 이벤트
1193
1194
        void tm_DragCompleted(object sender, DragCompletedEventArgs e)
1195
        {
1196
            this.isDragging = false;
1197
            DraggerThumb = null;
1198
1199 fd452a01 swate0609
1200 4913851c humkyung
            var comments = (from drawing in this.Members
1201 d128ceb2 humkyung
                            select drawing.DrawingData as CommentUserInfo).ToList();
1202 e5bd2147 swate0609
            //UndoCommand.Instance.Push(comments, this.AngleValue, 0, lstPointTemp);
1203 26ec6226 taeseongkim
            ViewerDataModel.Instance.IsMarkupUpdate = true;
1204 787a4489 KangIngu
        }
1205
1206 ec052e41 humkyung
        /// <summary>
1207
        /// start drag
1208
        /// </summary>
1209
        /// <param name="sender"></param>
1210
        /// <param name="e"></param>
1211 787a4489 KangIngu
        void tm_DragStarted(object sender, DragStartedEventArgs e)
1212
        {
1213
            this.DraggerThumb = sender as Thumb;
1214
            this.isDragging = true;
1215
1216
            if (ViewerDataModel.Instance.UndoDataList == null)
1217
            {
1218
                return;
1219
            }
1220
1221 e5bd2147 swate0609
            
1222 873011c4 humkyung
            //if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Event == EventType.Thumb))
1223 e5bd2147 swate0609
            //{
1224
            //    return;
1225
            //}
1226 787a4489 KangIngu
1227 873011c4 humkyung
            //if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().MarkupDataColl != null))
1228 e5bd2147 swate0609
            //{
1229 873011c4 humkyung
            //    if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().MarkupDataColl.Count > 0)
1230 e5bd2147 swate0609
            //    {
1231 873011c4 humkyung
            //        if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().MarkupDataColl.FirstOrDefault().PointSet != null)
1232 e5bd2147 swate0609
            //        {
1233
            //            return;
1234
            //        }
1235
            //    }
1236
            //}
1237 787a4489 KangIngu
1238 4913851c humkyung
            var comments = (from drawing in this.Members
1239 d128ceb2 humkyung
                            select drawing.DrawingData as CommentUserInfo).ToList();
1240 e5bd2147 swate0609
            //UndoCommand.Instance.Push(comments, this.AngleValue, 0, lstBeforePointSet);
1241
            UndoCommand.Instance.Push(comments);
1242 787a4489 KangIngu
        }
1243
1244
        private void rotate_MouseMove(object sender, MouseEventArgs e)
1245
        {
1246 4913851c humkyung
            if ((this.Members.First() as AdornerMember).DrawingData.GetType().Name == "TextControl")
1247 787a4489 KangIngu
            {
1248
                if (LastRotateVerticalValue < e.GetPosition(this).X)
1249
                    IsTextAngle = true;
1250
                else
1251
                    IsTextAngle = false;
1252
                LastRotateVerticalValue = e.GetPosition(this).X;
1253
            }
1254 9f473fb7 KangIngu
            else
1255 53880c83 ljiyeon
            {
1256 9f473fb7 KangIngu
                if (e.GetPosition(this).X > LastRotateHorizontalValue)
1257
                {
1258
                    RotateFlag = true;
1259
                }
1260
                else
1261
                {
1262
                    RotateFlag = false;
1263
                }
1264
                LastRotateHorizontalValue = e.GetPosition(this).X;
1265
            }
1266 787a4489 KangIngu
        }
1267
1268 8771edc4 humkyung
        private void drag_DragStarted(object sender, DragStartedEventArgs e)
1269
        {
1270
            /// save mouse down and current mouse point
1271
            this.MouseDownPoint = Mouse.GetPosition(Window.GetWindow((DependencyObject)sender));
1272
            this.CurrentMousePoint = Mouse.GetPosition(Window.GetWindow((DependencyObject)sender));
1273
            /// up to here
1274
1275
            if (ViewerDataModel.Instance.UndoDataList == null)
1276
            {
1277
                return;
1278
            }
1279 873011c4 humkyung
            //if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Event == EventType.Thumb))
1280 e5bd2147 swate0609
            //{
1281
            //    return;
1282
            //}
1283 873011c4 humkyung
            //if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().MarkupDataColl != null))
1284 e5bd2147 swate0609
            //{
1285 873011c4 humkyung
            //    if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().MarkupDataColl.Count > 0)
1286 e5bd2147 swate0609
            //    {
1287 873011c4 humkyung
            //        if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().MarkupDataColl.FirstOrDefault().PointSet != null)
1288 e5bd2147 swate0609
            //        {
1289
            //            return;
1290
            //        }
1291
            //    }
1292
            //}
1293 8771edc4 humkyung
1294
            var comments = (from drawing in this.Members
1295
                            select drawing.DrawingData as CommentUserInfo).ToList();
1296 e5bd2147 swate0609
            //UndoCommand.Instance.Push(comments, this.AngleValue);
1297
            UndoCommand.Instance.Push(comments);
1298 8771edc4 humkyung
        }
1299
1300
        private void drag_DragCompleted(object sender, DragCompletedEventArgs e)
1301
        {
1302 902faaea taeseongkim
            DragThumb.Cursor = new Cursor(App.DefaultArrowCursorStream);
1303 8771edc4 humkyung
1304
            var comments = (from drawing in this.Members
1305
                            select drawing.DrawingData as CommentUserInfo).ToList();
1306 e5bd2147 swate0609
            //UndoCommand.Instance.Push(comments, this.AngleValue);
1307 8771edc4 humkyung
        }
1308
1309 6b6e937c taeseongkim
        private void DragThumb_DragDelta(object sender, DragDeltaEventArgs e)
1310 787a4489 KangIngu
        {
1311 508c3ac5 humkyung
            double scale = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.ContentScale;
1312 025ebf74 humkyung
1313 f3ab410f taeseongkim
            var newMousePoint = Mouse.GetPosition(Window.GetWindow((DependencyObject)sender));
1314
         
1315
            var horzChange = (newMousePoint.X - this.CurrentMousePoint.X) / scale;/// Math.Round(tmp.X - this.CurrentMousePoint.X) / scale;
1316
            var vertChange = (newMousePoint.Y - this.CurrentMousePoint.Y) / scale;///Math.Round(tmp.Y - this.CurrentMousePoint.Y) / scale;
1317
1318 0d00f9c8 humkyung
            try
1319
            {
1320
                DragThumb.Cursor = Cursors.SizeAll;
1321 39f208de taeseongkim
                System.Diagnostics.Debug.WriteLine($"TransItem : {horzChange}, {vertChange}");
1322
                System.Diagnostics.Debug.WriteLine($"DragDeltaEventArgs : {e.HorizontalChange}, {e.VerticalChange}");
1323 8e5a4a6a taeseongkim
1324
1325 39f208de taeseongkim
                var mainRect = ViewerDataModel.Instance.SystemMain.dzMainMenu.mainPanel.Rect();
1326 f3ab410f taeseongkim
1327 39f208de taeseongkim
                //if (ViewerDataModel.Instance.PageAngle == 270 || ViewerDataModel.Instance.PageAngle == 90)
1328 f3ab410f taeseongkim
                //{
1329 39f208de taeseongkim
                //    mainRect = new Rect(0, 0, mainRect.Height, mainRect.Width);
1330 f3ab410f taeseongkim
                //}
1331
1332 39f208de taeseongkim
                mainRect = MathHelper.RotateRect(ViewerDataModel.Instance.SystemMain.dzMainMenu.mainPanel.Rect(), new Point(mainRect.Width / 2, mainRect.Height / 2), ViewerDataModel.Instance.PageAngle);
1333
1334
                var rect = (this.ContainerContent.FindChildByType<CommentUserInfo>() as CommentUserInfo).ItemRect; //this.AdornerBorder.Bounds(ViewerDataModel.Instance.SystemMain.dzMainMenu.mainPanel);
1335
1336
                var rotationRect = MathHelper.RotateRect(rect, new Point(mainRect.Width / 2, mainRect.Height / 2), ViewerDataModel.Instance.PageAngle);
1337
                
1338
                var moveDirection = mainRect.Movement(rotationRect);
1339 f3ab410f taeseongkim
1340 39f208de taeseongkim
                System.Diagnostics.Debug.WriteLine($"horzChange: {horzChange} , vertChange:{vertChange}");
1341
                //System.Diagnostics.Debug.WriteLine($"DragDeltaEventArgs : Top:{rect.Top}, Left:{rect.Left}, Right:{rect.Right}, Bottom:{rect.Bottom} ,BottomLeft : {rect.BottomLeft} BottomRight : {rect.BottomRight}");
1342 f3ab410f taeseongkim
1343 39f208de taeseongkim
                //if (Math.Abs(horzChange) > 0)
1344 f3ab410f taeseongkim
                //{
1345
                //    if ((horzChange < 0 && !moveDirection.Left) || (horzChange > 0 && !moveDirection.Right))
1346
                //    {
1347
                //        //this.TranslateItems(horzChange * -1, 0);
1348
                //        //e.Handled = true;
1349
                //        horzChange = 0;
1350
                //        newMousePoint.X = this.CurrentMousePoint.X;
1351
                //    }
1352
                //}
1353
1354 39f208de taeseongkim
                //if (Math.Abs(vertChange) > 0)
1355 f3ab410f taeseongkim
                //{
1356
                //    if ((vertChange < 0 && !moveDirection.Up) || (vertChange > 0 && !moveDirection.Down))
1357
                //    {
1358
                //        //this.TranslateItems(0, vertChange * -1);
1359
                //        //e.Handled = true;
1360
                //        vertChange = 0;
1361
                //        newMousePoint.Y = this.CurrentMousePoint.Y;
1362
                //    }
1363
                //}
1364 8de55603 taeseongkim
1365
                this.TranslateItems(horzChange, vertChange);
1366 0d00f9c8 humkyung
            }
1367
            finally
1368
            {
1369
                /// update CurrentMousePoint
1370 f3ab410f taeseongkim
                this.CurrentMousePoint = newMousePoint;
1371 0d00f9c8 humkyung
            }
1372 787a4489 KangIngu
        }
1373 eb2b9248 KangIngu
1374 0d00f9c8 humkyung
        /// <summary>
1375
        /// translate all members
1376
        /// </summary>
1377
        /// <param name="e"></param>
1378
        public void TranslateItems(double dx, double dy)
1379 787a4489 KangIngu
        {
1380
            Dispatcher.BeginInvoke((Action)(() =>
1381
            {
1382 4913851c humkyung
                foreach (var item in this.Members)
1383 787a4489 KangIngu
                {
1384 0d00f9c8 humkyung
                    this.TranslateItem(dx, dy, item);
1385 787a4489 KangIngu
                }
1386 c7fde400 taeseongkim
1387
                this.BorderUpdate();
1388 787a4489 KangIngu
            }));
1389
        }
1390 eb2b9248 KangIngu
1391 0d00f9c8 humkyung
        /// <summary>
1392
        /// translate a item
1393
        /// </summary>
1394
        /// <param name="e"></param>
1395
        /// <param name="item"></param>
1396
        private void TranslateItem(double dx, double dy, AdornerMember item)
1397 787a4489 KangIngu
        {
1398 554aae3b humkyung
            /// rotate point with page rotation
1399
            var rotation = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.rotate.Angle;
1400
            Point delta = MathSet.RotateAbout(new Point(0, 0), new Point(dx, dy), -rotation);
1401
            /// up to here
1402 0d00f9c8 humkyung
            (item.DrawingData as CommentUserInfo).OnTranslate(delta.X, delta.Y);
1403 105359ce ljiyeon
1404
                ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate(
1405 873011c4 humkyung
                        MarkupParser.MarkupToString((item.DrawingData as CommentUserInfo), App.ViewInfo.UserID), EventType.Operation, null, null);            
1406 105359ce ljiyeon
1407 508c3ac5 humkyung
            item.UpdateThumb();
1408 787a4489 KangIngu
        }
1409
1410
        private void resize_MouseMove(object sender, MouseEventArgs e)
1411
        {
1412 39f208de taeseongkim
            //reSizePoint = e.GetPosition(this);
1413 787a4489 KangIngu
        }
1414 0d00f9c8 humkyung
1415 787a4489 KangIngu
        /// <summary>
1416
        /// 회전
1417
        /// </summary>
1418
        /// <param name="sender"></param>
1419
        /// <param name="e"></param>
1420
        public void rotate_DragDelta(object sender, DragDeltaEventArgs e)
1421
        {
1422
            MoveRotate(e);
1423
        }
1424
1425
        double LastRotateHorizontalValue = 0;
1426
        double LastRotateVerticalValue = 0;
1427 9f473fb7 KangIngu
        bool RotateFlag = false;
1428
1429 992a98b4 KangIngu
        /// <summary>
1430
        /// <history>humkyung 2018.05.09 upgrade rotate shape peformance</history>
1431
        /// </summary>
1432
        /// <param name="e"></param>
1433 787a4489 KangIngu
        public void MoveRotate(DragDeltaEventArgs e)
1434
        {
1435 62b6bcde humkyung
            Point CenterPoint = this.Centeroid;
1436 992a98b4 KangIngu
            Point pt = Mouse.GetPosition(this);
1437
1438 edef7af2 humkyung
            #region X축 기준으로 회전 각도를 구한다.
1439 e65e8c5c humkyung
            Vector AxisX = new Vector(RotatedPoint.X - CenterPoint.X, RotatedPoint.Y - CenterPoint.Y);
1440
            AxisX.Normalize();
1441
            Vector AxisY = new Vector(pt.X - CenterPoint.X, pt.Y - CenterPoint.Y);
1442
            AxisY.Normalize();
1443
            double dDeltaAngle = Vector.AngleBetween(AxisX, AxisY);
1444 edef7af2 humkyung
            #endregion
1445
1446 e65e8c5c humkyung
            _ActualAngle += dDeltaAngle;
1447
            if (_ActualAngle > 360) _ActualAngle -= 360;
1448
            if (_ActualAngle < 0) _ActualAngle += 360;
1449 edef7af2 humkyung
            #region AxisLock이 설정되어 있는 경우 Angle을 특정 값으로 정렬한다.
1450 b79d6e7f humkyung
            if (ViewerDataModel.Instance.IsAxisLock || ViewerDataModel.Instance.IsPressShift)
1451 edef7af2 humkyung
            {
1452 e65e8c5c humkyung
                double tmp = AlignedAngles.OrderBy(x => Math.Abs(_ActualAngle - x)).First();
1453
                dDeltaAngle = tmp - AngleValue;
1454
                AngleValue = tmp;
1455
            }
1456
            else
1457
            {
1458
                AngleValue = _ActualAngle;
1459 edef7af2 humkyung
            }
1460
            #endregion
1461
1462
            /// save rotatePoint
1463 e65e8c5c humkyung
            this.RotatedPoint = pt;
1464 787a4489 KangIngu
1465
            Dispatcher.BeginInvoke((Action)(() =>
1466
            {
1467 554aae3b humkyung
                foreach (var member in this.Members)
1468 787a4489 KangIngu
                {
1469 554aae3b humkyung
                    member.RotateAbout(CenterPoint, dDeltaAngle); 
1470
                    #region 보더 업데이트
1471
                    switch (member.Drawingtype)
1472 787a4489 KangIngu
                    {
1473
                        case ControlType.TextControl:
1474 fa48eb85 taeseongkim
                            (member.DrawingData as CommentUserInfo).CommentAngle = AngleValue;
1475 53880c83 ljiyeon
1476 9b7cda70 KangIngu
                            DragThumb.RenderTransformOrigin = new Point(0, 0);
1477 787a4489 KangIngu
                            DragThumb.RenderTransform = new RotateTransform()
1478
                            {
1479 fa48eb85 taeseongkim
                                Angle = (member.DrawingData as CommentUserInfo).CommentAngle
1480 787a4489 KangIngu
                            };
1481
1482 9b7cda70 KangIngu
                            AdornerBorder.RenderTransformOrigin = new Point(0, 0);
1483 787a4489 KangIngu
                            AdornerBorder.RenderTransform = new RotateTransform()
1484
                            {
1485 fa48eb85 taeseongkim
                                Angle = (member.DrawingData as CommentUserInfo).CommentAngle
1486 54e35b39 송근호
                            };
1487 6e035f10 송근호
1488 62b6bcde humkyung
                            (member.DrawingData as CommentUserInfo).UpdateControl();
1489 787a4489 KangIngu
                            BorderUpdate();
1490
                            break;
1491 53880c83 ljiyeon
1492 787a4489 KangIngu
                        case ControlType.ArrowMultiLine:
1493
                        case ControlType.ArcLine:
1494 40b3ce25 ljiyeon
                        case ControlType.ArcArrow:
1495 787a4489 KangIngu
                        case ControlType.SingleLine:
1496
                        case ControlType.Triangle:
1497
                        case ControlType.ArrowTextControl:
1498 554aae3b humkyung
                        case ControlType.PolygonControl:
1499
                        case ControlType.Ink:
1500 787a4489 KangIngu
                            BorderUpdate();
1501
                            break;
1502 554aae3b humkyung
                        case ControlType.Date:
1503 787a4489 KangIngu
                        case ControlType.RectCloud:
1504
                        case ControlType.Rectangle:
1505
                        case ControlType.ImgControl:
1506
                        case ControlType.Sign:
1507
                        case ControlType.Symbol:
1508
                        case ControlType.Stamp:
1509 fa48eb85 taeseongkim
                            (member.DrawingData as CommentUserInfo).CommentAngle = AngleValue;
1510 787a4489 KangIngu
                            BorderUpdate();
1511
                            break;
1512
                        case ControlType.PolygonCloud:
1513 554aae3b humkyung
                            ((ICloudControl)member.DrawingData).DrawingCloud();
1514 787a4489 KangIngu
                            BorderUpdate();
1515
                            break;
1516
                        case ControlType.Circle:
1517 fa48eb85 taeseongkim
                            (member.DrawingData as CommentUserInfo).CommentAngle = AngleValue;
1518 554aae3b humkyung
                            ((CircleControl)member.DrawingData).SetCenterXY();
1519 787a4489 KangIngu
                            BorderUpdate();
1520
                            break;
1521
                        default:
1522
                            break;
1523
                    }
1524
                }
1525
                #endregion
1526
            }));
1527
        }
1528 eb2b9248 KangIngu
1529 873011c4 humkyung
        /// <summary>
1530
        /// 객체 회전 시작
1531
        /// </summary>
1532
        /// <param name="sender"></param>
1533
        /// <param name="e"></param>
1534 787a4489 KangIngu
        private void rotate_DragStarted(object sender, DragStartedEventArgs e)
1535 29010418 ljiyeon
        {            
1536 e65e8c5c humkyung
            this.RotatedPoint = Mouse.GetPosition(this); /// 2018.05.09 added by humkyung
1537 eb2b9248 KangIngu
            rotateTop.Cursor = Cursors.SizeAll;
1538
1539 992a98b4 KangIngu
            /// get angle from text controls' angle if only text control exists - 2018.05.10 added by humkyung
1540 3b797b23 humkyung
            if ((1 == this.Members.Count) && (this.Members[0]).DrawingData.GetType().Name == "TextControl")
1541 992a98b4 KangIngu
            {
1542 3b797b23 humkyung
                this.AngleValue = ((this.Members[0]).DrawingData as TextControl).CommentAngle;
1543 992a98b4 KangIngu
            }
1544
            /// up to here
1545
1546 e5bd2147 swate0609
            //dBeforeAngle = this.angleValue;
1547 fd452a01 swate0609
1548 01cbc243 KangIngu
            if (ViewerDataModel.Instance.UndoDataList == null)
1549 787a4489 KangIngu
            {
1550
                return;
1551
            }
1552
1553 873011c4 humkyung
            //if ((ViewerDataModel.Instance.UndoDataList.Count > 0) && ViewerDataModel.Instance.UndoDataList.LastOrDefault().Event == EventType.Thumb)
1554 e5bd2147 swate0609
            //{
1555
            //    return;
1556
            //}
1557 d128ceb2 humkyung
1558 873011c4 humkyung
            //if ((ViewerDataModel.Instance.UndoDataList.Count > 0) && ViewerDataModel.Instance.UndoDataList.LastOrDefault().MarkupDataColl != null)
1559 e5bd2147 swate0609
            //{
1560 873011c4 humkyung
            //    if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().MarkupDataColl.Count > 0)
1561 e5bd2147 swate0609
            //    {
1562 873011c4 humkyung
            //        if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().MarkupDataColl.FirstOrDefault().PointSet != null)
1563 e5bd2147 swate0609
            //        {
1564
            //            return;
1565
            //        }
1566
            //    }
1567
            //}
1568 787a4489 KangIngu
1569 4913851c humkyung
            var comments = (from drawing in this.Members
1570 d128ceb2 humkyung
                            select drawing.DrawingData as CommentUserInfo).ToList();
1571 e5bd2147 swate0609
            UndoCommand.Instance.Push(comments);
1572 787a4489 KangIngu
        }
1573 29010418 ljiyeon
        
1574 787a4489 KangIngu
        private void rotate_DragCompleted(object sender, DragCompletedEventArgs e)
1575
        {
1576 902faaea taeseongkim
            rotateTop.Cursor = new Cursor(App.DefaultArrowCursorStream);
1577 d128ceb2 humkyung
1578 4913851c humkyung
            var comments = (from drawing in this.Members
1579 d128ceb2 humkyung
                            select drawing.DrawingData as CommentUserInfo).ToList();
1580 e5bd2147 swate0609
            //UndoCommand.Instance.Push(comments, this.AngleValue, dBeforeAngle);
1581 787a4489 KangIngu
        }
1582
1583
        public void ControlPointMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
1584
        {
1585 4913851c humkyung
            AdornerMember control = this.Members.FirstOrDefault();
1586 787a4489 KangIngu
1587 3dbace4e taeseongkim
            if ((control.DrawingData as ArrowTextControl) != null)
1588 787a4489 KangIngu
            {
1589
                if ((control.DrawingData as ArrowTextControl).isTrans == false && (control.DrawingData as ArrowTextControl).isFixed == false)
1590
                {
1591
                    (control.DrawingData as ArrowTextControl).isTrans = true;
1592
                }
1593
            }
1594
1595
        }
1596 eb2b9248 KangIngu
1597 787a4489 KangIngu
        public void TextControlChanger()
1598
        {
1599 4913851c humkyung
            if ((this.Members.First() as AdornerMember).DrawingData.GetType().Name == "TextControl")
1600 787a4489 KangIngu
            {
1601 4913851c humkyung
                TextControl AllControl = (this.Members.First() as AdornerMember).DrawingData as TextControl;
1602 787a4489 KangIngu
                AllControl.Base_TextBox.Focus();
1603
                AllControl.Base_TextBox.Visibility = Visibility.Visible;
1604
                AllControl.Base_TextBlock.Visibility = Visibility.Collapsed;
1605 fa48eb85 taeseongkim
                AllControl.Base_TextBox.IsHitTestVisible = true;
1606 1305c420 taeseongkim
                AllControl.IsEditingMode = true;
1607 787a4489 KangIngu
                AllControl.Base_TextBox.Focus();
1608 fa48eb85 taeseongkim
1609 787a4489 KangIngu
                AllControl.SizeChanged += (sen, ea) =>
1610
                {
1611
                    if (AllControl.Base_TextBox != null)
1612
                    {
1613
                        RectangleGeometry Data = new RectangleGeometry
1614
                        {
1615
                            Rect = new Rect()
1616
                            {
1617
                                X = AllControl.StartPoint.X,
1618
                                Y = AllControl.StartPoint.Y,
1619
                                Width = AllControl.Base_TextBox.Width,
1620
                                Height = AllControl.Base_TextBox.Height,
1621
                            }
1622
                        };
1623
1624
                        Point endPointV = new Point(Data.Bounds.Right, Data.Bounds.Bottom);
1625
                        Point middle = MathSet.getMiddlePoint(AllControl.StartPoint, endPointV);
1626
                        AllControl.Base_Grid.RenderTransform = new RotateTransform()
1627
                        {
1628 fa48eb85 taeseongkim
                            Angle = AllControl.CommentAngle,
1629 787a4489 KangIngu
                            CenterX = middle.X,
1630
                            CenterY = middle.Y,
1631
                        };
1632
                    }
1633
                    BorderUpdate();
1634
                };
1635
            }
1636
        }
1637 eb2b9248 KangIngu
1638 787a4489 KangIngu
        private void RectThumb_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) //더블클릭
1639
        {
1640 4913851c humkyung
            if (e.ClickCount == 2 && this.Members.Count == 1)
1641 787a4489 KangIngu
            {
1642 4913851c humkyung
                if ((this.Members.First() as AdornerMember).DrawingData.GetType().Name == "TextControl")
1643 787a4489 KangIngu
                {
1644 1305c420 taeseongkim
                    SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu);
1645 29010418 ljiyeon
                    TextControlChanger();                    
1646 787a4489 KangIngu
                }
1647
1648 4913851c humkyung
                else if ((this.Members.First() as AdornerMember).DrawingData.GetType().Name == "ArrowTextControl")
1649 787a4489 KangIngu
                {
1650 4913851c humkyung
                    ArrowTextControl AllControl = (this.Members.First() as AdornerMember).DrawingData as ArrowTextControl;
1651
                    Thumb tm = (this.Members.First() as AdornerMember).ThumbList.Last();
1652 1305c420 taeseongkim
               
1653 3797ff05 djkim
                    //ArrowControl TextBox Thumb없애기
1654 787a4489 KangIngu
                    tm.Visibility = Visibility.Collapsed;
1655
1656 4913851c humkyung
                    ((this.Members.First() as AdornerMember).DrawingData as ArrowTextControl).Base_TextBox.IsHitTestVisible = true;
1657 1305c420 taeseongkim
                    SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu);
1658
1659
                    ((ArrowTextControl)AllControl).Base_TextBox.Focus();
1660 29010418 ljiyeon
                    
1661 1305c420 taeseongkim
1662 787a4489 KangIngu
                    ((ArrowTextControl)AllControl).Base_TextBox.SizeChanged += (sen, ea) =>
1663
1664
                    {
1665
                        tm.Width = (AllControl as ArrowTextControl).BoxWidth;
1666
                        tm.Height = (AllControl as ArrowTextControl).BoxHeight;
1667
1668
                        List<Point> ps = new List<Point>();
1669 29010418 ljiyeon
                        
1670 787a4489 KangIngu
                        ps.Add(new Point(Canvas.GetLeft(AllControl.Base_TextBox) + AllControl.BoxWidth / 2, Canvas.GetTop(AllControl.Base_TextBox))); //상단
1671
                        ps.Add(new Point(Canvas.GetLeft(AllControl.Base_TextBox) + AllControl.BoxWidth / 2, Canvas.GetTop(AllControl.Base_TextBox) + AllControl.BoxHeight)); // 하단
1672
                        ps.Add(new Point(Canvas.GetLeft(AllControl.Base_TextBox), Canvas.GetTop(AllControl.Base_TextBox) + AllControl.BoxHeight / 2)); //좌단
1673
                        ps.Add(new Point(Canvas.GetLeft(AllControl.Base_TextBox) + AllControl.BoxWidth, Canvas.GetTop(AllControl.Base_TextBox) + AllControl.BoxHeight / 2));  //우단
1674
1675
1676
1677
1678
                        var endP = MathSet.getNearPoint(ps, AllControl.MidPoint);
1679
                        var tempP = MathSet.getMiddlePoint(AllControl.StartPoint, endP);
1680
                        if (AllControl.isTrans)
1681
                        {
1682 4913851c humkyung
                            Canvas.SetLeft((this.Members.First() as AdornerMember).ThumbList[1], AllControl.MidPoint.X);
1683
                            Canvas.SetTop((this.Members.First() as AdornerMember).ThumbList[1], AllControl.MidPoint.Y);
1684 787a4489 KangIngu
                        }
1685
                        else
1686
                        {
1687 4913851c humkyung
                            Canvas.SetLeft((this.Members.First() as AdornerMember).ThumbList[1], tempP.X);
1688
                            Canvas.SetTop((this.Members.First() as AdornerMember).ThumbList[1], tempP.Y);
1689 787a4489 KangIngu
                        }
1690
1691 9b7cda70 KangIngu
1692 787a4489 KangIngu
                        BorderUpdate();
1693 9b7cda70 KangIngu
1694 787a4489 KangIngu
                    };
1695
                }
1696 4913851c humkyung
                else if ((this.Members.First() as AdornerMember).DrawingData.GetType().Name == "DateControl")
1697 787a4489 KangIngu
                {
1698 4913851c humkyung
                    DateControl data = (this.Members.First() as AdornerMember).DrawingData as DateControl;
1699 787a4489 KangIngu
                    CalendarControl instanceCal = new CalendarControl(data.Text);
1700
                    //dropData.IsOpen = true;
1701
                    RadWindow rc = new RadWindow();
1702
                    rc.Width = 300;
1703
                    rc.Height = 300;
1704
                    rc.Header = "Change Date";
1705
                    rc.Content = instanceCal;
1706
                    rc.BorderThickness = new Thickness(3);
1707
                    rc.ResizeMode = ResizeMode.NoResize;
1708
                    rc.WindowStartupLocation = WindowStartupLocation.CenterScreen;
1709
                    rc.ModalBackground = new SolidColorBrush(Colors.Black);
1710
                    rc.ModalBackground.Opacity = 0.6;
1711
                    Telerik.Windows.Controls.StyleManager.SetTheme(rc, new Telerik.Windows.Controls.Windows8Theme());
1712
                    instanceCal.changeDateCal.SelectionChanged += (sen, ea) =>
1713
                    {
1714
                        data.Text = instanceCal.changeDateCal.SelectedDate.Value.ToShortDateString();
1715
                        rc.Close();
1716
                    };
1717
                    rc.ShowDialog();
1718
                    //CalendarControl.xaml
1719
                }
1720 4913851c humkyung
                else if ((this.Members.First() as AdornerMember).DrawingData.GetType().Name == "ArcControl")
1721 787a4489 KangIngu
                {
1722 4913851c humkyung
                    ArcControl instance = ((this.Members.First() as AdornerMember).DrawingData as ArcControl);
1723 787a4489 KangIngu
                    if (instance.isTransOn)
1724
                    {
1725
                        instance.isTransOn = false;
1726
                    }
1727
                    else
1728
                    {
1729
                        instance.isTransOn = true;
1730
                    }
1731 661b7416 humkyung
                    ///instance.SetArcPath();
1732 787a4489 KangIngu
                    BorderUpdate();
1733
                }
1734 4913851c humkyung
                else if ((this.Members.First() as AdornerMember).DrawingData.GetType().Name == "ArrowArcControl")
1735 40b3ce25 ljiyeon
                {
1736 4913851c humkyung
                    ArrowArcControl instance = ((this.Members.First() as AdornerMember).DrawingData as ArrowArcControl);
1737 40b3ce25 ljiyeon
                    if (instance.isTransOn)
1738
                    {
1739
                        instance.isTransOn = false;
1740
                    }
1741
                    else
1742
                    {
1743
                        instance.isTransOn = true;
1744
                    }
1745
                    instance.SetArcPath();
1746
                    BorderUpdate();
1747
                }
1748 787a4489 KangIngu
1749
            }
1750 29010418 ljiyeon
            
1751 787a4489 KangIngu
        }
1752
        #endregion
1753
1754
        private void DragThumb_MouseDoubleClick(object sender, MouseButtonEventArgs e)
1755
        {
1756 3b797b23 humkyung
            if ((this.Members[0] as AdornerMember).DrawingData.GetType().Name == "TextControl" 
1757
                || (this.Members[0] as AdornerMember).DrawingData.GetType().Name == "ArrowTextControl")
1758 787a4489 KangIngu
            {
1759
                DragThumb.Visibility = Visibility.Collapsed;
1760 9b7cda70 KangIngu
            }
1761 787a4489 KangIngu
        }
1762
    }
1763
}
클립보드 이미지 추가 (최대 크기: 500 MB)