개정판 661b7416
issue #999: Add FromString to all of controls
Change-Id: I64093e34a5f9e8d367cbed769ff4db8d7472cb7a
MarkupToPDF/Controls/Shape/RectCloudControl.cs | ||
---|---|---|
14 | 14 |
using MarkupToPDF.Common; |
15 | 15 |
using MarkupToPDF.Serialize.Core; |
16 | 16 |
using MarkupToPDF.Serialize.S_Control; |
17 |
using System.Linq; |
|
17 | 18 |
|
18 | 19 |
namespace MarkupToPDF.Controls.Shape |
19 | 20 |
{ |
... | ... | |
381 | 382 |
//} |
382 | 383 |
} |
383 | 384 |
|
384 |
public void SetRectCloud()
|
|
385 |
private void SetRectCloud()
|
|
385 | 386 |
{ |
386 | 387 |
this.ApplyTemplate(); |
387 | 388 |
PathFigure pathFigure = new PathFigure(); |
... | ... | |
590 | 591 |
return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
591 | 592 |
} |
592 | 593 |
} |
594 |
|
|
595 |
/// <summary> |
|
596 |
/// create a rectcloudcontrol from given string |
|
597 |
/// </summary> |
|
598 |
/// <param name="str"></param> |
|
599 |
/// <returns></returns> |
|
600 |
public static RectCloudControl FromString(string str, SolidColorBrush brush, string sProjectNo) |
|
601 |
{ |
|
602 |
using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(str)) |
|
603 |
{ |
|
604 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
605 |
return new RectCloudControl() |
|
606 |
{ |
|
607 |
StartPoint = s.StartPoint, |
|
608 |
EndPoint = s.EndPoint, |
|
609 |
LeftBottomPoint = s.LB, |
|
610 |
Paint = s.PaintState, |
|
611 |
Opacity = s.Opac, |
|
612 |
DashSize = s.DashSize, |
|
613 |
TopRightPoint = s.TR, |
|
614 |
PointSet = s.PointSet, |
|
615 |
StrokeColor = brush, |
|
616 |
ArcLength = s.ArcLength, |
|
617 |
LineSize = Convert.ToDouble(data2.First()), |
|
618 |
UserID = s.UserID, |
|
619 |
Memo = s.Memo |
|
620 |
}; |
|
621 |
} |
|
622 |
} |
|
593 | 623 |
} |
594 | 624 |
} |
내보내기 Unified diff