/// <summary> /// Recursively expand all monotype Drawables from the given Composite /// </summary> public static List <AbstractDrawable> GetDecomposition(AbstractComposite input) { List <AbstractDrawable> selection = new List <AbstractDrawable>(); foreach (AbstractDrawable c in input.GetDrawables) { if ((c != null) && c.Displayed) { AbstractComposite cAC = c as AbstractComposite; AbstractDrawable cAD = c as AbstractDrawable; if (cAC != null) { selection.AddRange(GetDecomposition(cAC)); } else if (cAD != null) { selection.Add(cAD); } } } return(selection); }
public static List <AbstractDrawable> GetDecomposition(List <AbstractDrawable> drawables) { List <AbstractDrawable> monotypes = new List <AbstractDrawable>(); foreach (AbstractDrawable c in drawables) { if ((c != null) && c.Displayed) { AbstractComposite cAC = c as AbstractComposite; AbstractDrawable cAD = c as AbstractDrawable; if (cAC != null) { monotypes.AddRange(GetDecomposition(cAC)); } else if (cAD != null) { monotypes.Add(cAD); } } } return(monotypes); }