개정판 661b7416
issue #999: Add FromString to all of controls
Change-Id: I64093e34a5f9e8d367cbed769ff4db8d7472cb7a
MarkupToPDF/Controls/Shape/TriControl.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 |
{ |
... | ... | |
325 | 326 |
this.SetTri(); |
326 | 327 |
} |
327 | 328 |
|
328 |
public void SetTri()
|
|
329 |
private void SetTri()
|
|
329 | 330 |
{ |
330 | 331 |
this.ApplyTemplate(); |
331 | 332 |
Base_TriPath.StrokeDashArray.Clear(); |
... | ... | |
436 | 437 |
} |
437 | 438 |
} |
438 | 439 |
|
440 |
/// <summary> |
|
441 |
/// create a tricontrol from given string |
|
442 |
/// </summary> |
|
443 |
/// <param name="str"></param> |
|
444 |
/// <returns></returns> |
|
445 |
public static TriControl FromString(string str, SolidColorBrush brush, string sProjectNo) |
|
446 |
{ |
|
447 |
using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(str)) |
|
448 |
{ |
|
449 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
450 |
return new TriControl |
|
451 |
{ |
|
452 |
LineSize = Convert.ToDouble(data2.First()), |
|
453 |
MidPoint = s.MidPoint, |
|
454 |
StartPoint = s.StartPoint, |
|
455 |
Paint = s.Paint, |
|
456 |
EndPoint = s.EndPoint, |
|
457 |
Opacity = s.Opac, |
|
458 |
Angle = s.Angle, |
|
459 |
DashSize = s.DashSize, |
|
460 |
PointSet = s.PointSet, |
|
461 |
StrokeColor = brush, |
|
462 |
UserID = s.UserID, |
|
463 |
Memo = s.Memo |
|
464 |
}; |
|
465 |
} |
|
466 |
} |
|
467 |
|
|
439 | 468 |
//public void ChangePaint(PaintSet state) |
440 | 469 |
//{ |
441 | 470 |
// this.Paint = state; |
내보내기 Unified diff