프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Text / TextControl.cs @ b2d0f316

이력 | 보기 | 이력해설 | 다운로드 (47 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.Media;
14
using System.Windows.Shapes;
15
using Markus.Fonts;
16
using System.Windows.Markup;
17

    
18
namespace MarkupToPDF.Controls.Text
19
{    
20
    public class TextControl : CommentUserInfo, IDisposable, INotifyPropertyChanged, ITextControl, IMarkupControlData
21
    {
22
        public event PropertyChangedEventHandler PropertyChanged;
23

    
24
        private const string PART_Grid = "PART_Grid";
25
        private const string PART_Border = "PART_Border";
26
        private const string PART_TextBox = "PART_TextBox";
27
        private const string PART_TextPath = "PART_TextPath";
28
        private const string PART_TextBlock = "PART_TextBlock";
29
        private const string PART_Canvas = "PART_TextControlCanvas";
30
        private const string PART_BaseTextbox_Caret = "Caret";
31
        
32
        //private const string PART_TextPrefix = "PART_TextPrefix";
33
      
34
        public Path Base_TextPath = null;
35
        public Grid Base_Grid = null;
36
        public Border Base_Border = null;
37
        public Canvas Base_Canvas = null;
38
        //public TextBlock Base_TextPrefixBlock = null;
39
        public TextBlock Base_TextBlock = null;
40
        public TextBox Base_TextBox = null;
41
        public Border BaseTextbox_Caret = null;
42

    
43
        public RotateTransform _rotation = null;
44
        public TranslateTransform _translation = null;
45
        public ScaleTransform _scale = null;
46

    
47
        private const double _CloudArcDepth = 0.8;  /// 2018.05.14 added by humkyung
48

    
49
        public override bool IsSelected
50
        {
51
            get
52
            {
53
                return (bool)GetValue(IsSelectedProperty);
54
            }
55
            set
56
            {
57
                SetValue(IsSelectedProperty, value);
58
                OnPropertyChanged("IsSelected");
59
            }
60
        }
61

    
62
        #region Internal Method
63

    
64
        public TextControl()
65
        {
66
            //this.DefaultStyleKey = typeof(TextControl);
67
        }
68

    
69
        static TextControl()
70
        {
71
            DefaultStyleKeyProperty.OverrideMetadata(typeof(TextControl), new FrameworkPropertyMetadata(typeof(TextControl)));
72
            //ResourceDictionary dictionary = new ResourceDictionary();
73
            //dictionary.Source = new Uri("/MarkupToPDF;component/Themes/generic.xaml", UriKind.RelativeOrAbsolute);
74
            //if (!Application.Current.Resources.MergedDictionaries.Any(x => x.Source == dictionary.Source))
75
            //    Application.Current.Resources.MergedDictionaries.Add(dictionary);
76

    
77
        }
78

    
79
        public override void Copy(CommentUserInfo lhs)
80
        {
81
            if(lhs is TextControl item)
82
            {
83
                Text = item.Text;
84
                StartPoint = new Point(item.StartPoint.X, item.StartPoint.Y);
85
                EndPoint = new Point(item.EndPoint.X, item.EndPoint.Y);
86
                CanvasX = item.CanvasX;
87
                CanvasY = item.CanvasY;
88
                BoxWidth = item.BoxWidth;
89
                BoxHeight = item.BoxHeight;
90
                ControlType_No = item.ControlType_No;
91
                LineSize = item.LineSize;
92
                TextSize = item.TextSize;
93
                StrokeColor = item.StrokeColor;
94
                ArcLength = item.ArcLength;
95
                FontSize = item.FontSize;
96
                UserID = item.UserID;
97
                IsHighLight = item.IsHighLight;
98
                CommentAngle = item.CommentAngle;
99
                PointSet = item.PointSet.ConvertAll(x => new Point(x.X, x.Y));
100
                Opacity = item.Opacity;
101
                TextFamily = item.FontFamily;
102
                TextStyle = item.TextStyle;
103
                TextWeight = item.TextWeight;
104
                UnderLine = item.UnderLine;
105
                Memo = item.Memo;
106
                ZIndex = item.ZIndex;
107
            }
108
        }
109

    
110
        public override CommentUserInfo Clone()
111
        {
112
            var clone = new TextControl();
113
            clone.Copy(this);
114
            return clone;
115
        }
116

    
117
        public override void OnApplyTemplate()
118
        {
119
            base.OnApplyTemplate();
120

    
121
            Base_TextPath = GetTemplateChild(PART_TextPath) as Path;
122
            Base_TextBox = GetTemplateChild(PART_TextBox) as TextBox;
123
            Base_TextBlock = GetTemplateChild(PART_TextBlock) as TextBlock;
124
            Base_Grid = GetTemplateChild(PART_Grid) as Grid;
125
            Base_Border = GetTemplateChild(PART_Border) as Border;
126
            Base_Canvas = GetTemplateChild(PART_Canvas) as Canvas;
127
            BaseTextbox_Caret = GetTemplateChild(PART_BaseTextbox_Caret) as Border;
128
            //BaseTextbox_Caret.Height = this.Base_TextBox.FontSize;
129
            this.Base_TextBox.Text = this.Text;
130
            this.Base_TextBox.CaretIndex = this.Base_TextBox.Text.Length;
131
            this.Base_TextBox.CaretBrush = new SolidColorBrush(Colors.Transparent);
132
            this.Base_TextBox.ApplyTemplate();
133
            MoveCustomCaret();
134
            if(this.Base_TextBox.FontSize > this.BaseTextbox_Caret.Height)
135
            {
136
                BaseTextbox_Caret.Height = this.Base_TextBox.FontSize;
137
            }
138
            //BaseTextbox_Caret.Height = Base_TextBox.ActualHeight - 5;
139

    
140
            this.Base_TextBox.SizeChanged += new SizeChangedEventHandler(Base_TextBox_SizeChanged);
141
            this.Base_TextBox.TextChanged += new TextChangedEventHandler(Base_TextBox_TextChanged);
142
            this.Base_TextBlock.SizeChanged += new SizeChangedEventHandler(Base_TextBlock_SizeChanged);
143
            this.Base_TextBox.GotFocus += new RoutedEventHandler(Base_TextBox_GotFocus);
144
            this.Base_TextBox.LostFocus += new RoutedEventHandler(Base_TextBox_LostFocus);            
145
            this.Base_TextBox.SelectionChanged += (sender, e) => MoveCustomCaret();
146

    
147
            SetText();
148
            DrawingCloud();
149
        }
150

    
151
        public void SetFontFamily(FontFamily fontFamily)
152
        {
153
            
154
            if (this.Base_TextBlock != null) {
155
                this.Base_TextBlock.FontFamily = fontFamily;
156
            }
157

    
158
            if (this.Base_TextBox != null) {
159
                this.Base_TextBox.FontFamily = fontFamily;
160
            }
161
            this.FontFamily = fontFamily;
162
            this.TextFamily = fontFamily;
163
        }
164

    
165

    
166
        /// <summary>
167
        /// Moves the custom caret on the canvas.
168
        /// </summary>
169
        public void MoveCustomCaret()
170
        {
171

    
172
            var caretLocation = this.Base_TextBox.GetRectFromCharacterIndex(this.Base_TextBox.CaretIndex).Location;
173

    
174
            if (!double.IsInfinity(caretLocation.X)) {
175
                Canvas.SetLeft(this.BaseTextbox_Caret, caretLocation.X);
176
            }
177

    
178
            if (!double.IsInfinity(caretLocation.Y)) {
179
                Canvas.SetTop(this.BaseTextbox_Caret, caretLocation.Y);
180
                //Canvas.SetTop(this.BaseTextbox_Caret, (LineSize.Top - caretLocation.Y));
181
            }
182
        }
183

    
184
        
185

    
186
        public override void ApplyOverViewData()
187
        {
188
            this.OverViewPathData = this.PathData;
189
            if (Text == "")
190
                this.Text = this.OverViewText;
191
            else
192
                this.OverViewText = this.Text;
193
            
194
            this.OverViewPaint = this.Paint;
195

    
196
        }        
197

    
198
        void Base_TextBox_SizeChanged(object sender, SizeChangedEventArgs e)
199
        {
200
            BoxWidth = e.NewSize.Width;
201
            BoxHeight = e.NewSize.Height;
202

    
203
            DrawingCloud();
204
        }
205
        private void Base_TextBlock_SizeChanged(object sender, SizeChangedEventArgs e)
206
        {
207
            BoxWidth = e.NewSize.Width;
208
            BoxHeight = e.NewSize.Height;
209

    
210
            DrawingCloud();
211
        }
212
        private void Base_TextBox_TextChanged(object sender, TextChangedEventArgs e)
213
        {
214
            if (IsEditingMode)
215
            {
216
                if (Base_TextBox.Text.Contains("|OR||DZ|"))
217
                {
218
                    Base_TextBox.Text = this.Text;
219
                }
220

    
221
                this.Text = Base_TextBox.Text;
222

    
223
            }            
224
            DrawingCloud();
225
        }
226
        void Base_TextBox_GotFocus(object sender, RoutedEventArgs e)
227
        {
228
            this.BaseTextbox_Caret.Visibility = Visibility.Visible;
229
            MoveCustomCaret();
230
            Base_TextBox.Focus();
231
            this.IsEditingMode = true;
232
        }
233

    
234
        void Base_TextBox_LostFocus(object sender, RoutedEventArgs e)
235
        {
236
            this.Text = Base_TextBox.Text;
237
            this.BaseTextbox_Caret.Visibility = Visibility.Collapsed;
238
            this.IsEditingMode = false;
239
            ApplyOverViewData();
240
        }
241

    
242
        //void TextControl_GotFocus(object sender, RoutedEventArgs e)
243
        //{
244
        //    Base_TextBox.Visibility = Visibility.Visible;
245
        //    Base_TextBlock.Visibility = Visibility.Collapsed;
246
        //    this.Base_TextBox.BorderThickness = new Thickness(1);
247
        //    if (UnderLine != null)
248
        //    {
249
        //        Base_TextBlock.TextDecorations = UnderLine;
250
        //    }
251
        //    if (this.Text != null)
252
        //    {
253
        //        Base_TextBox.Text = this.Text;
254
        //    }
255
        //    IsEditing = true;
256
        //}
257
        //void TextControl_LostFocus(object sender, RoutedEventArgs e)
258
        //{
259
        //    Base_TextBox.Visibility = Visibility.Collapsed;
260
        //    Base_TextBlock.Visibility = Visibility.Visible;
261
        //    this.Text = Base_TextBox.Text;
262
        //    if (UnderLine != null)
263
        //    {
264
        //        Base_TextBlock.TextDecorations = UnderLine;
265
        //    }
266
        //    Base_TextBlock.Margin =
267
        //       new Thickness(Base_TextBox.Margin.Left + 4, Base_TextBox.Margin.Top + 4, Base_TextBox.Margin.Right + 4, Base_TextBox.Margin.Bottom + 4);
268
        //    IsEditing = false;
269
        //}
270
        public void EditingMode()
271
        {            
272
            TextBoxVisibility = Visibility.Visible;
273
            TextBlockVisibility = Visibility.Collapsed;
274
            this.BaseTextbox_Caret.Visibility = Visibility.Visible;
275

    
276
            if (UnderLine != null)
277
                Base_TextBlock.TextDecorations = UnderLine;
278

    
279
        }
280

    
281
        public void UnEditingMode()
282
        {            
283
            TextBoxVisibility = Visibility.Collapsed;         
284
            TextBlockVisibility = Visibility.Visible; 
285
            this.BaseTextbox_Caret.Visibility = Visibility.Collapsed;
286

    
287
            if (UnderLine != null)
288
                Base_TextBlock.TextDecorations = UnderLine;
289

    
290
            
291
        }
292

    
293

    
294
        public void SetText()
295
        {
296
            if (IsHighLight)
297
            {
298
                this.BackInnerColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6),
299
                    Colors.Yellow.R, Colors.Yellow.G, Colors.Yellow.B));
300
                this.BackColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.1),
301
                    Colors.Yellow.R, Colors.Yellow.G, Colors.Yellow.B));
