Type = Integer 태그 값을 사용하면 태그가 지정된 값 공간에 기본값 0이 표시되므로 C# Add-Enterprise Enterprise Architect를 작성하여 태그 값을 유효화합니다. Type = String의 태그 값을 지정하고 사용자가 입력 한 값의 유효성을 검사했습니다. 다음 코드를 사용하고 있습니다.Enterprise Architect의 C# 추가 기능을 통한 태그 값 유효성 검사
public bool EA_OnNotifyContextItemModified(EA.Repository Repository, string GUID, EA.ObjectType ot)
{
string test_value;
bool isInteger;
int integer_converted;
if (ot == EA.ObjectType.otElement)
{
EA.Element element = (EA.Element)Repository.GetElementByGuid(GUID);
EA.TaggedValue tag = element.TaggedValues.GetByName("MAX-BASE-TYPE-SIZE");
test_value = tag.Value;
if (string.IsNullOrEmpty(test_value))
{
Session.Repository.WriteOutput("EA", "Enter any Value", 1);
}
else
{
isInteger = int.TryParse(test_value, out integer_converted);
if (isInteger == false)
{
string empty = " ";
tag.Value = empty;
tag.Update();
Session.Repository.WriteOutput("EA", "Enter Integer Value" + " " + tag.Name + ":" + "", 1);
}
}
}
}
}
return true;
}
문제는 그 요소의 속성 창을 닫고 요소를 다시 열 때 빈 문자열에 잘못된 태그 값의 교체에만 발생한다.
매번 요소를 닫은 다음 다시 열지 않고 커서를 요소 자체의 태그 값으로 이동하면 빈 문자열로 업데이트 된 태그 값을 보는 방법.
친절하게 도움을드립니다. 미리 감사드립니다.
EA 속성 창을 고수하는 이유는 무엇입니까? 태그가있는 값을 요소에 추가하기위한 간단한 양식을 작성하면 쉽게 검증 할 수 있습니다. – Arshad
나는 값의 유효성을 검사하려고하는 이유 인이 요소에 대해 RefGUID, RefGUIDList라는 태그 값을 가질 필요가 있습니다. – rashmi
사용자 정의 창 에서조차 모든 값을 얻을 수 있습니다. – Arshad