개정판 661b7416
issue #999: Add FromString to all of controls
Change-Id: I64093e34a5f9e8d367cbed769ff4db8d7472cb7a
MarkupToPDF/Controls/Shape/CircleControl.cs | ||
---|---|---|
5 | 5 |
using System; |
6 | 6 |
using System.Collections.Generic; |
7 | 7 |
using System.ComponentModel; |
8 |
using System.Linq; |
|
8 | 9 |
using System.Windows; |
9 | 10 |
using System.Windows.Media; |
10 | 11 |
using System.Windows.Shapes; |
... | ... | |
358 | 359 |
if (PropertyChanged != null) |
359 | 360 |
PropertyChanged(this, new PropertyChangedEventArgs(propName)); |
360 | 361 |
} |
361 |
public void SetCircle()
|
|
362 |
private void SetCircle()
|
|
362 | 363 |
{ |
363 | 364 |
Base_CirclePath.StrokeDashArray.Clear(); |
364 | 365 |
foreach (var item in this.DashSize) |
... | ... | |
471 | 472 |
return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
472 | 473 |
}; |
473 | 474 |
} |
475 |
|
|
476 |
/// <summary> |
|
477 |
/// create a circlecontrol from given string |
|
478 |
/// </summary> |
|
479 |
/// <param name="str"></param> |
|
480 |
/// <returns></returns> |
|
481 |
public static CircleControl FromString(string str, SolidColorBrush brush, string sProjectNo) |
|
482 |
{ |
|
483 |
using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(str)) |
|
484 |
{ |
|
485 |
string[] data2 = s.SizeSet.Split(CommentUserInfo.delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
486 |
return new CircleControl |
|
487 |
{ |
|
488 |
LineSize = Convert.ToDouble(data2.First()), |
|
489 |
Paint = s.PaintState, |
|
490 |
StartPoint = s.StartPoint, |
|
491 |
EndPoint = s.EndPoint, |
|
492 |
LeftBottomPoint = s.LBP, |
|
493 |
TopRightPoint = s.TRP, |
|
494 |
Opacity = s.Opac, |
|
495 |
Angle = s.Angle, |
|
496 |
DashSize = s.DashSize, |
|
497 |
PointSet = s.PointSet, |
|
498 |
StrokeColor = brush, |
|
499 |
UserID = s.UserID, |
|
500 |
Memo = s.Memo |
|
501 |
}; |
|
502 |
} |
|
503 |
} |
|
474 | 504 |
} |
475 | 505 |
} |
내보내기 Unified diff