프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Polygon / PolygonControl.cs @ fd452a01

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

1
using MarkupToPDF.Common;
2
using MarkupToPDF.Controls.Common;
3
using MarkupToPDF.Serialize.Core;
4
using MarkupToPDF.Serialize.S_Control;
5
using System;
6
using System.Collections.Generic;
7
using System.ComponentModel;
8
using System.Linq;
9
using System.Text;
10
using System.Threading.Tasks;
11
using System.Windows;
12
using System.Windows.Controls;
13
using System.Windows.Forms;
14
using System.Windows.Input;
15
using System.Windows.Media;
16
using System.Windows.Shapes;
17

    
18
namespace MarkupToPDF.Controls.Polygon
19
{
20
     public class PolygonControl : CommentUserInfo, IDisposable, INotifyPropertyChanged, IShapeControl, IMarkupControlData, IPath
21
    {
22
        #region Constructure
23

    
24
        static PolygonControl()
25
        {
26
            DefaultStyleKeyProperty.OverrideMetadata(typeof(PolygonControl), new FrameworkPropertyMetadata(typeof(PolygonControl)));
27
            //ResourceDictionary dictionary = new ResourceDictionary();
28
            //dictionary.Source = new Uri("/MarkupToPDF;component/themes/generic.xaml", UriKind.RelativeOrAbsolute);
29
            //Application.Current.Resources.MergedDictionaries.Add(dictionary);
30
        }
31

    
32
        public PolygonControl()
33
        {
34
            //this.DefaultStyleKey = typeof(PolygonControl);
35
        }
36
        
37
        #endregion
38

    
39
        #region Variable
40
        private const string PART_PolyPath = "PART_PolyPath";
41

    
42
        public Path Base_PolyPath = null;
43

    
44
        #endregion
45

    
46
        #region Internal Method
47
        public override void OnApplyTemplate()
48
        {   
49
            base.OnApplyTemplate();
50

    
51
            Base_PolyPath = GetTemplateChild(PART_PolyPath) as Path;
52

    
53
            if (Base_PolyPath == null)
54
                return;
55

    
56
            this.SetPolyPath();
57
        }
58

    
59

    
60
        #endregion
61

    
62
        #region Method
63

    
64
        public override void ApplyOverViewData()
65
        {
66
            this.OverViewPathData = this.PathData;
67
        }
68

    
69
        #endregion
70

    
71
        #region Dependency Properties
72

    
73
        public static readonly DependencyProperty UserIDProperty = DependencyProperty.Register(
74
                "UserID", typeof(string), typeof(PolygonControl), new PropertyMetadata(null));
75

    
76
        public static readonly DependencyProperty LineSizeProperty = DependencyProperty.Register(
77
              "LineSize", typeof(double), typeof(PolygonControl), new PropertyMetadata((Double)3));
78

    
79
        public static readonly DependencyProperty StrokeColorProperty = DependencyProperty.Register(
80
               "StrokeColor", typeof(SolidColorBrush), typeof(PolygonControl), 
81
               new PropertyMetadata(new SolidColorBrush(Colors.Red)));
82

    
83
        public static readonly DependencyProperty PathDataProperty = DependencyProperty.Register(
84
                "PathData", typeof(Geometry), typeof(PolygonControl), null);
85

    
86
        //강인구 추가
87
        public static readonly DependencyProperty DashSizeProperty = DependencyProperty.Register(
88
                "DashSize", typeof(DoubleCollection), typeof(PolygonControl), new PropertyMetadata(new DoubleCollection { 99999999  }, PointValueChanged));
89

    
90
        public static readonly DependencyProperty OverViewPathDataProperty = DependencyProperty.Register(
91
                "OverViewPathData", typeof(Geometry), typeof(PolygonControl), null);
92
        //강인구 추가
93
        public static readonly DependencyProperty PaintProperty = DependencyProperty.Register(
94
        "Paint", typeof(PaintSet), typeof(PolygonControl), new PropertyMetadata(PaintSet.None, PointValueChanged));
95

    
96
        public static readonly DependencyProperty IsCompletedProperty = DependencyProperty.Register(
97
               "IsCompleted", typeof(bool), typeof(PolygonControl), null);
98

    
99
        public static readonly DependencyProperty StartPointProperty = DependencyProperty.Register(
100
               "StartPoint", typeof(Point), typeof(PolygonControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
101

    
102
        public static readonly DependencyProperty EndPointProperty = DependencyProperty.Register(
103
               "EndPoint", typeof(Point), typeof(PolygonControl), new PropertyMetadata(new Point(100, 100), PointValueChanged));
104

    
105
        public static readonly DependencyProperty PointSetProperty = DependencyProperty.Register(
106
                "PointSet", typeof(List<Point>), typeof(PolygonControl), new PropertyMetadata(new List<Point>(), PointValueChanged));
107

    
108
        /// <summary>
109
        /// StylusPointSet을 List<Point>로 대체하면 PointValueChanged가 작동안한다.
110
        /// </summary>
111
        //public static readonly DependencyProperty StylusPointSetProperty = DependencyProperty.Register(
112
        //        "PointC", typeof(StylusPointSet), typeof(PolygonControl), new PropertyMetadata(new StylusPointSet(), PointValueChanged));
113

    
114
        public static readonly DependencyProperty AngleProperty =
115
            DependencyProperty.Register("Angle", typeof(double), typeof(PolygonControl), new PropertyMetadata((double)0.0, new PropertyChangedCallback
116
                (AngleValueChanged)));
117

    
118
        public static readonly DependencyProperty CenterXProperty =
119
            DependencyProperty.Register("CenterX", typeof(double), typeof(PolygonControl), new PropertyMetadata((double)0, OnCenterXYChanged));
120

    
121
        public static readonly DependencyProperty CenterYProperty =
122
            DependencyProperty.Register("CenterY", typeof(double), typeof(PolygonControl), new PropertyMetadata((double)0, OnCenterXYChanged));
123

    
124
        public static readonly DependencyProperty IsSelectedProperty =
125
            DependencyProperty.Register("IsSelected", typeof(bool), typeof(PolygonControl), new FrameworkPropertyMetadata(false, IsSelectedChanged));
126

    
127
        public static readonly DependencyProperty ControlTypeProperty =
128
            DependencyProperty.Register("ControlType", typeof(ControlType), typeof(PolygonControl), new FrameworkPropertyMetadata(ControlType.PolygonControl));
129

    
130
        public static readonly DependencyProperty CanvasXProperty = DependencyProperty.Register(
131
                "CanvasX", typeof(double), typeof(PolygonControl), new PropertyMetadata((double)0, OnSetCansvasChanged));
132

    
133
        public static readonly DependencyProperty CanvasYProperty = DependencyProperty.Register(
134
                "CanvasY", typeof(double), typeof(PolygonControl), new PropertyMetadata((double)0, OnSetCansvasChanged));
135

    
136
        #endregion
137

    
138
        #region PropertyChanged Method
139
        public static void OnSetCansvasChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
140
        {
141
            var instance = (PolygonControl)sender;
142

    
143
            if (e.OldValue != e.NewValue && instance != null)
144
            {
145
                instance.SetValue(e.Property, e.NewValue);
146
                //Canvas.SetLeft(instance, instance.CanvasX);
147
                //Canvas.SetTop(instance, instance.CanvasY);
148
            }
149
        }
150

    
151
        public static void PointValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
152
        {
153
            var instance = (PolygonControl)sender;
154

    
155
            if (e.OldValue != e.NewValue && instance != null)
156
            {
157
                instance.SetValue(e.Property, e.NewValue);
158
                //강인구 추가
159
                instance.SetPolyPath();
160
                //instance.SetPolyPath(); 주석처리
161

    
162
            }
163
        }
164
        public static void AngleValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
165
        {
166
            var instance = (PolygonControl)sender;
167

    
168
            if (e.OldValue != e.NewValue && instance != null)
169
            {
170
                instance.SetValue(e.Property, e.NewValue);
171
                instance.SetPolyPath();
172
            }
173
        }
174
        public static void OnCenterXYChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
175
        {
176
            var instance = (PolygonControl)sender;
177
            if (e.OldValue != e.NewValue && instance != null)
178
            {
179
                instance.SetValue(e.Property, e.NewValue);
180
                instance.SetPolyPath();
181
            }
182
        }
183

    
184
        public static void IsSelectedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
185
        {
186
            //var instance = (PolygonControl)sender;
187

    
188
            //if (e.OldValue != e.NewValue && instance.Base_PolyPath != null)
189
            //{
190
            //    instance.SetValue(e.Property, e.NewValue);
191

    
192
            //    if (instance.IsSelected)
193
            //    {
194
            //        instance.Base_PolyPath.Stroke = new SolidColorBrush(Colors.Blue);
195
            //    }
196
            //    else
197
            //    {
198
            //        instance.Base_PolyPath.Stroke = new SolidColorBrush(Colors.Transparent);
199
            //    }
200
            //}
201
        }
202

    
203
        #endregion
204

    
205
        #region Properties
206

    
207

    
208
        public bool IsCompleted
209
        {
210
            get { return (bool)GetValue(IsCompletedProperty); }
211
            set
212
            {
213
                SetValue(IsCompletedProperty, value);
214
                OnPropertyChanged("IsCompleted");
215
            }
216
        }
217

    
218

    
219
        public Geometry OverViewPathData
220
        {
221
            get { return (Geometry)GetValue(OverViewPathDataProperty); }
222
            set
223
            {
224
                SetValue(OverViewPathDataProperty, value);
225
                OnPropertyChanged("OverViewPathData");
226
            }
227
        }
228

    
229
        public double CanvasX
230
        {
231
            get { return (double)GetValue(CanvasXProperty); }
232
            set
233
            {
234
                if (this.CanvasX != value)
235
                {
236
                    SetValue(CanvasXProperty, value);
237
                    OnPropertyChanged("CanvasX");
238
                }
239
            }
240
        }
241

    
242
        public double CanvasY
243
        {
244
            get { return (double)GetValue(CanvasYProperty); }
245
            set
246
            {
247
                if (this.CanvasY != value)
248
                {
249
                    SetValue(CanvasYProperty, value);
250
                    OnPropertyChanged("CanvasY");
251
                }
252
            }
253
        } 
254

    
255
        public override bool IsSelected
256
        {
257
            get
258
            {
259
                return (bool)GetValue(IsSelectedProperty);
260
            }
261
            set
262
            {
263
                SetValue(IsSelectedProperty, value);
264
                OnPropertyChanged("IsSelected");
265
            }
266
        }
267

    
268
        public PaintSet Paint
269
        {
270
            get { return (PaintSet)GetValue(PaintProperty); }
271
            set
272
            {
273
                if (this.Paint != value)
274
                {
275
                    SetValue(PaintProperty, value);
276
                    OnPropertyChanged("Paint");
277
                }
278
            }
279
        }
280

    
281
        public override ControlType ControlType
282
        {
283
            set
284
            {
285
                SetValue(ControlTypeProperty, value);
286
                OnPropertyChanged("ControlType");
287
            }
288
            get
289
            {
290
                return (ControlType)GetValue(ControlTypeProperty);
291
            }
292
        }
293

    
294
        public Double LineSize
295
        {
296
            get { return (Double)GetValue(LineSizeProperty); }
297
            set
298
            {
299
                if (this.LineSize != value)
300
                {
301
                    SetValue(LineSizeProperty, value);
302
                    OnPropertyChanged("LineSize");
303
                }
304
            }
305
        }
306

    
307
        public DoubleCollection DashSize
308
        {
309
            get { return (DoubleCollection)GetValue(DashSizeProperty); }
310
            set
311
            {
312
                if (this.DashSize != value)
313
                {
314
                    SetValue(DashSizeProperty, value);
315
                    OnPropertyChanged("DashSize");
316
                }
317
            }
318
        }
319
        public string UserID
320
        {
321
            get { return (string)GetValue(UserIDProperty); }
322
            set
323
            {
324
                if (this.UserID != value)
325
                {
326
                    SetValue(UserIDProperty, value);
327
                    OnPropertyChanged("UserID");
328
                }
329
            }
330
        }
331
        public List<Point> PointSet
332
        {
333
            get { return (List<Point>)GetValue(PointSetProperty); }
334
            set { SetValue(PointSetProperty, value);
335
            OnPropertyChanged("PointSet");
336
            }
337
        }        //public StylusPointSet PointC
338
        //{
339
        //    get { return (StylusPointSet)GetValue(StylusPointSetProperty); }
340
        //    set
341
        //    {
342
        //        SetValue(StylusPointSetProperty, value);
343
        //        OnPropertyChanged("PointC");
344
        //    }
345
        //}
346

    
347

    
348
        public double CenterX
349
        {
350
            get { return (double)GetValue(CenterXProperty); }
351
            set { SetValue(CenterXProperty, value);
352
            OnPropertyChanged("CenterX");
353
            }
354
        }
355
        public double CenterY
356
        {
357
            get
358
            {
359
                return (double)GetValue(CenterYProperty);
360
            }
361
            set
362
            {
363
                SetValue(CenterYProperty, value);
364
                OnPropertyChanged("CenterY");
365
            }
366
        }
367
        public override SolidColorBrush StrokeColor
368
        {
369
            get { return (SolidColorBrush)GetValue(StrokeColorProperty); }
370
            set
371
            {
372
                if (this.StrokeColor != value)
373
                {
374
                    SetValue(StrokeColorProperty, value);
375
                    OnPropertyChanged("StrokeColor");
376
                }
377
            }
378
        }
379
        public Geometry PathData
380
        {
381
            get { return (Geometry)GetValue(PathDataProperty); }
382
            set
383
            {
384
                SetValue(PathDataProperty, value);
385
                OnPropertyChanged("PathData");
386
            }
387
        }
388
     
389
        //public double Angle
390
        //{
391
        //    get { return (double)GetValue(AngleProperty); }
392
        //    set
393
        //    {
394
        //        if (this.Angle != value)
395
        //        {
396
        //            SetValue(AngleProperty, value);
397
        //            OnPropertyChanged("Angle");
398
        //        }
399
        //    }
400
        //}
401

    
402
        public Point EndPoint
403
        {
404
            get { return (Point)GetValue(EndPointProperty); }
405
            set
406
            {
407
                SetValue(EndPointProperty, value);
408
                OnPropertyChanged("EndPoint");
409
            }
410
        }
411
        public Point StartPoint
412
        {
413
            get { return (Point)GetValue(StartPointProperty); }
414
            set
415
            {
416
                SetValue(StartPointProperty, value);
417
                OnPropertyChanged("StartPoint");
418
            }
419
        }
420
        #endregion
421

    
422
        public override void UpdateControl()
423
        {
424
            this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y);
425
            this.EndPoint = new Point(this.PointSet[this.PointSet.Count - 1].X, this.PointSet[this.PointSet.Count - 1].Y);
426

    
427
            SetPolyPath();
428
        }
429

    
430
        private void SetPolyPath()
431
        {
432
            if (Base_PolyPath != null)
433
            {
434
                Base_PolyPath.StrokeDashArray.Clear();
435
                foreach (var item in this.DashSize)
436
                {
437
                    Base_PolyPath.StrokeDashArray.Add(item);
438
                }
439

    
440
                PathGeometry pathGeometry = new PathGeometry();
441
                PathFigure pathFigure = new PathFigure();
442
                PolyLineSegment instance = new PolyLineSegment(this.PointSet, true);
443
               
444
                StartPoint = instance.Points.First();
445
                pathFigure.StartPoint = StartPoint;
446
                EndPoint = instance.Points.Last();
447
                pathFigure.Segments.Add(instance);
448
                pathGeometry.Figures.Add(pathFigure);
449

    
450
                //강인구 추가(Chain이 아닌 Polygon일때만 채우기 및 빗금 하기)
451
                if (ControlType == ControlType.PolygonControl)
452
                {
453
                    switch (this.Paint)
454
                    {
455
                        case PaintSet.None:
456
                            {
457
                                pathFigure.IsFilled = false;
458
                                //강인구 추가
459
                                Base_PolyPath.Fill = null;
460
                            }
461
                            break;
462
                        case PaintSet.Fill:
463
                            {
464
                                Base_PolyPath.Fill = this.StrokeColor;
465
                            }
466
                            break;
467
                        case PaintSet.Hatch:
468
                            {
469
                                var size = this.LineSize > 5 ? 5 : this.LineSize;
470
                                Base_PolyPath.Fill = HatchMake.CreateHatchBrush(this.StrokeColor, 3 * 0.1);
471
                            }
472
                            break;
473
                        default:
474
                            break;
475
                    }
476
                }
477

    
478
                this.PathData = pathGeometry;
479
                this.ApplyOverViewData();
480
            }
481
        }
482

    
483
        public void ChangePaint(PaintSet state)
484
        {
485

    
486
        }
487

    
488
        /// <summary>
489
        /// call when mouse is moving while drawing control
490
        /// </summary>
491
        /// <author>humkyung</author>
492
        /// <param name="pt"></param>
493
        /// <param name="bAxisLocked"></param>
494
        public override void OnCreatingMouseMove(Point pt, bool bAxisLocked)
495
        {
496
            this.PointSet.RemoveAt(this.PointSet.Count - 1);
497

    
498
            Point tmp = pt;
499

    
500
            if (bAxisLocked)
501
            {
502
                CommentAngle = MathSet.returnAngle(this.PointSet[this.PointSet.Count - 1], ref tmp, bAxisLocked);
503
            }
504

    
505
            if (this.PointSet.Count > 2 && StartPoint == tmp)
506
            {
507
                this.IsCompleted = true;
508

    
509
                //var firstPoint = this.PointSet.First();
510
                //this.PointSet.Add(firstPoint);
511

    
512
                //this.ApplyOverViewData();
513

    
514
                UpdateControl();
515
            }
516
            else
517
            {
518

    
519
                this.PointSet.Add(tmp);
520

    
521
                this.UpdateControl();
522
            }
523
        }
524

    
525
        /// <summary>
526
        /// move control point has same location of given pt along given delta
527
        /// </summary>
528
        /// <author>humkyung</author>
529
        /// <date>2019.06.20</date>
530
        /// <param name="pt"></param>
531
        /// <param name="dx"></param>
532
        /// <param name="dy"></param>
533
        public override void OnMoveCtrlPoint(Point pt, double dx, double dy, bool bAxisLocked = false)
534
        {
535
            var pointSet = (this as IPath).PointSet;
536

    
537
            Point selected = MathSet.getNearPoint(pointSet, pt);
538

    
539
            Point NearStartpoint = MathSet.getNearPoint(pointSet, pt);
540

    
541
            var tmpPointSet = pointSet.Select((x,inx)=> new { x,inx});
542

    
543
            var selectPoint = tmpPointSet.Where(x => x.x.Equals(pt));
544

    
545
            if(selectPoint.Count() > 0)
546
            {
547
                if (tmpPointSet.Count() > selectPoint.First().inx + 1)
548
                {
549
                    NearStartpoint = pointSet[selectPoint.First().inx + 1];
550
                }
551
                else
552
                {
553
                    NearStartpoint = pointSet[selectPoint.First().inx - 1];
554
                }
555
            }
556

    
557
            selected.X += dx;
558
            selected.Y += dy;
559

    
560
            Point tmp = selected;
561

    
562
            CommentAngle = MathSet.returnAngle(NearStartpoint, ref tmp, bAxisLocked);
563

    
564
            if (bAxisLocked)
565
            {
566
                selected = tmp;
567
            }
568

    
569
            for (int i = 0; i < (this as IPath).PointSet.Count; i++)
570
            {
571
                if (pt.Equals((this as IPath).PointSet[i]))
572
                {
573
                    (this as IPath).PointSet[i] = selected;
574
                }
575
            }
576
            this.UpdateControl();
577
        }
578

    
579
        /// <summary>
580
        /// return Polygon's area
581
        /// </summary>
582
        /// <author>humkyung</author>
583
        /// <date>2019.06.13</date>
584
        public override Rect ItemRect
585
        {
586
            get
587
            {
588
                double dMinX = double.MaxValue;
589
                double dMinY = double.MaxValue;
590
                double dMaxX = double.MinValue;
591
                double dMaxY = double.MinValue;
592
                foreach (Point pt in this.PointSet)
593
                {
594
                    dMinX = Math.Min(dMinX, pt.X);
595
                    dMinY = Math.Min(dMinY, pt.Y);
596
                    dMaxX = Math.Max(dMaxX, pt.X);
597
                    dMaxY = Math.Max(dMaxY, pt.Y);
598
                }
599

    
600
                return new Rect(new Point(dMinX, dMinY), new Point(dMaxX, dMaxY));
601
            }
602
        }
603

    
604
        /// <summary>
605
        /// Serialize this
606
        /// </summary>
607
        /// <param name="sUserId"></param>
608
        /// <returns></returns>
609
        public override string Serialize()
610
        {
611
            using (S_PolyControl STemp = new S_PolyControl())
612
            {
613
                STemp.TransformPoint = "0|0";
614
                STemp.SizeSet = String.Format("{0}", this.LineSize);
615
                STemp.StrokeColor = this.StrokeColor.Color.ToString();
616
                //STemp.StrokeColor = "#FF000FFF";
617
                STemp.Name = this.GetType().Name.ToString();
618
                //STemp.Toler = this.Toler;
619
                STemp.PaintState = this.Paint;
620
                STemp.Opac = this.Opacity;
621
                STemp.UserID = this.UserID;
622
                STemp.PaintState = this.Paint;
623
                //강인구 추가(Chain인지 Polygon인지 구분)
624
                STemp.Type = this.ControlType;
625
                //STemp.IsTrans = this.isTransOn;
626
                //STemp.IsChain = this.isChain;
627
                STemp.PointSet = new List<Point>();
628
                STemp.DashSize = this.DashSize;
629
                STemp.StartPoint = this.StartPoint;
630
                STemp.EndPoint = this.EndPoint;
631
                STemp.IsCompleted = this.IsCompleted;
632
                foreach (var point in this.PointSet)
633
                {
634
                    STemp.PointSet.Add(point);
635
                }
636
                ///강인구 추가(2017.11.02)
637
                ///Memo 추가
638
                STemp.Memo = this.Memo;
639

    
640
                return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
641
            }
642
        }
643

    
644
        /// <summary>
645
        /// create a polygoncontrol from given string
646
        /// </summary>
647
        /// <param name="str"></param>
648
        /// <returns></returns>
649
        public static PolygonControl FromString(string str, SolidColorBrush brush, string sProjectNo)
650
        {
651
            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(str))
652
            {
653
                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
654
                return new PolygonControl
655
                {
656
                    LineSize = Convert.ToDouble(data2.First()),
657
                    //Toler = s.Toler,
658
                    IsCompleted = s.IsCompleted,
659
                    //PointSet = new List<Point>(),
660
                    Opacity = s.Opac,
661
                    StrokeColor = brush,
662
                    //강인구 추가(Chain인지 Polygon인지 구분)
663
                    ControlType = s.Type,
664
                    DashSize = s.DashSize,
665
                    StartPoint = s.StartPoint,
666
                    EndPoint = s.EndPoint,
667
                    PointSet = s.PointSet,
668
                    UserID = s.UserID,
669
                    Paint = s.PaintState,
670
                    Memo = s.Memo
671
                };
672
            }
673
        }
674

    
675

    
676
        #region Dispose
677
        public void Dispose()
678
        {
679
            //GC.Collect();
680
            ////GC.SuppressFinalize(this);
681
            this.Base_PolyPath = null;
682
        }
683
        #endregion
684

    
685
        #region INotifyPropertyChanged
686
        private void OnPropertyChanged(string name)
687
        {
688
            if (PropertyChanged != null)
689
            {
690
                PropertyChanged(this, new PropertyChangedEventArgs(name));
691
            }
692
        }
693

    
694
        public event PropertyChangedEventHandler PropertyChanged;
695
        #endregion
696
    }
697

    
698
    public class StylusPointSet : INotifyPropertyChanged
699
    {
700
        public StylusPointSet()
701
        {
702
            if (pointSet == null)
703
                pointSet = new List<Point>();
704
        }
705

    
706
        public List<Point> _pointSet;
707

    
708
        public List<Point> pointSet
709
        {
710
            get
711
            {
712
                return _pointSet;
713
            }
714
            set
715
            {
716
                _pointSet = value;
717
                OnPropertyChanged("pointSet");
718
            }
719
        }
720

    
721
        #region INotifyPropertyChanged
722
        private void OnPropertyChanged(string name)
723
        {
724
            if (PropertyChanged != null)
725
            {
726
                PropertyChanged(this, new PropertyChangedEventArgs(name));
727
            }
728
        }
729

    
730
        public event PropertyChangedEventHandler PropertyChanged;
731
        #endregion
732
    }
733
}
클립보드 이미지 추가 (최대 크기: 500 MB)