302
            }
303
            else
304
            {
305
                //this.BackInnerColor = new SolidColorBrush(Color.FromArgb(0x003, 0xFF, 0xFF, 0xFF));
306
                //this.BackColor = new SolidColorBrush(Color.FromArgb(0x003, 0xFF, 0xFF, 0xFF));
307

    
308
                this.BackInnerColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6),
309
                    Colors.White.R, Colors.White.G, Colors.White.B));
310

    
311
                this.BackColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.1),
312
                    Colors.White.R, Colors.White.G, Colors.White.B));
313
            }
314

    
315
            if (Base_TextPath != null)
316
            {
317
                Base_TextPath.StrokeThickness = LineSize.Left;
318
            }
319

    
320
        }
321

    
322
        public void DrawingCloud()
323
        {
324
            List<Point> pCloud = new List<Point>
325
            {
326
                new Point(-LineSize.Left * 0.5, -LineSize.Left * 0.5),
327
                new Point(-LineSize.Left * 0.5, BoxHeight + LineSize.Left * 0.5),
328
                new Point(BoxWidth + LineSize.Left * 0.5, BoxHeight + LineSize.Left * 0.5),
329
                new Point(BoxWidth + LineSize.Left * 0.5 ,-LineSize.Left * 0.5)
330
            };
331
            if (this.ArcLength == 0) this.ArcLength = 10;
332
            //this.Base_TextBox.Select(Base_TextBox.Text.Length, 0);
333
            if (Base_TextPath != null)
334
            {
335
                switch (ControlType_No)
336
                {
337
                    case 0:
338
                        {
339
                            PathData = new PathGeometry();
340
                            PathDataInner = (GenerateInner(pCloud));
341
                        }
342
                        break;
343
                    case 1:
344
                        {
345
                            PathData = (Generate_Rect(pCloud));                         
346
                            PathDataInner = (GenerateInner(pCloud));
347
                        }
348
                        break;
349
                    case 2:
350
                        {
351
                            List<Point> pCloud2 = new List<Point>
352
                            {
353
                                new Point(-LineSize.Left , -LineSize.Left ),
354
                                new Point(-LineSize.Left , BoxHeight + LineSize.Left ),
355
                                new Point(BoxWidth + LineSize.Left , BoxHeight + LineSize.Left ),
356
                                new Point(BoxWidth + LineSize.Left  ,-LineSize.Left)
357
                            };
358
                            PathData = (Generate(pCloud2, this.ArcLength, this.LineSize.Left));
359
                            PathDataInner = (GenerateInner(pCloud));
360
                        }
361
                        break;
362
                }
363
            }
364
        }
