Svg.SvgExtentions.ApplyRecursiveDepthFirst C# (CSharp) Method

ApplyRecursiveDepthFirst() public static method

public static ApplyRecursiveDepthFirst ( this elem, Action action ) : void
elem this
action Action
return void
        public static void ApplyRecursiveDepthFirst(this SvgElement elem, Action<SvgElement> action)
        {
        	if(!(elem is SvgDocument)) //don't apply action to subtree of documents
        	{
        		foreach (var element in elem.Children)
        		{
        			element.ApplyRecursiveDepthFirst(action);
        		}
        	}
        	
        	action(elem);
        }
    }