개정판 58dd9e89
Fix: 스탬의 COMPANY_NAME이 실제 회사 이름으로 대체도지 않는 오류 수정
Change-Id: Ief8011c7d7ce974f1881907911f45c8c446a7e98
MarkupToPDF/Controls/Parsing/MarkupParse.cs | ||
---|---|---|
208 | 208 |
/// 데이터베이스의 마크업데이터를 컨트롤로 변환한다. |
209 | 209 |
/// </summary> |
210 | 210 |
/// <param name="MarkupString"></param> |
211 |
public static async Task<bool> ParseAsync(string baseUri, string sProjectNo, string MarkupString, Canvas Layer,double PageAngle, string DisplayColor, string ToolTipMessage, System.Threading.CancellationToken cts) |
|
211 |
public static async Task<bool> ParseAsync(string baseUri, string sProjectNo, string MarkupString, Canvas Layer,double PageAngle, |
|
212 |
string DisplayColor, string ToolTipMessage, System.Threading.CancellationToken cts, Dictionary<string, string> STAMP_Contents = null) |
|
212 | 213 |
{ |
213 | 214 |
bool result = false; |
214 | 215 |
|
... | ... | |
223 | 224 |
foreach (var token in tokens) |
224 | 225 |
{ |
225 | 226 |
var item = await JsonSerializerHelper.UnCompressStringAsync(token,cts); //언패킹작업 |
226 |
CommentUserInfo control = MarkupParser.FromString(baseUri, item, _SetColor, sProjectNo,PageAngle); |
|
227 |
CommentUserInfo control = MarkupParser.FromString(baseUri, item, _SetColor, sProjectNo, PageAngle);
|
|
227 | 228 |
|
228 | 229 |
if (control != null) |
229 | 230 |
{ |
... | ... | |
253 | 254 |
SymControlN _instance = control as SymControlN; |
254 | 255 |
|
255 | 256 |
var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStamp(_instance.PathXathData); |
256 |
|
|
257 |
System.IO.MemoryStream stream = new System.IO.MemoryStream(); |
|
258 |
System.IO.StreamWriter writer = new System.IO.StreamWriter(stream); |
|
259 |
writer.Write(xamlData); |
|
260 |
writer.Flush(); |
|
261 |
stream.Position = 0; |
|
262 |
|
|
263 |
object obj = XamlReader.Load(stream); |
|
264 |
_instance.Base_ViewBox.Child = obj as UIElement; |
|
265 |
_instance.SetViewBox(); |
|
257 |
|
|
258 |
using (System.IO.MemoryStream stream = new System.IO.MemoryStream()) |
|
259 |
{ |
|
260 |
System.IO.StreamWriter writer = new System.IO.StreamWriter(stream); |
|
261 |
xamlData = xamlData.Replace("#FFFF0000", DisplayColor); |
|
262 |
|
|
263 |
if (STAMP_Contents?.Count > 0) |
|
264 |
{ |
|
265 |
foreach (var Content in STAMP_Contents) |
|
266 |
{ |
|
267 |
xamlData = xamlData.Replace(Content.Key, System.Security.SecurityElement.Escape(Content.Value)); |
|
268 |
} |
|
269 |
} |
|
270 |
|
|
271 |
writer.Write(xamlData); |
|
272 |
writer.Flush(); |
|
273 |
stream.Position = 0; |
|
274 |
|
|
275 |
object obj = XamlReader.Load(stream); |
|
276 |
_instance.Base_ViewBox.Child = obj as UIElement; |
|
277 |
_instance.SetViewBox(); |
|
278 |
} |
|
266 | 279 |
} |
267 | 280 |
else if(control is ImgControl) |
268 | 281 |
{ |
... | ... | |
330 | 343 |
else if (control is SymControlN SymCtrl) |
331 | 344 |
{ |
332 | 345 |
var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStamp(SymCtrl.PathXathData); |
333 |
|
|
334 |
System.IO.MemoryStream stream = new System.IO.MemoryStream(); |
|
335 |
System.IO.StreamWriter writer = new System.IO.StreamWriter(stream); |
|
336 |
xamlData = xamlData.Replace("#FFFF0000", DisplayColor); |
|
337 | 346 |
|
338 |
if (STAMP_Contents?.Count > 0)
|
|
347 |
using (System.IO.MemoryStream stream = new System.IO.MemoryStream())
|
|
339 | 348 |
{ |
340 |
foreach (var Content in STAMP_Contents) |
|
349 |
System.IO.StreamWriter writer = new System.IO.StreamWriter(stream); |
|
350 |
xamlData = xamlData.Replace("#FFFF0000", DisplayColor); |
|
351 |
|
|
352 |
if (STAMP_Contents?.Count > 0) |
|
341 | 353 |
{ |
342 |
xamlData = xamlData.Replace(Content.Key, System.Security.SecurityElement.Escape(Content.Value)); |
|
354 |
foreach (var Content in STAMP_Contents) |
|
355 |
{ |
|
356 |
xamlData = xamlData.Replace(Content.Key, System.Security.SecurityElement.Escape(Content.Value)); |
|
357 |
} |
|
343 | 358 |
} |
344 |
} |
|
345 | 359 |
|
346 |
writer.Write(xamlData); |
|
347 |
writer.Flush(); |
|
348 |
stream.Position = 0; |
|
360 |
writer.Write(xamlData);
|
|
361 |
writer.Flush();
|
|
362 |
stream.Position = 0;
|
|
349 | 363 |
|
350 |
object obj = XamlReader.Load(stream); |
|
351 |
SymCtrl.Base_ViewBox.Child = obj as UIElement; |
|
352 |
SymCtrl.SetViewBox(); |
|
364 |
object obj = XamlReader.Load(stream); |
|
365 |
SymCtrl.Base_ViewBox.Child = obj as UIElement; |
|
366 |
SymCtrl.SetViewBox(); |
|
367 |
} |
|
353 | 368 |
} |
354 | 369 |
} |
355 | 370 |
} |
내보내기 Unified diff