개정판 661b7416
issue #999: Add FromString to all of controls
Change-Id: I64093e34a5f9e8d367cbed769ff4db8d7472cb7a
MarkupToPDF/Controls/Text/TextControl.cs | ||
---|---|---|
1193 | 1193 |
return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1194 | 1194 |
} |
1195 | 1195 |
} |
1196 |
|
|
1197 |
/// <summary> |
|
1198 |
/// create a textcontrol from given string |
|
1199 |
/// </summary> |
|
1200 |
/// <param name="str"></param> |
|
1201 |
/// <returns></returns> |
|
1202 |
public static TextControl FromString(string str, SolidColorBrush brush, string sProjectNo) |
|
1203 |
{ |
|
1204 |
using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(str)) |
|
1205 |
{ |
|
1206 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
1207 |
TextControl instance = new TextControl() |
|
1208 |
{ |
|
1209 |
Text = s.Text, |
|
1210 |
StartPoint = s.StartPoint, |
|
1211 |
EndPoint = s.EndPoint, |
|
1212 |
CanvasX = s.StartPoint.X, |
|
1213 |
CanvasY = s.StartPoint.Y, |
|
1214 |
BoxWidth = s.BoxW, |
|
1215 |
BoxHeight = s.BoxH, |
|
1216 |
ControlType_No = s.paintMethod, |
|
1217 |
LineSize = new Thickness(Convert.ToDouble(data2.First())), |
|
1218 |
TextSize = Convert.ToDouble(data2[1]), |
|
1219 |
FontColor = brush, |
|
1220 |
FontSize = 10, |
|
1221 |
UserID = s.UserID, |
|
1222 |
IsHighLight = s.isHighLight, |
|
1223 |
Angle = s.Angle, |
|
1224 |
PointSet = s.PointSet, |
|
1225 |
Opacity = s.Opac, |
|
1226 |
TextFamily = new FontFamily(s.fontConfig[0]), |
|
1227 |
//인구 추가(2018.04.17) |
|
1228 |
TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]), |
|
1229 |
TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]), |
|
1230 |
}; |
|
1231 |
|
|
1232 |
if (s.fontConfig.Count() == 4) |
|
1233 |
{ |
|
1234 |
instance.UnderLine = TextDecorations.Underline; |
|
1235 |
} |
|
1236 |
|
|
1237 |
return instance; |
|
1238 |
} |
|
1239 |
} |
|
1196 | 1240 |
} |
1197 | 1241 |
} |
내보내기 Unified diff