365
        #endregion Internal Method
366

    
367
        public void Dispose()
368
        {
369
            //GC.Collect();
370
            ////GC.SuppressFinalize(this);
371
            this.Base_Border = null;
372
            this.Base_Canvas = null;
373
            this.Base_Grid = null;
374
            this.Base_TextBlock = null;
375
            this.Base_TextBox = null;
376
        }
377

    
378
        public override void UpdateControl()
379
        {
380
            if (this.PointSet.Count > 1)
381
            {
382
                this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y);
383
                this.EndPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y);
384
            }
385
        }
386

    
387
        #region Drawing Cloud Method
388
        public static PathGeometry Generate_Rect(List<Point> pData)
389
        {
390
            PathFigure pathFigure = new PathFigure();
391
            pathFigure.StartPoint = pData[0];
392

    
393
            PolyLineSegment polyline = new PolyLineSegment(pData, true);
394
            pathFigure.Segments.Add(polyline);
395

    
396
            PathGeometry rectPathGeometry = new PathGeometry();
397
            rectPathGeometry.Figures = new PathFigureCollection();
398
            pathFigure.IsClosed = true;
399
            pathFigure.IsFilled = false;
400
            rectPathGeometry.Figures.Add(pathFigure);
401

    
402

    
403
            return rectPathGeometry;
404
        }
405

    
406
        public static PathGeometry Generate(List<Point> pData, double _ArcLength = 20, double _LineSize = 20)
407
        {
408
            var _pathGeometry = new PathGeometry();
409
            double area = MathSet.AreaOf(pData);
410
            bool reverse = (area > 0);
411
            int count = pData.Count;
412
            for (int i = 0; i < count; i++)
413
            {
414
                PathFigure pathFigure = Polygon.CloudControl.GenerateLineWithCloud(pData[i % count], pData[(i + 1) % count], _ArcLength, reverse, _LineSize);
415
                pathFigure.IsClosed = false;
416
                pathFigure.IsFilled = true;
417
                
418
                _pathGeometry.Figures.Add(pathFigure);
419
            }
420

    
421
            return _pathGeometry;
422
        }
423

    
424

    
425
        public static PathGeometry GenerateInner(List<Point> pData)
426
        {
427
            var _pathGeometry = new PathGeometry();
428
            double area = MathSet.AreaOf(pData);
429
            bool reverse = (area > 0);
430
            int count = pData.Count;
431

    
432
            PathFigure pathFigur2 = new PathFigure();
433
            pathFigur2.StartPoint = pData[0];
434

    
435
            PolyLineSegment polyline = new PolyLineSegment(pData, true);
436
            pathFigur2.Segments.Add(polyline);
437

    
438
            pathFigur2.IsClosed = true;
439
            pathFigur2.IsFilled = true;
440
            _pathGeometry.Figures.Add(pathFigur2);
441

    
442
            return _pathGeometry;
443
        }
444
        #endregion
445

    
446
        #region Dependency Properties
447
        public static readonly DependencyProperty ControlTypeProperty =
448
        DependencyProperty.Register("ControlType", typeof(ControlType), typeof(TextControl), new FrameworkPropertyMetadata(ControlType.TextControl));
449

    
450
        public static readonly DependencyProperty ControlType_NoProperty =
451
        DependencyProperty.Register("ControlType_No", typeof(int), typeof(TextControl), new FrameworkPropertyMetadata(0));
452

    
453
        public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
454
            "IsSelected", typeof(bool), typeof(TextControl), new FrameworkPropertyMetadata(false, IsSelectedChanged));
455

    
456
        public static readonly DependencyProperty PathGeometryProperty = DependencyProperty.Register(
457
            "PathGeometry", typeof(PathGeometry), typeof(TextControl), new PropertyMetadata(null, SetPathGeometryChanged));
