프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Etc / DateControl.cs @ ac4f1e13

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

1 787a4489 KangIngu
using System;
2
using System.Net;
3
using System.Windows;
4
using System.Windows.Controls;
5
using System.Windows.Documents;
6
using System.Windows.Ink;
7
using System.Windows.Input;
8
using System.Windows.Media;
9
using System.Windows.Media.Animation;
10
using System.Windows.Shapes;
11
using System.ComponentModel;
12
using System.Collections.Generic;
13
using MarkupToPDF.Controls.Common;
14
using MarkupToPDF.Common;
15 036650a0 humkyung
using MarkupToPDF.Serialize.Core;
16
using MarkupToPDF.Serialize.S_Control;
17 661b7416 humkyung
using System.Linq;
18 787a4489 KangIngu
19
namespace MarkupToPDF.Controls.Etc
20
{
21
    public class DateControl : CommentUserInfo, IDisposable, IPath, INotifyPropertyChanged, IViewBox, IMarkupCommonData
22
    {
23
        private const string PART_ViewBox = "PART_ViewBox";
24
        private const string PART_TextBox = "PART_TextBox";
25
        public Viewbox Base_ViewBox = null;
26
        public TextBlock Base_TextBox = null;
27
28
        static DateControl()
29
        {
30
            DefaultStyleKeyProperty.OverrideMetadata(typeof(DateControl), new FrameworkPropertyMetadata(typeof(DateControl)));
31
            //Application.Current.Resources.MergedDictionaries.Add(Application.LoadComponent(new Uri("/MarkupToPDF;Component/Themes/generic.xaml")) as ResourceDictionary);
32 a6f7f9b6 djkim
            //ResourceDictionary dictionary = new ResourceDictionary();
33
            //dictionary.Source = new Uri("/MarkupToPDF;component/themes/generic.xaml", UriKind.RelativeOrAbsolute);
34
            //Application.Current.Resources.MergedDictionaries.Add(dictionary);
35
            //System.Diagnostics.Debug.WriteLine("resource Count :" + Application.Current.Resources.MergedDictionaries.Count);
36 787a4489 KangIngu
        }
37
     
38
        public DateControl()
39
        {
40 a6f7f9b6 djkim
            //this.DefaultStyleKey = typeof(DateControl);
41 787a4489 KangIngu
        }
42
43
44
        #region Dependency Properties
45
46
47
        public static readonly DependencyProperty IsSelectedProperty =
48
            DependencyProperty.Register("IsSelected", typeof(bool), typeof(DateControl), new FrameworkPropertyMetadata(false, IsSelectedChanged));
49
50
        public static readonly DependencyProperty ControlTypeProperty =
51
            DependencyProperty.Register("ControlType", typeof(ControlType), typeof(DateControl), new FrameworkPropertyMetadata(ControlType.Date));
52
53
        public static readonly DependencyProperty OverViewPathDataProperty = DependencyProperty.Register(
54
        "OverViewPathData", typeof(Geometry), typeof(DateControl), null);
55
56
        public static readonly DependencyProperty OverViewStartPointProperty = DependencyProperty.Register(
57
        "OverViewStartPoint", typeof(Point), typeof(DateControl), new PropertyMetadata(null));
58
59
        public static readonly DependencyProperty OverViewEndPointProperty = DependencyProperty.Register(
60
                "OverViewEndPoint", typeof(Point), typeof(DateControl), new PropertyMetadata(null));
61
62
63
        public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
64
                "Text", typeof(string), typeof(DateControl), new PropertyMetadata(null));
65
        public static readonly DependencyProperty UserIDProperty = DependencyProperty.Register(
66
                "UserID", typeof(string), typeof(DateControl), new PropertyMetadata(null));
67
        public static readonly DependencyProperty FontColorProperty = DependencyProperty.Register(
68
               "FontColor", typeof(SolidColorBrush), typeof(DateControl), new PropertyMetadata(new SolidColorBrush(Colors.Red)));
69
        //[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
70
        public static readonly DependencyProperty StartPointProperty = DependencyProperty.Register(
71
              "StartPoint", typeof(Point), typeof(DateControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
72
        public static readonly DependencyProperty EndPointProperty = DependencyProperty.Register(
73
               "EndPoint", typeof(Point), typeof(DateControl), new PropertyMetadata(new Point(100, 100), PointValueChanged));
74
        public static readonly DependencyProperty LineSizeProperty = DependencyProperty.Register(
75
               "LineSize", typeof(double), typeof(DateControl), new PropertyMetadata((double)3));
76
        public static readonly DependencyProperty TopRightPointProperty = DependencyProperty.Register(
77
                "TopRightPoint", typeof(Point), typeof(DateControl), new PropertyMetadata(new Point(0, 0), TRPointValueChanged));
78
        public static readonly DependencyProperty PointSetProperty = DependencyProperty.Register(
79
                "PointSet", typeof(List<Point>), typeof(DateControl), new PropertyMetadata(new List<Point>()));
80
        public static readonly DependencyProperty LeftBottomPointProperty = DependencyProperty.Register(
81
                 "LeftBottomPoint", typeof(Point), typeof(DateControl), new PropertyMetadata(new Point(0, 0), LBPointValueChanged));
82
        public static readonly DependencyProperty PathDataProperty = DependencyProperty.Register(
83
                "PathData", typeof(Geometry), typeof(DateControl), null);
84
        public static readonly DependencyProperty AngleProperty = DependencyProperty.Register("Angle", typeof(double), typeof(DateControl),
85
            new PropertyMetadata((double)0.0, new PropertyChangedCallback(AngleValueChanged)));
86
87
        public static readonly DependencyProperty CenterXProperty = DependencyProperty.Register("CenterX", typeof(double), typeof(DateControl),
88
            new PropertyMetadata((double)0, OnCenterXYChanged));
89
90
        public static readonly DependencyProperty CenterYProperty = DependencyProperty.Register("CenterY", typeof(double), typeof(DateControl),
91
            new PropertyMetadata((double)0, OnCenterXYChanged));
92
93
        #endregion
94
        #region PropertyChanged Method
95
        public static void IsSelectedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
96
        {
97
            //var instance = (DateControl)sender;
98
99
            //if (e.OldValue != e.NewValue && instance.Base_ViewBox != null)
100
            //{
101
102
            //    instance.SetValue(e.Property, e.NewValue);
103
104
            //    if (instance.IsSelected)
105
            //    {
106
            //        //instance.Base_ViewBox.Style. = new SolidColorBrush(Colors.Blue);
107
            //    }
108
            //    else
109
            //    {
110
            //        //instance.Base_ViewBox.Stroke = new SolidColorBrush(Colors.Red);
111
            //    }
112
            //}
113
        }
114
115
        public static void PointValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
116
        {
117
            var instance = (DateControl)sender;
118
            if (e.OldValue != e.NewValue && instance.Base_TextBox != null)
119
            {
120
                instance.SetValue(e.Property, e.NewValue);
121
                instance.SetDate();
122
            }
123
        }
124
        public static void LBPointValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
125
        {
126
            var instance = (DateControl)sender;
127
            if (e.OldValue != e.NewValue && instance.Base_TextBox != null)
128
            {
129
                instance.SetValue(e.Property, e.NewValue);
130
                //instance.EndPoint = new Point(instance.EndPoint.X, ((Point)e.NewValue).Y);
131
                //instance.StartPoint = new Point(((Point)e.NewValue).X, instance.StartPoint.Y);
132
                ////instance.PointSet[0] = instance.StartPoint;
133
                ////instance.PointSet[2] = instance.EndPoint;
134
                instance.SetDate();
135
            }
136
        }
137
        public static void TRPointValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
138
        {
139
            var instance = (DateControl)sender;
140
            if (e.OldValue != e.NewValue && instance.Base_TextBox != null)
141
            {
142
                instance.SetValue(e.Property, e.NewValue);
143
                instance.SetDate();
144
            }
145
        }
146
        public static void OnCenterXYChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
147
        {
148
            var instance = (DateControl)sender;
149
            if (e.OldValue != e.NewValue && instance.Base_ViewBox != null)
150
            {
151
                instance.SetValue(e.Property, e.NewValue);
152
                instance.SetDate();
153
            }
154
        }
155
156
        public static void AngleValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
157
        {
158
            var instance = (DateControl)sender;
159
            if (e.OldValue != e.NewValue && instance.Base_ViewBox != null)
160
            {
161
                instance.SetValue(e.Property, e.NewValue);
162
                instance.SetDate();
163
            }
164
        }
165
        #endregion
166
        #region Properties
167
        public double LineSize
168
        {
169
            get { return (double)GetValue(LineSizeProperty); }
170
            set
171
            {
172
                if (this.LineSize != value)
173
                {
174
                    SetValue(LineSizeProperty, value);
175
                    OnPropertyChanged("LineSize");
176
                }
177
            }
178
        }
179
        public string UserID
180
        {
181
            get { return (string)GetValue(UserIDProperty); }
182
            set
183
            {
184
                if (this.UserID != value)
185
                {
186
                    SetValue(UserIDProperty, value);
187
                    OnPropertyChanged("UserID");
188
                }
189
            }
190
        }
191 554aae3b humkyung
192 fa48eb85 taeseongkim
        public override double CommentAngle
193 787a4489 KangIngu
        {
194
            get { return (double)GetValue(AngleProperty); }
195
            set
196
            {
197 fa48eb85 taeseongkim
                if (this.CommentAngle != value)
198 787a4489 KangIngu
                {
199
                    SetValue(AngleProperty, value);
200
                }
201
            }
202
        }
203
204 959b3ef2 humkyung
        public override bool IsSelected
205 787a4489 KangIngu
        {
206
            get
207
            {
208
                return (bool)GetValue(IsSelectedProperty);
209
            }
210
            set
211
            {
212
                SetValue(IsSelectedProperty, value);
213
                OnPropertyChanged("IsSelected");
214
            }
215
        }
216
217 5529d2a2 humkyung
        public override ControlType ControlType
218 787a4489 KangIngu
        {
219
            set
220
            {
221
                SetValue(ControlTypeProperty, value);
222
                OnPropertyChanged("ControlType");
223
            }
224
            get
225
            {
226
                return (ControlType)GetValue(ControlTypeProperty);
227
            }
228
        }
229
230
        public Geometry OverViewPathData
231
        {
232
            get { return (Geometry)GetValue(OverViewPathDataProperty); }
233
            set
234
            {
235
                SetValue(OverViewPathDataProperty, value);
236
                OnPropertyChanged("OverViewPathData");
237
            }
238
        }
239
240
        public List<Point> PointSet
241
        {
242
            get { return (List<Point>)GetValue(PointSetProperty); }
243
            set { SetValue(PointSetProperty, value); }
244
        }
245
        public Point TopRightPoint
246
        {
247
            get { return (Point)GetValue(TopRightPointProperty); }
248
            set
249
            {
250
                SetValue(TopRightPointProperty, value);
251
                OnPropertyChanged("TopRightPoint");
252
            }
253
        }
254
        public Point LeftBottomPoint
255
        {
256
            get { return (Point)GetValue(LeftBottomPointProperty); }
257
            set
258
            {
259
                SetValue(LeftBottomPointProperty, value);
260
                OnPropertyChanged("LeftBottomPoint");
261
            }
262
        }
263
        public double CenterX
264
        {
265
            get { return (double)GetValue(CenterXProperty); }
266
            set { SetValue(CenterXProperty, value); }
267
        }
268
        public double CenterY
269
        {
270
            get { return (double)GetValue(CenterYProperty); }
271
            set { SetValue(CenterYProperty, value); }
272
        }
273
        public string Text
274
        {
275
            get { return (string)GetValue(TextProperty); }
276
            set
277
            {
278
                if (this.Text != value)
279
                {
280
                    SetValue(TextProperty, value);
281
                    OnPropertyChanged("Text");
282
                }
283
            }
284
        }
285
        public Geometry PathData
286
        {
287
            get { return (Geometry)GetValue(PathDataProperty); }
288
            set
289
            {
290
                SetValue(PathDataProperty, value);
291
                OnPropertyChanged("PathData");
292
            }
293
        }
294
        public SolidColorBrush FontColor
295
        {
296
            get { return (SolidColorBrush)GetValue(FontColorProperty); }
297
            set
298
            {
299
                if (this.FontColor != value)
300
                {
301
                    SetValue(FontColorProperty, value);
302
                    OnPropertyChanged("FontColor");
303
                }
304
305
            }
306
        }
307
        public Point EndPoint
308
        {
309
            get { return (Point)GetValue(EndPointProperty); }
310
            set
311
            {
312
                if (this.EndPoint != value)
313
                {
314
                    SetValue(EndPointProperty, value);
315
                    OnPropertyChanged("EndPoint");
316
                }
317
            }
318
        }
319
        public Point StartPoint
320
        {
321
            get { return (Point)GetValue(StartPointProperty); }
322
            set
323
            {
324
                if (this.StartPoint != value)
325
                {
326
                    SetValue(StartPointProperty, value);
327
                    OnPropertyChanged("StartPoint");
328
                }
329
            }
330
        }
331
332
        public Point OverViewStartPoint
333
        {
334
            get { return (Point)GetValue(OverViewStartPointProperty); }
335
            set { SetValue(OverViewStartPointProperty, value); }
336
        }
337
338
        public Point OverViewEndPoint
339
        {
340
            get { return (Point)GetValue(OverViewEndPointProperty); }
341
            set { SetValue(OverViewEndPointProperty, value); }
342
        }
343
344
        //public int MyProperty { get; set; }
345
346
347
        #endregion
348
        #region Data
349
        LineGeometry p1 = new LineGeometry();
350
        LineGeometry p2 = new LineGeometry();
351
        LineGeometry p3 = new LineGeometry();
352
        LineGeometry p4 = new LineGeometry();
353
        GeometryGroup instanceGroup = new GeometryGroup();
354
        FormattedText text;
355
        #endregion
356
        public override void OnApplyTemplate()
357
        {
358
            base.OnApplyTemplate();
359
            Base_ViewBox = GetTemplateChild(PART_ViewBox) as Viewbox;
360
            Base_TextBox = GetTemplateChild(PART_TextBox) as TextBlock;
361
            Base_TextBox.Visibility = System.Windows.Visibility.Hidden;
362
            SetDate();
363
        }
364 661b7416 humkyung
365
        private void SetDate()
366 787a4489 KangIngu
        {
367
            if (Text == null)
368
            {
369
                Text = DateTime.Now.ToString("yyyy-MM-dd");
370
            }
371
            this.ApplyTemplate();
372
            instanceGroup.Children.Clear();
373
            Base_TextBox.Visibility = System.Windows.Visibility.Visible;
374
            Point mid = MathSet.FindCentroid(new List<Point>()
375
            {
376
                this.StartPoint,
377
                this.LeftBottomPoint,
378
                this.EndPoint,
379
                this.TopRightPoint,                
380
            });
381
382
383 fa48eb85 taeseongkim
            double AngleData = this.CommentAngle * -1;
384 787a4489 KangIngu
385
            PathFigure pathFigure = new PathFigure();
386
            pathFigure.StartPoint = MathSet.RotateAbout(mid, this.StartPoint, AngleData);
387
388
            LineSegment lineSegment0 = new LineSegment();
389
            lineSegment0.Point = MathSet.RotateAbout(mid, this.StartPoint, AngleData);
390
            pathFigure.Segments.Add(lineSegment0);
391
392
            LineSegment lineSegment1 = new LineSegment();
393
            lineSegment1.Point = MathSet.RotateAbout(mid, this.LeftBottomPoint, AngleData);
394
            pathFigure.Segments.Add(lineSegment1);
395
396
            LineSegment lineSegment2 = new LineSegment();
397
            lineSegment2.Point = MathSet.RotateAbout(mid, this.EndPoint, AngleData);
398
            pathFigure.Segments.Add(lineSegment2);
399
400
            LineSegment lineSegment3 = new LineSegment();
401
            lineSegment3.Point = MathSet.RotateAbout(mid, this.TopRightPoint, AngleData);
402
            pathFigure.Segments.Add(lineSegment3);
403
404
            PathGeometry pathGeometry = new PathGeometry();
405
            pathGeometry.Figures = new PathFigureCollection();
406
            pathFigure.IsClosed = true;
407
            pathGeometry.Figures.Add(pathFigure);
408
            this.Base_ViewBox.Width = pathGeometry.Bounds.Width;
409
            this.Base_ViewBox.Height = pathGeometry.Bounds.Height;
410
            this.Tag = pathGeometry;
411
412
            Canvas.SetLeft(this, MathSet.RotateAbout(mid, mid, AngleData).X - this.Base_ViewBox.Width / 2);
413
            Canvas.SetTop(this, MathSet.RotateAbout(mid, mid, AngleData).Y - this.Base_ViewBox.Height / 2);
414
415
            //CenterX = MathSet.RotateAbout(mid, mid, AngleData).X - this.Base_ViewBox.Width / 2;
416
            //CenterY = MathSet.RotateAbout(mid, mid, AngleData).Y - this.Base_ViewBox.Height / 2;
417
418
            instanceGroup.Children.Add(pathGeometry);
419
420
            text = new FormattedText(Text, System.Globalization.CultureInfo.CurrentCulture,
421
                 FlowDirection.LeftToRight, new Typeface("Tahoma"), 16, Brushes.Black);
422
423
            instanceGroup.Children.Add(text.BuildGeometry(new Point(10,10)));
424
425
            PathData = instanceGroup;
426
            //OverViewPathData = PathData;
427
428
429
        }
430
431
        public event PropertyChangedEventHandler PropertyChanged;
432
        protected void OnPropertyChanged(string propName)
433
        {
434
            if (PropertyChanged != null)
435
                PropertyChanged(this, new PropertyChangedEventArgs(propName));
436
        }
437
438
        public void Dispose()
439
        {
440 a6f7f9b6 djkim
            //GC.Collect();
441
            //GC.SuppressFinalize(this);
442
            this.Base_TextBox = null;
443
            this.Base_ViewBox = null;
444 787a4489 KangIngu
        }
445
446 f513c215 humkyung
        public override void ApplyOverViewData()
447 787a4489 KangIngu
        {
448
            //this.OverViewPathData = this.PathData;
449
            this.OverViewStartPoint = this.StartPoint;
450
            this.OverViewEndPoint = this.EndPoint;
451
        }
452
453 0d00f9c8 humkyung
        public override void UpdateControl()
454 787a4489 KangIngu
        {
455
            this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y);
456
            this.TopRightPoint = new Point(this.PointSet[3].X, this.PointSet[3].Y);
457
            this.LeftBottomPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y);
458
            this.EndPoint = new Point(this.PointSet[2].X, this.PointSet[2].Y);
459
            this.SetDate();
460
        }
461 036650a0 humkyung
462
        /// <summary>
463 a6272c57 humkyung
        /// call when mouse is moving while drawing control
464
        /// </summary>
465
        /// <author>humkyung</author>
466
        /// <param name="pt"></param>
467
        /// <param name="bAxisLocked"></param>
468
        public override void OnCreatingMouseMove(Point pt, bool bAxisLocked, bool bShiftKeyPressed)
469
        {
470
            this.EndPoint = pt;
471
            this.LeftBottomPoint = new Point(this.StartPoint.X, this.EndPoint.Y);
472
            this.TopRightPoint = new Point(this.EndPoint.X, this.StartPoint.Y);
473
474
            this.PointSet = new List<Point>
475
            {
476
                this.StartPoint,
477
                this.LeftBottomPoint,
478
                this.EndPoint,
479
                this.TopRightPoint,
480
            };
481
        }
482
483
        /// <summary>
484 d2114d3b humkyung
        /// move control point has same location of given pt along given delta
485
        /// </summary>
486
        /// <author>humkyung</author>
487
        /// <date>2019.06.20</date>
488
        /// <param name="pt"></param>
489
        /// <param name="dx"></param>
490
        /// <param name="dy"></param>
491
        public override void OnMoveCtrlPoint(Point pt, double dx, double dy)
492
        {
493
            IPath path = (this as IPath);
494
495
            Point selected = MathSet.getNearPoint(path.PointSet, pt);
496
            selected.X += dx;
497
            selected.Y += dy;
498
            int i = 0;
499
            for (i = 0; i < (this as IPath).PointSet.Count; i++)
500
            {
501
                if (pt.Equals((this as IPath).PointSet[i]))
502
                {
503
                    path.PointSet[i] = selected;
504
                    break;
505
                }
506
            }
507
508
            var ReverseP = (i + path.PointSet.Count / 2) % path.PointSet.Count;
509
            var PreviousP = (i + (path.PointSet.Count - 1)) % path.PointSet.Count;
510
            var NextP = (i + 1) % path.PointSet.Count;
511
512
            var distance = MathSet.DistanceTo(path.PointSet[ReverseP], path.PointSet[i]);
513
514
            var PreviousV = MathSet.GetNormVectorBetween(path.PointSet[ReverseP], path.PointSet[PreviousP]);
515
            var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, path.PointSet[i].X - path.PointSet[ReverseP].X,
516
                path.PointSet[i].Y - path.PointSet[ReverseP].Y);
517
            path.PointSet[PreviousP] = new Point(path.PointSet[ReverseP].X + PreviousV.X * l, path.PointSet[ReverseP].Y + PreviousV.Y * l);
518
519
            var NextV = MathSet.GetNormVectorBetween(path.PointSet[ReverseP], path.PointSet[NextP]);
520
            l = MathSet.DotProduct(NextV.X, NextV.Y, path.PointSet[i].X - path.PointSet[ReverseP].X, path.PointSet
521
                [i].Y - path.PointSet[ReverseP].Y);
522
            path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l);
