개정판 661b7416
issue #999: Add FromString to all of controls
Change-Id: I64093e34a5f9e8d367cbed769ff4db8d7472cb7a
MarkupToPDF/Controls/Line/ArcControl.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 |
{ |
... | ... | |
392 | 393 |
// this.Clock =SweepDirection.Clockwise; |
393 | 394 |
// } |
394 | 395 |
//} |
395 |
public void SetArcPath()
|
|
396 |
private void SetArcPath()
|
|
396 | 397 |
{ |
397 | 398 |
this.ApplyTemplate(); |
398 | 399 |
|
... | ... | |
553 | 554 |
return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
554 | 555 |
} |
555 | 556 |
} |
557 |
|
|
558 |
/// <summary> |
|
559 |
/// create a arccontrol from given string |
|
560 |
/// </summary> |
|
561 |
/// <param name="str"></param> |
|
562 |
/// <returns></returns> |
|
563 |
public static ArcControl FromString(string str, SolidColorBrush brush, string sProjectNo) |
|
564 |
{ |
|
565 |
ArcControl instance = null; |
|
566 |
using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(str)) |
|
567 |
{ |
|
568 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
569 |
instance = new ArcControl() |
|
570 |
{ |
|
571 |
StartPoint = s.StartPoint, |
|
572 |
EndPoint = s.EndPoint, |
|
573 |
DashSize = s.DashSize, |
|
574 |
PointSet = s.PointSet, |
|
575 |
isTransOn = s.IsTransOn, |
|
576 |
MidPoint = s.MidPoint, |
|
577 |
StrokeColor = brush, |
|
578 |
Opacity = s.Opac, |
|
579 |
Clock = s.Clock, |
|
580 |
LineSize = Convert.ToDouble(data2.First()), |
|
581 |
UserID = s.UserID, |
|
582 |
Memo = s.Memo |
|
583 |
}; |
|
584 |
} |
|
585 |
|
|
586 |
return instance; |
|
587 |
} |
|
556 | 588 |
} |
557 | 589 |
} |
내보내기 Unified diff