Svg.SvgExtentions.ApplyRecursive C# (CSharp) Method

ApplyRecursive() public static method

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