프로젝트

일반

사용자정보

개정판 661b7416

ID661b7416598de29c8ba957a702c8b0b2135eda3f
상위 8c66babd
하위 5529d2a2

백흠경이(가) 5년 이상 전에 추가함

issue #999: Add FromString to all of controls

Change-Id: I64093e34a5f9e8d367cbed769ff4db8d7472cb7a

차이점 보기:

MarkupToPDF/Controls/Line/LineControl.cs
14 14
using MarkupToPDF.Common;
15 15
using MarkupToPDF.Serialize.S_Control;
16 16
using MarkupToPDF.Serialize.Core;
17
using System.Linq;
17 18

  
18 19
namespace MarkupToPDF.Controls.Line
19 20
{
......
355 356
            Base_LinePath = GetTemplateChild("PART_LinePath") as Path;
356 357
            SetLinePath();
357 358
        }
359

  
358 360
        public void updateControl()
359 361
        {
360 362
            this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y);
......
402 404
            this.OverViewPathData = this.PathData;
403 405
        }
404 406

  
405
        public void SetLinePath()
407
        private void SetLinePath()
406 408
        {
407 409
            this.ApplyTemplate();           
408 410
            if (this.DashSize != null)
......
515 517
                return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
516 518
            }
517 519
        }
520

  
521
        /// <summary>
522
        /// create a linecontrol from given string
523
        /// </summary>
524
        /// <param name="str"></param>
525
        /// <returns></returns>
526
        public static LineControl FromString(string str, SolidColorBrush brush, string sProjectNo)
527
        {
528
            LineControl instance = null;
529
            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(str))
530
            {
531
                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
532
                instance = new LineControl()
533
                {
534
                    LineStyleSet = s.LineStyleSet,
535
                    StartPoint = s.StartPoint,
536
                    DimSize = s.DimSize,
537
                    EndPoint = s.EndPoint,
538
                    DashSize = s.DashSize,
539
                    Interval = s.Interval,
540
                    PointSet = s.PointSet,
541
                    Opacity = s.Opac,
542
                    StrokeColor = brush,
543
                    UserID = s.UserID,
544
                    LineSize = Convert.ToDouble(data2.First()),
545
                };
546
            }
547

  
548
            return instance;
549
        }
518 550
    }
519 551
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)