I have problem with deleting steps from scenario in Add-in for Enterprise Architect
I want delete empty steps of scenario from element, but its not working, this "deleted" steps exists in this scenario. Where is mistake in my code?
short esCnt = element.Scenarios.Count;
for (short esIdx = (short)(esCnt - 1); esIdx >= 0; --esIdx)
{
EA.IDualScenario es = element.Scenarios.GetAt(esIdx);
short essCnt = es.Steps.Count;
for (short essIdx = (short)(essCnt - 1); essIdx >= 0; --essIdx)
{
EA.IDualScenarioStep ess = es.Steps.GetAt(essIdx);
if (ess.Name.Trim().Length == 0 &&
ess.Uses.Trim().Length == 0 &&
ess.Results.Trim().Length == 0)
{
//1. section
es.Steps.Delete(essIdx);
ess.Update();
}
}
//2. section
es.Update();
}
Do you have any ideas?