458

    
459
        public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
460
            "Text", typeof(string), typeof(TextControl), new PropertyMetadata(null));
461

    
462
        public static readonly DependencyProperty OverViewTextProperty = DependencyProperty.Register(
463
            "OverViewText", typeof(string), typeof(TextControl), new PropertyMetadata(null, new PropertyChangedCallback(TextChanged)));
464

    
465
        public static readonly DependencyProperty UserIDProperty = DependencyProperty.Register(
466
            "UserID", typeof(string), typeof(TextControl), new PropertyMetadata(null));
467

    
468
        /*public static readonly DependencyProperty FontColorProperty = DependencyProperty.Register(
469
            "FontColor", typeof(SolidColorBrush), typeof(TextControl), new PropertyMetadata(new SolidColorBrush(Colors.Red)));*/
470

    
471
        public static readonly DependencyProperty StrokeColorProperty = DependencyProperty.Register(
472
            "StrokeColor", typeof(SolidColorBrush), typeof(TextControl), new PropertyMetadata(new SolidColorBrush(Colors.Red)));
473

    
474
        public static readonly DependencyProperty ArcLengthProperty = DependencyProperty.Register(
475
            "ArcLength", typeof(double), typeof(TextControl), new PropertyMetadata((Double)10, PointValueChanged));
476

    
477
        //강인구 추가
478
        public static readonly DependencyProperty IsHighlightProperty = DependencyProperty.Register(
479
            "IsHighLight", typeof(bool), typeof(TextControl), new PropertyMetadata(false, PointValueChanged));
480

    
481
        public static readonly DependencyProperty BackColorProperty = DependencyProperty.Register(
482
            "BackColor", typeof(SolidColorBrush), typeof(TextControl), new PropertyMetadata(new SolidColorBrush(Colors.White)));
483

    
484
        public static readonly DependencyProperty BackInnerColorProperty = DependencyProperty.Register(
485
            "BackInnerColor", typeof(SolidColorBrush), typeof(TextControl), new PropertyMetadata(new SolidColorBrush(Colors.White)));
486

    
487
        public static readonly DependencyProperty UnderLineProperty = DependencyProperty.Register(
488
            "UnderLine", typeof(TextDecorationCollection), typeof(TextControl), new PropertyMetadata(null));
489

    
490
        public static readonly DependencyProperty LineSizeProperty = DependencyProperty.Register(
491
            "LineSize", typeof(Thickness), typeof(TextControl), new PropertyMetadata(new Thickness(4), PointValueChanged)); //여기만 4인지 모르겠지만 4 그대로 두겠음
492

    
493
        public static readonly DependencyProperty PointSetProperty = DependencyProperty.Register(
494
            "PointSet", typeof(List<Point>), typeof(TextControl), new PropertyMetadata(new List<Point>()));
495

    
496
        public static readonly DependencyProperty PathDataProperty = DependencyProperty.Register(
497
            "PathData", typeof(Geometry), typeof(TextControl), null);
498

    
499
        public static readonly DependencyProperty PathDataInnerProperty = DependencyProperty.Register(
500
            "PathDataInner", typeof(Geometry), typeof(TextControl), null);
501

    
502
        public static readonly DependencyProperty OverViewPathDataProperty = DependencyProperty.Register(
503
            "OverViewPathDataProperty", typeof(Geometry), typeof(TextControl), null);
504

    
505
        public static readonly DependencyProperty TextStyleProperty = DependencyProperty.Register(
506
            "TextStyle", typeof(FontStyle), typeof(TextControl), new PropertyMetadata(FontStyles.Normal));
507

    
508
        public static readonly DependencyProperty TextFamilyProperty = DependencyProperty.Register(
509
            "TextFamily", typeof(FontFamily), typeof(TextControl), 
510
                        new PropertyMetadata(new PropertyChangedCallback(TextFamilyPropertyChanged)));
511

    
512
        public static readonly DependencyProperty TextWeightProperty = DependencyProperty.Register(
513
            "TextWeight", typeof(FontWeight), typeof(TextControl), new PropertyMetadata(FontWeights.Normal));
514

    
515
        public static readonly DependencyProperty CenterXProperty = DependencyProperty.Register(
516
            "CenterX", typeof(double), typeof(TextControl), new PropertyMetadata((double)0, OnCenterXYChanged));
517

    
518
        public static readonly DependencyProperty CenterYProperty = DependencyProperty.Register(
519
            "CenterY", typeof(double), typeof(TextControl), new PropertyMetadata((double)0, OnCenterXYChanged));
520

    
521
        public static readonly DependencyProperty CanvasXProperty = DependencyProperty.Register(
522
           "CanvasX", typeof(double), typeof(TextControl), new PropertyMetadata((double)0, OnSetCansvasChanged));
523

    
524
        public static readonly DependencyProperty CanvasYProperty = DependencyProperty.Register(
525
            "CanvasY", typeof(double), typeof(TextControl), new PropertyMetadata((double)0, OnSetCansvasChanged));
526

    
527
        public static readonly DependencyProperty StartPointProperty = DependencyProperty.Register(
528
            "StartPoint", typeof(Point), typeof(TextControl), new PropertyMetadata(new Point(0, 0), PointValueChanged));
529

    
530
        public static readonly DependencyProperty EndPointProperty = DependencyProperty.Register(
531
            "EndPoint", typeof(Point), typeof(TextControl), new PropertyMetadata(new Point(100, 100), PointValueChanged));
532

    
533
        public static readonly DependencyProperty TextSizeProperty = DependencyProperty.Register(
534
            "TextSize", typeof(Double), typeof(TextControl), new PropertyMetadata((Double)30, PointValueChanged));
535

    
536
        public static readonly DependencyProperty PaintProperty = DependencyProperty.Register(
537
            "Paint", typeof(PaintSet), typeof(TextControl), new PropertyMetadata((PaintSet.None), PointValueChanged));
538

    
539
        public static readonly DependencyProperty OverViewPaintProperty = DependencyProperty.Register(
540
            "OverViewPaint", typeof(PaintSet), typeof(TextControl), new PropertyMetadata((PaintSet.None), PointValueChanged));
