프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Shape / RectangleControl.cs @ fa48eb85

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

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

    
17
namespace MarkupToPDF.Controls.Shape
18
{
19
//강인구 추가 IShapeControl
20
    public class RectangleControl : CommentUserInfo, IDisposable, INotifyPropertyChanged, IMarkupCommonData, IShapeControl, IDashControl
21
    {
22
        public Path Base_RectPath { get; set; }
23
        private const string PART_RectPath = "PART_RectPath";
24

    
25
        #region Property
26

    
27

    
28
        public MouseMode mousemode
29
        {
30
            get
31
            {
32
                return (MouseMode)GetValue(mousemodeProperty);
33
            }
34
            set
35
            {
36
                SetValue(mousemodeProperty, value);
37
                OnPropertyChanged("mousemode");
38
            }
39
        }
40

    
41
        public override SolidColorBrush StrokeColor
42
        {
43
            get
44
            {
45
                return (SolidColorBrush)GetValue(StrokeColorProperty);
46
            }
47
            set
48
            {
49
                SetValue(StrokeColorProperty, value);
50
                OnPropertyChanged("StrokeColor");
51
            }
52
        }
53

    
54
        public Double LineSize
55
        {
56
            get
57
            {
58
                return (Double)GetValue(LineSizeProperty);
59
            }
60
            set
61
            {
62
                SetValue(LineSizeProperty, value);
63
                OnPropertyChanged("LineSize");
64
            }
65
        }
66

    
67
        public Geometry PathData
68
        {
69
            get
70
            {
71
                return (Geometry)GetValue(PathDataProperty);
72
            }
73
            set
74
            {
75
                SetValue(PathDataProperty, value);
76
                OnPropertyChanged("PathData");
77
            }
78

    
79
        }
80

    
81
        public Geometry OverViewPathData
82
        {
83
            get
84
            {
85
                return (Geometry)GetValue(OverViewPathDataProperty);
86
            }
87
            set
88
            {
89
                SetValue(OverViewPathDataProperty, value);
90
                OnPropertyChanged("OverViewPathData");
91
            }
92
        }
93

    
94
        public SolidColorBrush FillColor
95
        {
96
            get { return (SolidColorBrush)GetValue(FillColorProperty); }
97
            set
98
            {
99
                SetValue(FillColorProperty, value);
100
                OnPropertyChanged("FillColor");
101
            }
102
        }
103
		//강인구 추가
104
        public DoubleCollection DashSize
105
        {
106
            get { return (DoubleCollection)GetValue(DashSizeProperty); }
107
            set
108
            {
109
                if (this.DashSize != value)
110
                {
111
                    SetValue(DashSizeProperty, value);
112
                }
113
            }
114
        }
115

    
116
        public Point StartPoint
117
        {
118
            get
119
            {
120
                return (Point)GetValue(StartPointProperty);
121
            }
122
            set
123
            {
124
                SetValue(StartPointProperty, value);
125
                OnPropertyChanged("StartPoint");
126
            }
127
        }
128

    
129
        public Point SetPoint
130
        {
131
            get
132
            {
133
                return (Point)GetValue(SetPointProperty);
134
            }
135
            set
136
            {
137
                SetValue(SetPointProperty, value);
138
                OnPropertyChanged("SetPoint");
139
            }
140
        }
141

    
142
        public Point OriginPoint
143
        {
144
            get
145
            {
146
                return (Point)GetValue(OriginPointProperty);
147
            }
148
            set
149
            {
150
                SetValue(OriginPointProperty, value);
151
                OnPropertyChanged("OriginPoint");
152
            }
153
        }
154

    
155
        public Point TopRightPoint
156
        {
157
            get
158
            {
159
                return (Point)GetValue(TopRightPointProperty);
160
            }
161
            set
162
            {
163
                SetValue(TopRightPointProperty, value);
164
                OnPropertyChanged("TopRightPoint");
165
            }
166
        }
167

    
168
        public Point LeftBottomPoint
169
        {
170
            get
171
            {
172
                return (Point)GetValue(LeftBottomPointProperty);
173
            }
174
            set
175
            {
176
                SetValue(LeftBottomPointProperty, value);
177
                OnPropertyChanged("LeftBottomPoint");
178
            }
179
        }
180

    
181
        public Point EndPoint
182
        {
183
            get
184
            {
185
                return (Point)GetValue(EndPointProperty);
186
            }
187
            set
188
            {
189
                SetValue(EndPointProperty, value);
190
                OnPropertyChanged("EndPoint");
191
            }
192
        }
193

    
194
        public override bool IsSelected
195
        {
196
            get
197
            {
198
                return (bool)GetValue(IsSelectedProperty);
199
            }
200
            set
201
            {
202
                SetValue(IsSelectedProperty, value);
203
                OnPropertyChanged("IsSelected");
204
            }
205
        }
206

    
207
        public override ControlType ControlType
208
        {
209
            set
210
            {
211
                SetValue(ControlTypeProperty, value);
212
                OnPropertyChanged("ControlType");
213
            }
214
            get
215
            {
216
                return (ControlType)GetValue(ControlTypeProperty);
217
            }
218
        }
219

    
220
        public List<Point> PointSet
221
        {
222
            get { return (List<Point>)GetValue(PointSetProperty); }
223
            set { SetValue(PointSetProperty, value); }
224
        }
225

    
226

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

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

    
253
        public PaintSet Paint
254
        {
255
            get { return (PaintSet)GetValue(PaintProperty); }
256
            set
257
            {
258
                if (this.Paint != value)
259
                {
260
                    SetValue(PaintProperty, value);
261
                }
262
            }
263
        }
264

    
265
        public double CommentAngle
266
        {
267
            get { return (double)GetValue(AngleProperty); }
268
            set
269
            {
270
                if (this.CommentAngle != value)
271
                {
272
                    SetValue(AngleProperty, value);
273
                }
274
            }
275
        }
276
        public string UserID
277
        {
278
            get { return (string)GetValue(UserIDProperty); }
279
            set
280
            {
281
                if (this.UserID != value)
282
                {
283
                    SetValue(UserIDProperty, value);
284
                    OnPropertyChanged("UserID");
285
                }
286
            }
287
        }
288

    
289
        #endregion
290

    
291
        #region Dependency Property
292

    
293

    
294
        public static readonly DependencyProperty UserIDProperty = DependencyProperty.Register(
295
        "UserID", typeof(string), typeof(RectangleControl), new PropertyMetadata(null));
296

    
297
        public static readonly DependencyProperty mousemodeProperty =
298
                DependencyProperty.Register("mousemode", typeof(MouseMode), typeof(RectCloudControl), new PropertyMetadata(MouseMode.None, PointValueChanged));
299

    
300
        public static readonly DependencyProperty IsSelectedProperty =
301
          DependencyProperty.Register("IsSelected", typeof(bool), typeof(RectangleControl), new FrameworkPropertyMetadata(false, IsSelectedChanged));
302

    
303
        public static readonly DependencyProperty ControlTypeProperty =
304
                DependencyProperty.Register("ControlType", typeof(ControlType), typeof(RectangleControl), new FrameworkPropertyMetadata(ControlType.Rectangle));
305

    
306
        public static readonly DependencyProperty StrokeColorProperty = DependencyProperty.Register(
307
                "StrokeColor", typeof(SolidColorBrush), typeof(RectangleControl), new PropertyMetadata(new SolidColorBrush(Colors.Red)));
308

    
309
        public static readonly DependencyProperty LineSizeProperty = DependencyProperty.Register(
310
              "LineSize", typeof(double), typeof(RectangleControl), new PropertyMetadata((Double)3));
311

    
312
        //강인구 추가
313
        public static readonly DependencyProperty DashSizeProperty = DependencyProperty.Register(
314
                "DashSize", typeof(DoubleCollection), typeof(RectangleControl), new PropertyMetadata(new DoubleCollection { 1, 1 }, PointValueChanged));
315
        public static readonly DependencyProperty PathDataProperty = DependencyProperty.Register(
316
               "PathData", typeof(Geometry), typeof(RectangleControl), null);
317

    
318
        public static readonly DependencyProperty OverViewPathDataProperty = DependencyProperty.Register(
319
               "OverViewPathData", typeof(Geometry), typeof(RectangleControl), null);
320

    
321
        //강인구 추가
322
        public static readonly DependencyProperty PaintProperty = DependencyProperty.Register(
323
        "Paint", typeof(PaintSet), typeof(RectangleControl), new PropertyMetadata(PaintSet.None, PointValueChanged));
324

    
325

    
326
        public static readonly DependencyProperty FillColorProperty = DependencyProperty.Register(
327
                "FillColor", typeof(SolidColorBrush), typeof(RectangleControl), new PropertyMetadata(new SolidColorBrush(Colors.White)));
328

    
329
        public static readonly DependencyProperty CanvasXProperty = DependencyProperty.Register(
330
                 "CanvasX", typeof(double), typeof(RectangleControl), new PropertyMetadata((double)0, OnSetCansvasChanged));
331

    
332
        public static readonly DependencyProperty CanvasYProperty = DependencyProperty.Register(
333
                "CanvasY", typeof(double), typeof(RectangleControl), new PropertyMetadata((double)0, OnSetCansvasChanged));
334

    
335
        public static readonly DependencyProperty TopRightPointProperty = DependencyProperty.Register(
336
               "TopRightPoint", typeof(Point), typeof(RectangleControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
337

    
338
        public static readonly DependencyProperty LeftBottomPointProperty = DependencyProperty.Register(
339
                 "LeftBottomPoint", typeof(Point), typeof(RectangleControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
340

    
341
        public static readonly DependencyProperty StartPointProperty = DependencyProperty.Register(
342
            "StartPoint", typeof(Point), typeof(RectangleControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
343

    
344
        public static readonly DependencyProperty SetPointProperty = DependencyProperty.Register(
345
        "SetPoint", typeof(Point), typeof(RectangleControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
346

    
347
        public static readonly DependencyProperty OriginPointProperty = DependencyProperty.Register(
348
        "OriginPoint", typeof(Point), typeof(RectangleControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
349
        public static readonly DependencyProperty AngleProperty = DependencyProperty.Register(
350
            "Angle", typeof(double), typeof(RectangleControl), new PropertyMetadata((double)0.0, new PropertyChangedCallback(AngleValueChanged)));
351
        public static readonly DependencyProperty PointSetProperty = DependencyProperty.Register(
352
         "PointSet", typeof(List<Point>), typeof(RectangleControl), new PropertyMetadata(new List<Point>()));
353

    
354
        public static readonly DependencyProperty EndPointProperty = DependencyProperty.Register(
355
              "EndPoint", typeof(Point), typeof(RectangleControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
356

    
357
        #endregion  Dependency Property
358

    
359
        #region Dependency PropertyChanged
360
        public static void OnSetCansvasChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
361
        {
362
            var instance = (RectangleControl)sender;
363

    
364
            if (e.OldValue != e.NewValue && instance != null)
365
            {
366
                instance.SetValue(e.Property, e.NewValue);
367
                Canvas.SetLeft(instance, instance.SetPoint.X);
368
                Canvas.SetTop(instance, instance.SetPoint.Y);
369
                //Canvas.SetLeft(instance, instance.CanvasX);
370
                //Canvas.SetTop(instance, instance.CanvasY);
371
            }
372
        }
373

    
374

    
375
        public static void OnUpdateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
376
        {
377
            var instance = (RectangleControl)sender;
378

    
379
            if (e.OldValue != e.NewValue && instance != null)
380
            {
381
                instance.SetValue(e.Property, e.NewValue);
382
                instance.SetRectPath();
383
            }
384
        }
385

    
386
        public static void AngleValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
387
        {
388
            var instance = (RectangleControl)sender;
389
            if (e.OldValue != e.NewValue && instance.Base_RectPath != null)
390
            {
391
                instance.SetValue(e.Property, e.NewValue);
392
                instance.SetRectPath();
393
            }
394
        }
395

    
396
        public static void IsSelectedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
397
        {
398
            //var instance = (RectangleControl)sender;
399

    
400
            //if (e.OldValue != e.NewValue && instance.Base_RectPath != null)
401
            //{
402
            //    instance.SetValue(e.Property, e.NewValue);
403

    
404
            //    if (instance.IsSelected)
405
            //    {
406
            //        instance.Base_RectPath.Stroke = new SolidColorBrush(Colors.Blue);
407
            //    }
408
            //    else
409
            //    {
410
            //        instance.Base_RectPath.Stroke = new SolidColorBrush(Colors.Red);
411
            //    }
412
            //}
413
        }
414

    
415
        public static void PointValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
416
        {
417
            var instance = (RectangleControl)sender;
418

    
419
            if (e.OldValue != e.NewValue && instance.Base_RectPath != null)
420
            {
421
                instance.SetValue(e.Property, e.NewValue);
422
                instance.SetRectPath();
423
            }
424
        }
425
        #endregion Dependency PropertyChanged
426

    
427
        private void SetRectPath()
428
        {
429
            this.ApplyTemplate();
430

    
431
            if (Base_RectPath != null)
432
            {
433
                //강인구 추가
434
                Base_RectPath.StrokeDashArray.Clear();
435
                if (DashSize != null)
436
                {
437
                    foreach (var item in this.DashSize)
438
                    {
439
                        Base_RectPath.StrokeDashArray.Add(item);
440
                    }
441
                    Base_RectPath.StrokeDashCap = PenLineCap.Square;
442
                }
443

    
444
                PathFigure pathFigure = new PathFigure
445
                {
446
                    IsClosed = true
447
                };
448

    
449
                if ((this.ControlType == ControlType.Rectangle) || (this.ControlType == ControlType.Mark))
450
                {
451
                    switch (this.Paint)
452
                    {
453
                        case PaintSet.None:
454
                            this.FillColor = null;
455
                            pathFigure.IsFilled = false;
456
                            break;
457
                        case PaintSet.Fill:
458
                            this.FillColor = this.StrokeColor;
459
                            Base_RectPath.Fill = this.FillColor;
460
                            pathFigure.IsFilled = true;
461
                            break;
462
                        case PaintSet.Hatch:
463
                            Base_RectPath.Fill = HatchMake.CreateHatchBrush(this.StrokeColor);
464
                            pathFigure.IsFilled = true;
465
                            break;
466
                        default:
467
                            {
468

    
469
                            }
470
                            break;
471
                    }
472
                }
473

    
474
                pathFigure.StartPoint = this.StartPoint;
475

    
476
                List<Point> points = new List<Point>() { this.LeftBottomPoint, this.EndPoint, this.TopRightPoint, this.StartPoint };
477
                PolyLineSegment polyline = new PolyLineSegment(points, true);
478
                pathFigure.Segments.Add(polyline);
479

    
480
                PathGeometry pathGeometry = new PathGeometry();
481
                pathGeometry.Figures = new PathFigureCollection();
482
                pathGeometry.Figures.Add(pathFigure);
483

    
484
                //Base_RectPath.StrokeThickness = 3;
485
                this.FillColor = null;
486
                this.PathData = pathGeometry;
487
                ApplyOverViewData();
488
                //OverViewPathData = PathData;
489
                //AdornerControl adornerControl = new Adorner.AdornerControl();
490
                ////adornerControl
491

    
492
                //adornerthis.Content = pathGeometry;
493

    
494
            }
495
        }
496

    
497
        public override void ApplyOverViewData()
498
        {
499
            this.OverViewPathData = this.PathData;
500
        }
501

    
502
        #region Internal Method
503

    
504

    
505
        static RectangleControl()
506
        {
507
            DefaultStyleKeyProperty.OverrideMetadata(typeof(RectangleControl), new FrameworkPropertyMetadata(typeof(RectangleControl)));
508
            //ResourceDictionary dictionary = new ResourceDictionary();
509
            //dictionary.Source = new Uri("/MarkupToPDF;component/themes/generic.xaml", UriKind.RelativeOrAbsolute);
510
            //Application.Current.Resources.MergedDictionaries.Add(dictionary);
511
        }
512

    
513

    
514
        public override void OnApplyTemplate()
515
        {
516
            base.OnApplyTemplate();
517

    
518
            Base_RectPath = GetTemplateChild(PART_RectPath) as Path;
519

    
520

    
521
            if (Base_RectPath == null)
522
                return;
523

    
524
            SetRectPath();
525
            Base_RectPath.Focus();
526
        }
527

    
528
        public override void UpdateControl()
529
        {
530
            this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y);
531
            this.LeftBottomPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y);
532
            this.EndPoint = new Point(this.PointSet[2].X, this.PointSet[2].Y);
533
            this.TopRightPoint = new Point(this.PointSet[3].X, this.PointSet[3].Y);
534
        }
535

    
536
        private void OnPropertyChanged(string name)
537
        {
538
            if (PropertyChanged != null)
539
            {
540
                PropertyChanged(this, new PropertyChangedEventArgs(name));
541
            }
542
        }
543

    
544
        public void ChangePaint(PaintSet state)
545
        {
546
            this.Paint = state;
547
            this.SetRectPath();
548
        }
549

    
550
        public event PropertyChangedEventHandler PropertyChanged;
551

    
552
        /// <summary>
553
        /// call when mouse is moving while drawing control
554
        /// </summary>
555
        /// <author>humkyung</author>
556
        /// <param name="pt"></param>
557
        /// <param name="bAxisLocked"></param>
558
        public override void OnCreatingMouseMove(Point pt, bool bAxisLocked, bool bShiftKeyPressed)
559
        {
560
            this.EndPoint = bShiftKeyPressed ? this.GetSquareEndPoint(this.StartPoint, pt) : pt;
561
            this.LeftBottomPoint = new Point(this.StartPoint.X, this.EndPoint.Y);
562
            this.TopRightPoint = new Point(this.EndPoint.X, this.StartPoint.Y);
563

    
564
            this.PointSet = new List<Point>
565
            {
566
                this.StartPoint,
567
                this.LeftBottomPoint,
568
                this.EndPoint,
569
                this.TopRightPoint,
570
            };
571
        }
572

    
573
        /// <summary>
574
        /// move control point has same location of given pt along given delta
575
        /// </summary>
576
        /// <author>humkyung</author>
577
        /// <date>2019.06.20</date>
578
        /// <param name="pt"></param>
579
        /// <param name="dx"></param>
580
        /// <param name="dy"></param>
581
        public override void OnMoveCtrlPoint(Point pt, double dx, double dy)
582
        {
583
            IPath path = (this as IPath);
584

    
585
            Point selected = MathSet.getNearPoint(path.PointSet, pt);
586
            selected.X += dx;
587
            selected.Y += dy;
588
            int i = 0;
589
            for (i = 0; i < (this as IPath).PointSet.Count; i++)
590
            {
591
                if (pt.Equals((this as IPath).PointSet[i]))
592
                {
593
                    (this as IPath).PointSet[i] = selected;
594
                    break;
595
                }
596
            }
597

    
598
            var ReverseP = (i + path.PointSet.Count() / 2) % path.PointSet.Count();
599
            var PreviousP = (i + (path.PointSet.Count() - 1)) % path.PointSet.Count();
600
            var NextP = (i + 1) % path.PointSet.Count();
601

    
602
            var distance = MathSet.DistanceTo(path.PointSet[ReverseP], path.PointSet[i]);
603

    
604
            var PreviousV = MathSet.GetNormVectorBetween(path.PointSet[ReverseP], path.PointSet[PreviousP]);
605
            var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, path.PointSet[i].X - path.PointSet[ReverseP].X,
606
                path.PointSet[i].Y - path.PointSet[ReverseP].Y);
607
            path.PointSet[PreviousP] = new Point(path.PointSet[ReverseP].X + PreviousV.X * l, path.PointSet
608
                [ReverseP].Y + PreviousV.Y * l);
609

    
610
            var NextV = MathSet.GetNormVectorBetween(path.PointSet[ReverseP], path.PointSet[NextP]);
611
            l = MathSet.DotProduct(NextV.X, NextV.Y, path.PointSet[i].X - path.PointSet[ReverseP].X, path.PointSet
612
                [i].Y - path.PointSet[ReverseP].Y);
613
            path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l);
614

    
615
            this.UpdateControl();
616
        }
617

    
618
        /// <summary>
619
        /// return rectanglecontrols' area
620
        /// </summary>
621
        public override Rect ItemRect
622
        {
623
            get
624
            {
625
                double dMinX = Math.Min(this.StartPoint.X, this.EndPoint.X);
626
                double dMinY = Math.Min(this.StartPoint.Y, this.EndPoint.Y);
627
                double dMaxX = Math.Max(this.StartPoint.X, this.EndPoint.X);
628
                double dMaxY = Math.Max(this.StartPoint.Y, this.EndPoint.Y);
629

    
630
                return new Rect(new Point(dMinX, dMinY), new Point(dMaxX, dMaxY));
631
            }
632
        }
633

    
634
        /// <summary>
635
        /// Serialize this
636
        /// </summary>
637
        /// <param name="sUserId"></param>
638
        /// <returns></returns>
639
        public override string Serialize()
640
        {
641
            using (S_RectControl STemp = new S_RectControl())
642
            {
643
                STemp.TransformPoint = "0|0";
644
                STemp.SizeSet = String.Format("{0}", this.LineSize);
645
                STemp.PaintState = this.Paint;
646
                STemp.PointSet = this.PointSet;
647
                //STemp.StrokeColor = "#FF00FF00";
648
                STemp.StrokeColor = this.StrokeColor.Color.ToString();
649
                if (this.FillColor != null)
650
                {
651
                    STemp.FillColor = this.FillColor.Color.ToString();
652
                }
653
                STemp.StartPoint = this.StartPoint;
654
                STemp.UserID = this.UserID;
655
                //STemp.Angle = this.a;
656
                STemp.EndPoint = this.EndPoint;
657
                STemp.LB = this.LeftBottomPoint;
658
                STemp.TR = this.TopRightPoint;
659
                STemp.DashSize = this.DashSize;
660
                STemp.Opac = this.Opacity;
661
                STemp.Name = this.GetType().Name.ToString();
662
                ///강인구 추가(2017.11.02)
663
                ///Memo 추가
664
                STemp.Memo = this.Memo;
665

    
666
                return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
667
            };
668
        }
669

    
670
        /// <summary>
671
        /// create a rectanglecontrol from given string
672
        /// </summary>
673
        /// <param name="item"></param>
674
        /// <returns></returns>
675
        public static RectangleControl FromString(string str, SolidColorBrush brush, string sProjectNo)
676
        {
677
            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(str))
678
            {
679
                string[] data2 = s.SizeSet.Split(CommentUserInfo.delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
680
                return new RectangleControl
681
                {
682
                    LineSize = Convert.ToDouble(data2.First()),
683
                    Paint = s.PaintState,
684
                    StartPoint = s.StartPoint,
685
                    EndPoint = s.EndPoint,
686
                    CommentAngle = s.Angle,
687
                    StrokeColor = brush,
688
                    DashSize = s.DashSize,
689
                    Opacity = s.Opac,
690
                    LeftBottomPoint = s.LB,
691
                    TopRightPoint = s.TR,
692
                    PointSet = s.PointSet,
693
                    UserID = s.UserID,
694
                    Memo = s.Memo
695
                };
696
            }
697
        }
698

    
699
        public void Dispose()
700
        {
701
            //GC.Collect();
702
            //GC.SuppressFinalize(this);
703
            this.Base_RectPath = null;
704
        }
705
        #endregion Internal Method
706
    }
707
}
클립보드 이미지 추가 (최대 크기: 500 MB)