개정판 71ba1ca3
dev issue #000 : fix bug
Change-Id: I254e19b9c8f4ca7d618d9542c0190bb47fa87edc
DTI_PID/SPPIDConverter/Util/SPPIDUtil.cs | ||
---|---|---|
388 | 388 |
|
389 | 389 |
return null; |
390 | 390 |
} |
391 |
|
|
392 |
public static Symbol FindSymbolByRepresentationID(Document document, string repID) |
|
393 |
{ |
|
394 |
Symbol findSymbol = null; |
|
395 |
foreach (var symbol in document.SYMBOLS) |
|
396 |
{ |
|
397 |
if (symbol.SPPID.RepresentationId == repID) |
|
398 |
{ |
|
399 |
findSymbol = symbol; |
|
400 |
} |
|
401 |
else |
|
402 |
{ |
|
403 |
ChildSymbol childSymbol = FindChildSymbolByRepresentationID(document, symbol, repID); |
|
404 |
if (childSymbol != null) |
|
405 |
findSymbol = symbol; |
|
406 |
} |
|
407 |
|
|
408 |
if (findSymbol != null) |
|
409 |
break; |
|
410 |
} |
|
411 |
|
|
412 |
return findSymbol; |
|
413 |
} |
|
414 |
|
|
415 |
public static ChildSymbol FindChildSymbolByRepresentationID(Document document, Symbol symbol, string repID) |
|
416 |
{ |
|
417 |
ChildSymbol childSymbol = null; |
|
418 |
|
|
419 |
foreach (ChildSymbol loopChild in symbol.ChildSymbols) |
|
420 |
{ |
|
421 |
if (loopChild.SPPID.RepresentationId == repID) |
|
422 |
{ |
|
423 |
childSymbol = loopChild; |
|
424 |
break; |
|
425 |
} |
|
426 |
else |
|
427 |
{ |
|
428 |
childSymbol = FindChildSymbolByRepresentationIDLoop(document, repID, loopChild); |
|
429 |
if (childSymbol != null) |
|
430 |
break; |
|
431 |
} |
|
432 |
} |
|
433 |
|
|
434 |
return childSymbol; |
|
435 |
} |
|
436 |
|
|
437 |
private static ChildSymbol FindChildSymbolByRepresentationIDLoop(Document document, string repID, ChildSymbol childSymbol) |
|
438 |
{ |
|
439 |
ChildSymbol findChild = null; |
|
440 |
|
|
441 |
foreach (var item in childSymbol.ChildSymbols) |
|
442 |
{ |
|
443 |
if (item.SPPID.RepresentationId == repID) |
|
444 |
{ |
|
445 |
findChild = item; |
|
446 |
break; |
|
447 |
} |
|
448 |
else |
|
449 |
{ |
|
450 |
findChild = FindChildSymbolByRepresentationIDLoop(document, repID, item); |
|
451 |
if (findChild != null) |
|
452 |
break; |
|
453 |
} |
|
454 |
} |
|
455 |
|
|
456 |
return findChild; |
|
457 |
} |
|
391 | 458 |
} |
392 | 459 |
} |
내보내기 Unified diff