541

    
542
        public static readonly DependencyProperty AngleProperty = DependencyProperty.Register(
543
            "Angle", typeof(double), typeof(TextControl), new PropertyMetadata((double)0.0, new PropertyChangedCallback(AngleValueChanged)));
544

    
545
        public static readonly DependencyProperty EnableEditingProperty = DependencyProperty.Register(
546
           "EnableEditing", typeof(bool), typeof(TextControl), new PropertyMetadata((true), new PropertyChangedCallback(OnIsEditingChanged)));
547

    
548
        public static readonly DependencyProperty TextBoxVisibilityProperty = DependencyProperty.Register(
549
            "TextBoxVisibility", typeof(Visibility), typeof(TextControl), new PropertyMetadata((Visibility.Visible), OnTextBoxVisibilityChanged));
550

    
551
        public static readonly DependencyProperty TextBlockVisibilityProperty = DependencyProperty.Register(
552
            "TextBlockVisibility", typeof(Visibility), typeof(TextControl), new PropertyMetadata((Visibility.Collapsed), OnTextBlockVisibilityChanged));
553

    
554
        #endregion Dependency Properties
555

    
556
        #region dp Properties
557

    
558

    
559
        public override SolidColorBrush StrokeColor
560
        {
561
            get { return (SolidColorBrush)GetValue(StrokeColorProperty); }
562
            set
563
            {
564
                if (this.StrokeColor != value)
565
                {
566
                    SetValue(StrokeColorProperty, value);
567
                }
568
            }
569
        }
570

    
571
        public Double ArcLength
572
        {
573
            get { return (Double)GetValue(ArcLengthProperty); }
574
            set
575
            {
576
                if (this.ArcLength != value)
577
                {
578
                    SetValue(ArcLengthProperty, value);
579
                    OnPropertyChanged("ArcLength");
580
                }
581
            }
582
        }
583

    
584
        public bool EnableEditing
585
        {
586
            get { return (bool)GetValue(EnableEditingProperty); }
587
            set
588
            {
589
                if (this.EnableEditing != value)
590
                {
591
                    SetValue(EnableEditingProperty, value);
592
                    OnPropertyChanged("EnableEditing");
593
                }
594
            }
595
        }
596

    
597
        public Thickness LineSize
598
        {
599
            get
600
            {
601
                return (Thickness)GetValue(LineSizeProperty);
602
            }
603
            set
604
            {
605
                if (this.LineSize != value)
606
                {
607
                    SetValue(LineSizeProperty, value);
608
                    OnPropertyChanged("LineSize");
609
                }
610
            }
611
        }
612

    
613
        public override ControlType ControlType
614
        {
615
            get
616
            {
617
                return (ControlType)GetValue(ControlTypeProperty);
618
            }
619
            set
620
            {
621
                SetValue(ControlTypeProperty, value);
622
            }
623
        }
624
        public int ControlType_No
625
        {
626
            get
627
            {
628
                return (int)GetValue(ControlType_NoProperty);
629
            }
630
            set
631
            {
632
                SetValue(ControlType_NoProperty, value);
633
            }
634
        }
635

    
636
        public string UserID
637
        {
638
            get { return (string)GetValue(UserIDProperty); }
639
            set
640
            {
641
                if (this.UserID != value)
642
                {
643
                    SetValue(UserIDProperty, value);
644
                    OnPropertyChanged("UserID");
645
                }
646
            }
647
        }
648

    
649
        public double CenterX
650
        {
651
            get { return (double)GetValue(CenterXProperty); }
652
            set
653
            {
654
                SetValue(CenterXProperty, value);
655
                OnPropertyChanged("CenterX");
656

    
657
            }
658
        }
659

    
660
        public double CenterY
661
        {
662
            get { return (double)GetValue(CenterYProperty); }
663
            set
664
            {
665
                SetValue(CenterYProperty, value);
666
                OnPropertyChanged("CenterY");
667
            }
668
        }
669

    
670
        public string Text
671
        {
672
            get { return (string)GetValue(TextProperty); }
673
            set
674
            {
675
                if (this.Text != value)
676
                {
677
                    SetValue(TextProperty, value);
678
                    OnPropertyChanged("Text");
679
                }
680
            }
681
        }
682

    
683
        public string OverViewText
684
        {
685
            get { return (string)GetValue(OverViewTextProperty); }
686
            set
687
            {
688
                if (this.OverViewText != value)
689
                {
690
                    SetValue(OverViewTextProperty, value);
691
                    OnPropertyChanged("OverViewText");
692
                }
693
            }
694
        }
695

    
696
        public Geometry OverViewPathData
697
        {
698
            get { return (Geometry)GetValue(OverViewPathDataProperty); }
699
            set
700
            {
701
                if (this.OverViewPathData != value)
702
                {
703
                    SetValue(OverViewPathDataProperty, value);
704
                    OnPropertyChanged("OverViewPathData");
705
                }
706
            }
707
        }
708

    
709
        public Visibility TextBoxVisibility
710
        {
711
            get { return (Visibility)GetValue(TextBoxVisibilityProperty); }
712
            set
713
            {
714
                if (this.TextBoxVisibility != value)
715
                {
716
                    SetValue(TextBoxVisibilityProperty, value);
717
                    OnPropertyChanged("TextBoxVisibility");
718
                }
719
            }
720
        }
721

    
722

    
723
        public Visibility TextBlockVisibility
724
        {
725
            get { return (Visibility)GetValue(TextBlockVisibilityProperty); }
726
            set
727
            {
728
                if (this.TextBlockVisibility != value)
729
                {
730
                    SetValue(TextBlockVisibilityProperty, value);
731
                    OnPropertyChanged("TextBlockVisibility");
732
                }
733
            }
734
        }
735

    
736
        public Double TextSize
737
        {
738
            get { return (Double)GetValue(TextSizeProperty); }
739
            set
740
            {
741
                if (this.TextSize != value)
742
                {
743
                    SetValue(TextSizeProperty, value);
744
                    OnPropertyChanged("TextSize");
745
                }
746
            }
747
        }
748
        /*
749
        public SolidColorBrush FontColor
750
        {
751
            get { return (SolidColorBrush)GetValue(FontColorProperty); }
752
            set
753
            {
754
                if (this.FontColor != value)
755
                {
756
                    SetValue(FontColorProperty, value);
757
                    OnPropertyChanged("FontColor");
758
                }
759
            }
760
        }*/
