개정판 661b7416
issue #999: Add FromString to all of controls
Change-Id: I64093e34a5f9e8d367cbed769ff4db8d7472cb7a
MarkupToPDF/Controls/Etc/DateControl.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.Etc |
19 | 20 |
{ |
... | ... | |
361 | 362 |
Base_TextBox.Visibility = System.Windows.Visibility.Hidden; |
362 | 363 |
SetDate(); |
363 | 364 |
} |
364 |
public void SetDate() |
|
365 |
|
|
366 |
private void SetDate() |
|
365 | 367 |
{ |
366 | 368 |
if (Text == null) |
367 | 369 |
{ |
... | ... | |
486 | 488 |
return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
487 | 489 |
} |
488 | 490 |
} |
491 |
|
|
492 |
/// <summary> |
|
493 |
/// create a datecontrol from given string |
|
494 |
/// </summary> |
|
495 |
/// <param name="str"></param> |
|
496 |
/// <returns></returns> |
|
497 |
public static DateControl FromString(string str, SolidColorBrush brush, string sProjectNo) |
|
498 |
{ |
|
499 |
using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(str)) |
|
500 |
{ |
|
501 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
502 |
return new DateControl |
|
503 |
{ |
|
504 |
Angle = s.Angle, |
|
505 |
StartPoint = s.StartPoint, |
|
506 |
EndPoint = s.EndPoint, |
|
507 |
LeftBottomPoint = s.LB, |
|
508 |
TopRightPoint = s.TR, |
|
509 |
Opacity = s.Opac, |
|
510 |
FontColor = brush, |
|
511 |
LineSize = Convert.ToDouble(data2.First()), |
|
512 |
Text = s.Text, |
|
513 |
PointSet = s.PointSet, |
|
514 |
UserID = s.UserID, |
|
515 |
Memo = s.Memo |
|
516 |
}; |
|
517 |
} |
|
518 |
} |
|
489 | 519 |
} |
490 | 520 |
} |
내보내기 Unified diff