Iterate Through a .EAP File

public Object

 

''Assume repository has already been opened.

 

''Start at the model level

Sub DumpModel()

       Dim idx as Integer

       For idx=0 to m_Repository.Models.Count-1

               DumpPackage("",m_Repository.Models.GetAt(idx))

       Next

End Sub

 

'output package name, then element contents, then process child packages

Sub DumpPackage(Indent as String, Package as Object)

       Dim idx as Integer

       Console.WriteLine(Indent + Package.Name)

       DumpElements(Indent + "    ", Package)

       

       For idx = 0 to Package.Packages.Count-1

               DumpPackage(Indent + "    ", Package.Packages.GetAt(idx))

       Next

End Sub

 

''dump element name

Sub DumpElements(Indent as String, Package as Object)

       Dim idx as Integer

       For idx = 0 to Package.Elements.Count-1

               Console.WriteLine(Indent + "::" +  Package.Elements.GetAt(idx).Name)

       Next

End Sub