761

    
762
        public SolidColorBrush BackColor
763
        {
764
            get { return (SolidColorBrush)GetValue(BackColorProperty); }
765
            set
766
            {
767
                if (this.BackColor != value)
768
                {
769
                    SetValue(BackColorProperty, value);
770
                    OnPropertyChanged("BackColor");
771
                }
772
            }
773
        }
774

    
775
        public SolidColorBrush BackInnerColor
776
        {
777
            get { return (SolidColorBrush)GetValue(BackInnerColorProperty); }
778
            set
779
            {
780
                if (this.BackInnerColor != value)
781
                {
782
                    SetValue(BackInnerColorProperty, value);
783
                    OnPropertyChanged("BackInnerColor");
784
                }
785
            }
786
        }
787

    
788

    
789

    
790
        public TextDecorationCollection UnderLine
791
        {
792
            get
793
            {
794
                return (TextDecorationCollection)GetValue(UnderLineProperty);
795
            }
796
            set
797
            {
798
                if (this.UnderLine != value)
799
                {
800
                    SetValue(UnderLineProperty, value);
801
                    OnPropertyChanged("UnderLine");
802
                }
803
            }
804
        }
805

    
806
        public double CanvasX
807
        {
808
            get { return (double)GetValue(CanvasXProperty); }
809
            set
810
            {
811
                if (this.CanvasX != value)
812
                {
813
                    SetValue(CanvasXProperty, value);
814
                    OnPropertyChanged("CanvasX");
815
                }
816
            }
817
        }
818

    
819
        public double CanvasY
820
        {
821
            get { return (double)GetValue(CanvasYProperty); }
822
            set
823
            {
824
                if (this.CanvasY != value)
825
                {
826
                    SetValue(CanvasYProperty, value);
827
                    OnPropertyChanged("CanvasY");
828
                }
829
            }
830
        }
831

    
832
        public Point EndPoint
833
        {
834
            get { return (Point)GetValue(EndPointProperty); }
835
            set
836
            {
837
                if (this.EndPoint != value)
838
                {
839
                    SetValue(EndPointProperty, value);
840
                    OnPropertyChanged("EndPoint");
841
                }
842
            }
843
        }
844

    
845
        public Point StartPoint
846
        {
847
            get { return (Point)GetValue(StartPointProperty); }
848
            set
849
            {
850
                if (this.StartPoint != value)
851
                {
852
                    SetValue(StartPointProperty, value);
853
                    OnPropertyChanged("StartPoint");
854
                }
855
            }
856
        }
857

    
858
        public FontStyle TextStyle
859
        {
860
            get { return (FontStyle)GetValue(TextStyleProperty); }
861
            set
862
            {
863
                if (this.TextStyle != value)
864
                {
865
                    SetValue(TextStyleProperty, value);
866
                    OnPropertyChanged("TextStyle");
867
                }
868
            }
869
        }
870

    
871
        public FontFamily TextFamily
872
        {
873
            get { return (FontFamily)GetValue(TextFamilyProperty); }
874
            set
875
            {
876
                if (this.TextFamily != value)
877
                {
878
                    SetValue(TextFamilyProperty, value);
879
                    OnPropertyChanged("TextFamily");
880
                }
881
            }
882
        }
883

    
884
        public FontWeight TextWeight
885
        {
886
            get { return (FontWeight)GetValue(TextWeightProperty); }
887
            set
888
            {
889
                if (this.TextWeight != value)
890
                {
891
                    SetValue(TextWeightProperty, value);
892
                    OnPropertyChanged("TextWeight");
893
                }
894
            }
895
        }
896

    
897
        public PaintSet Paint
898
        {
899
            get { return (PaintSet)GetValue(PaintProperty); }
900
            set
901
            {
902
                if (this.Paint != value)
903
                {
904
                    SetValue(PaintProperty, value);
905
                    OnPropertyChanged("Paint");
906
                }
907
            }
908
        }
909

    
910
        public PaintSet OverViewPaint
911
        {
912
            get { return (PaintSet)GetValue(OverViewPaintProperty); }
913
            set
914
            {
915
                if (this.OverViewPaint != value)
916
                {
917
                    SetValue(OverViewPaintProperty, value);
918
                    OnPropertyChanged("OverViewPaint");
919
                }
920
            }
921
        }
922

    
923
        double IPath.LineSize
924
        {
925
            get
926
            {
927
                return this.LineSize.Left;
928
            }
929
            set
930
            {
931
                this.LineSize = new Thickness(value);
932
                OnPropertyChanged("LineSize");
933
            }
934
        }
935

    
936

    
937
        public Geometry PathData
938
        {
939
            get { return (Geometry)GetValue(PathDataProperty); }
940
            set
941
            {
942
                SetValue(PathDataProperty, value);
943
                OnPropertyChanged("PathData");
944
            }
945
        }
946

    
947
        public Geometry PathDataInner
948
        {
949
            get { return (Geometry)GetValue(PathDataInnerProperty); }
950
            set
951
            {
952
                SetValue(PathDataInnerProperty, value);
953
                OnPropertyChanged("PathDataInner");
954
            }
955
        }
956

    
957
        public override double CommentAngle
958
        {
959
            get { return (double)GetValue(AngleProperty); }
960
            set
961
            {
962
                if (this.CommentAngle != value)
963
                {
964
                    SetValue(AngleProperty, value);
965

    
966
                    OnPropertyChanged("Angle");
967
                    UpdateLayout();
968
                }
969
            }
970
        }
971

    
972
        public bool IsHighLight
973
        {
974
            get { return (bool)GetValue(IsHighlightProperty); }
975
            set
976
            {
977
                if (this.IsHighLight != value)
978
                {
979
                    SetValue(IsHighlightProperty, value);
980
                    OnPropertyChanged("IsHighLight");
981
                }
982
            }
983
        }
984

    
985
        public List<Point> PointSet
986
        {
987
            get { return (List<Point>)GetValue(PointSetProperty); }
988
            set
989
            {
990
                SetValue(PointSetProperty, value);
991
                OnPropertyChanged("PointSet");
992
            }
993
        }
994

    
995
        #endregion Properties
