// ---------------------------------------------------------------------- public void ForEachChildRecursiveDepthFirst(iCS_EditorObject parent, Action <iCS_EditorObject> fnc) { DetectUndoRedo(); if (parent == null) { EditorObjects[0].ForEachRecursiveDepthFirst(child => fnc(child)); } else { parent.ForEachChildRecursiveDepthFirst(child => fnc(child)); } }
// ------------------------------------------------------------------------- /// Returns the list of functions inside the given package. /// /// @param package The package to examine. /// @return The list of all functions nested inside the package. /// public static List <iCS_EditorObject> GetListOfFunctions(iCS_EditorObject package) { var childFunctions = new List <iCS_EditorObject>(); package.ForEachChildRecursiveDepthFirst( c => { if (c.IsKindOfFunction) { childFunctions.Add(c); } } ); return(childFunctions); }