523
524 0d00f9c8 humkyung
            this.UpdateControl();
525 d2114d3b humkyung
        }
526
527
        /// <summary>
528 91efe37a humkyung
        /// return DateControl's area
529
        /// </summary>
530
        /// <author>humkyung</author>
531
        /// <date>2019.06.13</date>
532
        public override Rect ItemRect
533
        {
534
            get
535
            {
536
                double dMinX = Math.Min(this.StartPoint.X, this.EndPoint.X);
537
                double dMinY = Math.Min(this.StartPoint.Y, this.EndPoint.Y);
538
                double dMaxX = Math.Max(this.StartPoint.X, this.EndPoint.X);
539
                double dMaxY = Math.Max(this.StartPoint.Y, this.EndPoint.Y);
540
541
                return new Rect(new Point(dMinX, dMinY), new Point(dMaxX, dMaxY));
542
            }
543
        }
544
545
        /// <summary>
546 036650a0 humkyung
        /// Serialize this
547
        /// </summary>
548
        /// <param name="sUserId"></param>
549
        /// <returns></returns>
550
        public override string Serialize()
551
        {
552
            using (S_DateControl STemp = new S_DateControl())
553
            {
554 fa48eb85 taeseongkim
                STemp.Angle = this.CommentAngle;
555 036650a0 humkyung
                STemp.EndPoint = this.EndPoint;
556
                STemp.UserID = this.UserID;
557
                STemp.LB = this.LeftBottomPoint;
558
                STemp.Name = this.GetType().Name;
559
                STemp.PointSet = this.PointSet;
560
                STemp.StartPoint = this.StartPoint;
561
                STemp.Opac = this.Opacity;
562
                STemp.TR = this.TopRightPoint;
563
                STemp.TransformPoint = "0|0";
564
                STemp.FontColor = this.FontColor.Color.ToString();
565
                //STemp.FontColor = "#FFFFFF00";
566
                STemp.SizeSet = String.Format("{0}", this.LineSize);
567
                STemp.Text = this.Text;
568
                ///강인구 추가(2017.11.02)
569
                ///Memo 추가
570
                STemp.Memo = this.Memo;
571
572
                return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
573
            }
574
        }
575 661b7416 humkyung
576
        /// <summary>
577
        /// create a datecontrol from given string
578
        /// </summary>
579
        /// <param name="str"></param>
580
        /// <returns></returns>
581
        public static DateControl FromString(string str, SolidColorBrush brush, string sProjectNo)
582
        {
583
            using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(str))
584
            {
585
                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
586
                return new DateControl
587
                {
588 fa48eb85 taeseongkim
                    CommentAngle = s.Angle,
589 661b7416 humkyung
                    StartPoint = s.StartPoint,
590
                    EndPoint = s.EndPoint,
591
                    LeftBottomPoint = s.LB,
592
                    TopRightPoint = s.TR,
593
                    Opacity = s.Opac,
594
                    FontColor = brush,
595
                    LineSize = Convert.ToDouble(data2.First()),
596
                    Text = s.Text,
597
                    PointSet = s.PointSet,
598
                    UserID = s.UserID,
599
                    Memo = s.Memo
600
                };
601
            }
602
        }
603 787a4489 KangIngu
    }
604
}
클립보드 이미지 추가 (최대 크기: 500 MB)