public static void DoRecursivePkg(EA.Repository rep, EA.Package pkg, SetPackage setPkg, SetElement setEl, SetDiagram setDia, string[] s) { // perform package setPkg?.Invoke(rep, pkg, s); // perform diagrams of package foreach (EA.Diagram dia in pkg.Diagrams) { if (dia != null) { setDia(rep, dia, s); } } // run elements of package foreach (EA.Element el in pkg.Elements) { if (setEl != null) { DoRecursiveEl(rep, el, setEl, setDia, s); } } // run packages of package foreach (EA.Package pkgTrgt in pkg.Packages) { DoRecursivePkg(rep, pkgTrgt, setPkg, setEl, setDia, s); } }
public static void DoRecursivePkg(Repository rep, EA.Package pkg, SetPackage setPkg, SetElement setEl, SetDiagram setDia, string[] parameterStrings, ChangeScope changeScope) { // Change package setPkg?.Invoke(rep, pkg, parameterStrings); // only the package itself if (changeScope == ChangeScope.Item) { return; } // perform diagrams of package foreach (EA.Diagram dia in pkg.Diagrams) { if (dia != null) { setDia?.Invoke(rep, dia, parameterStrings); } } // run elements of package foreach (EA.Element el in pkg.Elements) { DoRecursiveEl(rep, el, setEl, setDia, parameterStrings, changeScope); } // run packages of package if (changeScope != ChangeScope.Item) { if (changeScope == ChangeScope.Package) { // inside package only the items changeScope = ChangeScope.Item; } foreach (EA.Package pkgTrgt in pkg.Packages) { DoRecursivePkg(rep, pkgTrgt, setPkg, setEl, setDia, parameterStrings, changeScope); } } }