개정판 661b7416
issue #999: Add FromString to all of controls
Change-Id: I64093e34a5f9e8d367cbed769ff4db8d7472cb7a
MarkupToPDF/Controls/Line/ArrowArcControl.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.Line |
19 | 20 |
{ |
... | ... | |
498 | 499 |
return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
499 | 500 |
} |
500 | 501 |
} |
502 |
|
|
503 |
/// <summary> |
|
504 |
/// create a arrowarccontrol from given string |
|
505 |
/// </summary> |
|
506 |
/// <param name="str"></param> |
|
507 |
/// <returns></returns> |
|
508 |
public static ArrowArcControl FromString(string str, SolidColorBrush brush, string sProjectNo) |
|
509 |
{ |
|
510 |
ArrowArcControl instance = null; |
|
511 |
using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(str)) |
|
512 |
{ |
|
513 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
514 |
instance = new ArrowArcControl() |
|
515 |
{ |
|
516 |
StartPoint = s.StartPoint, |
|
517 |
EndPoint = s.EndPoint, |
|
518 |
DashSize = s.DashSize, |
|
519 |
PointSet = s.PointSet, |
|
520 |
isTransOn = s.IsTransOn, |
|
521 |
MidPoint = s.MidPoint, |
|
522 |
StrokeColor = brush, |
|
523 |
Opacity = s.Opac, |
|
524 |
|
|
525 |
Clock = s.Clock, |
|
526 |
LineSize = Convert.ToDouble(data2.First()), |
|
527 |
UserID = s.UserID, |
|
528 |
Memo = s.Memo |
|
529 |
}; |
|
530 |
} |
|
531 |
|
|
532 |
return instance; |
|
533 |
} |
|
501 | 534 |
} |
502 | 535 |
} |
내보내기 Unified diff