996

    
997
        #region Properties
998

    
999
        private bool _IsEditingMode;
1000
        public bool IsEditingMode
1001
        {
1002
            get
1003
            {
1004
                return _IsEditingMode;
1005
            }
1006
            set
1007
            {
1008
                _IsEditingMode = value;
1009
                OnPropertyChanged("IsEditingMode");
1010
            }
1011
        }
1012

    
1013
        public PathGeometry PathGeometry
1014
        {
1015
            get { return (PathGeometry)GetValue(PathGeometryProperty); }
1016
            set
1017
            {
1018
                SetValue(PathGeometryProperty, value);
1019
                OnPropertyChanged("PathGeometry");
1020
            }
1021
        }
1022

    
1023
        private double _BoxWidth;
1024
        public double BoxWidth
1025
        {
1026
            get
1027
            {
1028
                return _BoxWidth;
1029
            }
1030
            set
1031
            {
1032
                _BoxWidth = value;
1033
                OnPropertyChanged("BoxWidth");
1034
            }
1035
        }
1036

    
1037
        private double _BoxHeight;
1038
        public double BoxHeight
1039
        {
1040
            get
1041
            {
1042
                return _BoxHeight;
1043
            }
1044
            set
1045
            {
1046
                _BoxHeight = value;
1047
                OnPropertyChanged("BoxHeight");
1048
            }
1049
        }
1050

    
1051
        #endregion
1052

    
1053
        #region CallBack Method
1054

    
1055
        private static void TextFamilyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
1056
        {
1057
            //var instance = (TextControl)d;
1058

    
1059
            //instance.SetFontFamily(e.NewValue as FontFamily);
1060
        }
1061

    
1062
        public static void SetPathGeometryChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
1063
        {
1064
            var instance = (TextControl)sender;
1065

    
1066
            if (e.OldValue != e.NewValue && instance.Base_TextPath != null)
1067
            {
1068
                instance.SetValue(e.Property, e.NewValue);
1069
            }
1070
        }
1071

    
1072

    
1073
        public static void OnTextBoxVisibilityChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
1074
        {
1075
            var instance = (TextControl)sender;
1076

    
1077
            if (e.OldValue != e.NewValue && instance.Base_TextPath != null)
1078
            {
1079
                instance.SetValue(e.Property, e.NewValue);
1080
            }
1081
        }
1082

    
1083
        public static void OnTextBlockVisibilityChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
1084
        {
1085
            var instance = (TextControl)sender;
1086

    
1087
            if (e.OldValue != e.NewValue && instance.Base_TextPath != null)
1088
            {
1089
                instance.SetValue(e.Property, e.NewValue);
1090
            }
1091
        }
1092

    
1093
        public static void IsSelectedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
1094
        {
1095
            //var instance = (TextControl)sender;
1096

    
1097
            //if (e.OldValue != e.NewValue && instance.Base_Border != null)
1098
            //{
1099
            //    instance.SetValue(e.Property, e.NewValue);
1100

    
1101
            //    if (instance.IsSelected)
1102
            //    {
1103
            //        instance.StrokeColor = new SolidColorBrush(Colors.Blue);
1104
            //        //instance.Base_Border.BorderBrush = new SolidColorBrush(Colors.Blue);
1105
            //    }
1106
            //    else
1107
            //    {
1108
            //        instance.StrokeColor = new SolidColorBrush(Colors.Red);
1109
            //        //instance.Base_Border.BorderBrush = new SolidColorBrush(Colors.Red);
1110
            //        //instance.FontColor = new SolidColorBrush(Colors.Transparent);
1111
            //        //instance.Base_Border.BorderBrush = new SolidColorBrush(Colors.Transparent);
1112
            //    }
1113

    
1114
            //}
1115
        }
1116

    
1117
        public static void OnSetCansvasChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
1118
        {
1119
            var instance = (TextControl)sender;
1120

    
1121
            if (e.OldValue != e.NewValue && instance != null)
1122
            {
1123
                instance.SetValue(e.Property, e.NewValue);
1124

    
1125
                Canvas.SetLeft(instance, instance.CanvasX);
1126
                Canvas.SetTop(instance, instance.CanvasY);
1127
            }
1128
        }
1129

    
1130
        public static void OnIsEditingChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
1131
        {
1132
            var instance = (TextControl)sender;
1133

    
1134
            if (e.OldValue != e.NewValue && instance.Base_TextBlock != null)
1135
            {
1136
                instance.SetValue(e.Property, e.NewValue);
1137

    
1138
                if (instance.EnableEditing)
1139
                {
1140
                    instance.EditingMode();
1141
                }
1142
                else
1143
                {
1144
                    instance.UnEditingMode();
1145
                }
1146
            }
1147
        }
1148
        public static void TextChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
1149
        {
1150
            var instance = (TextControl)sender;
1151

    
1152
            if (e.OldValue != e.NewValue)
1153
            {
1154
                instance.SetValue(e.Property, e.NewValue);
1155
            }
1156
        }
1157

    
1158
        public static void OnCenterXYChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
1159
        {
1160
            var instance = (TextControl)sender;
1161

    
1162
            if (e.OldValue != e.NewValue && instance.Base_TextBlock != null)
1163
            {
1164
                instance.SetValue(e.Property, e.NewValue);
1165
                //instance.DrawingCloud();
1166
            }
1167
        }
1168

    
1169
        public static void AngleValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
1170
        {
1171
            var instance = (TextControl)sender;
1172
            if (e.OldValue != e.NewValue && instance.Base_TextBlock != null)
1173
            {
1174
                instance.SetValue(e.Property, e.NewValue);
1175
                //instance.DrawingCloud();
1176
            }
1177
        }
1178

    
1179
        public static void PointValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
1180
        {
1181
            var instance = (TextControl)sender;
1182
            
1183
            if (e.OldValue != e.NewValue && instance.Base_TextBox != null)
1184
            {                       
1185
                instance.SetText();
1186
                instance.DrawingCloud();
1187
            }
1188

    
1189
        }
1190

    
1191
        #endregion CallBack Method
1192

    
1193
        protected void OnPropertyChanged(string propName)
