private static void _removeAllSelected(LayerageCollection layerageCollection, IList <Layerage> layerages) { foreach (Layerage layerage in layerages) { ILayer layer = layerage.Self; //Recursive if (layer.IsSelected == true) { //Refactoring layer.IsRefactoringTransformer = true; layer.IsRefactoringRender = true; layer.IsRefactoringIconRender = true; layerage.RefactoringParentsTransformer(); layerage.RefactoringParentsRender(); layerage.RefactoringParentsIconRender(); LayerageCollection._removeAll(layerageCollection, layerage.Children); } //Recursive else { LayerageCollection._removeAllSelected(layerageCollection, layerage.Children); } } //Remove Layerage removeLayerage = null; do { layerages.Remove(removeLayerage); removeLayerage = layerages.FirstOrDefault(layerage => layerage.Self.IsSelected == true); }while (removeLayerage != null); }
private static void _removeAll(LayerageCollection layerageCollection, IList <Layerage> layerages) { foreach (Layerage layerage in layerages) { ILayer layer = layerage.Self; //Recursive LayerageCollection._removeAll(layerageCollection, layerage.Children); layerageCollection.RootControls.Remove(layer.Control.Self); } layerages.Clear(); }