1194
        {
1195
            if (PropertyChanged != null)
1196
                PropertyChanged(this, new PropertyChangedEventArgs(propName));
1197

    
1198
            if (propName == "UnderLine" && Base_TextBlock != null)
1199
            {
1200
                Base_TextBlock.TextDecorations = UnderLine;
1201
                //(sender as TextControl).Base_TextBlock.TextDecorations = (sender as TextControl).UnderLine;
1202
            }
1203
        }
1204

    
1205
        /// <summary>
1206
        /// return textcontrols' area
1207
        /// </summary>
1208
        public override Rect ItemRect
1209
        {
1210
            get
1211
            {
1212
                Point start = new Point(this.CanvasX, this.CanvasY);
1213

    
1214
                Point length = new Point();
1215
                double angle = this.CommentAngle * Math.PI / 180;
1216
                double sin = Math.Sin(angle);
1217
                double cos = Math.Cos(angle);
1218

    
1219
                length.X = this.BoxWidth * cos - this.BoxHeight * sin;
1220
                length.Y = this.BoxWidth * sin + this.BoxHeight * cos;
1221

    
1222
                Point end = new Point(start.X + length.X, start.Y + length.Y);
1223
                return new Rect(start, end);
1224
            }
1225
        }
1226

    
1227
        /// <summary>
1228
        /// translate control along given dx,dy
1229
        /// </summary>
1230
        /// <param name="dx"></param>
1231
        /// <param name="dy"></param>
1232
        public override void OnTranslate(double dx, double dy)
1233
        {
1234
            //this.CanvasX = Canvas.GetLeft(this) + dx;
1235
            //this.CanvasY = Canvas.GetTop(this) + dy;
1236
            this.StartPoint = new Point(this.StartPoint.X + dx, this.StartPoint.Y + dy);
1237
            this.EndPoint = new Point(this.EndPoint.X + dx, this.EndPoint.Y + dy);
1238

    
1239
            this.SetValue(TextControl.CanvasXProperty, Canvas.GetLeft(this) + dx);
1240
            this.SetValue(TextControl.CanvasYProperty, Canvas.GetTop(this) + dy);
1241
        }
1242

    
1243
        /// <summary>
1244
        /// Serialize this
1245
        /// </summary>
1246
        /// <param name="sUserId"></param>
1247
        /// <returns></returns>
1248
        public override string Serialize()
1249
        {
1250
            using (S_TextControl ctrl = new S_TextControl())
1251
            {
1252
                ctrl.TransformPoint = "0|0";
1253
                ctrl.SizeSet = String.Format("{0}|{1}", this.LineSize.Left.ToString(), this.TextSize.ToString());
1254
                ctrl.Text = this.Text;
1255
                ctrl.UserID = this.UserID;
1256
                ctrl.FontColor = this.StrokeColor.Color.ToString();
1257
                //ctrl.FontColor = "#FFFFFF00";
1258

    
1259
                if (this.StartPoint == new Point())
1260
                    ctrl.StartPoint = new Point(this.CanvasX, this.CanvasY);
1261
                else
1262
                    ctrl.StartPoint = this.StartPoint;
1263

    
1264
                ctrl.EndPoint = this.EndPoint;
1265
                ctrl.Opac = this.Opacity;
1266
                ctrl.PointSet = this.PointSet;
1267
                ctrl.Angle = this.CommentAngle;
1268
                ctrl.paintMethod = this.ControlType_No;
1269
                ctrl.BoxW = this.BoxWidth;
1270
                ctrl.BoxH = this.BoxHeight;
1271
                ctrl.isHighLight = this.IsHighLight;
1272
                ctrl.Name = this.GetType().Name.ToString();
1273
                ctrl.fontConfig = new List<string>()
1274
                            {
1275
                                this.TextFamily.FontName(),
1276
                                this.TextStyle.ToString(),
1277
                                this.TextWeight.ToString(),
1278
                            };
1279
                ctrl.ArcLength = this.ArcLength;
1280

    
1281

    
1282
                if (this.UnderLine != null)
1283
                {
1284
                    ctrl.fontConfig.Add("true");
1285
                }
1286

    
1287
                ///강인구 추가(2017.11.02)
1288
                ///Memo 추가
1289
                ctrl.Memo = this.Memo;
1290

    
1291
                ctrl.ZIndex = this.ZIndex;
1292

    
1293
                return "|DZ|" + JsonSerializerHelper.CompressString((ctrl.JsonSerialize()));
1294
            }
1295
        }
1296

    
1297
        /// <summary>
1298
        /// create a textcontrol from given string
1299
        /// </summary>
1300
        /// <param name="str"></param>
1301
        /// <returns></returns>
1302
        public static TextControl FromString(string str, SolidColorBrush brush, string sProjectNo)
1303
        {
1304
            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(str))
1305
            {
1306
                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1307
                TextControl instance = new TextControl()
1308
                {
1309
                    Text = s.Text,
1310
                    StartPoint = s.StartPoint,
1311
                    EndPoint = s.EndPoint,
1312
                    CanvasX = s.StartPoint.X,
1313
                    CanvasY = s.StartPoint.Y,
1314
                    BoxWidth = s.BoxW,
1315
                    BoxHeight = s.BoxH,
1316
                    ControlType_No = s.paintMethod,
1317
                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
1318
                    TextSize = Convert.ToDouble(data2[1]),
1319
                    StrokeColor = brush,
1320
                    FontSize = 10,
1321
                    UserID = s.UserID,
1322
                    IsHighLight = s.isHighLight,
1323
                    CommentAngle = s.Angle,
1324
                    PointSet = s.PointSet,
1325
                    Opacity = s.Opac,
1326
                    
1327
                    TextFamily = Markus.Fonts.FontHelper.GetFontFamily(s.fontConfig[0]),
1328
                    //인구 추가(2018.04.17)
1329
                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
1330
                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
1331
                    ArcLength = s.ArcLength,
1332
                    Memo = s.Memo,
1333
                    ZIndex = s.ZIndex
1334
                };
1335

    
1336
                if (s.fontConfig.Count() == 4)
1337
                {
1338
                    instance.UnderLine = TextDecorations.Underline;
1339
                }
1340

    
1341
                return instance;
1342
            }
1343
        }
1344
    }
1345
}
클립보드 이미지 추가 (최대 크기: 500 MB)