Exemplo n.º 1
0
        /// <summary>
        /// Draws element
        /// </summary>
        /// <param name="element">The element</param>
        /// <param name="drawing">The interface</param>
        /// <param name="graphics">The graphics</param>
        static public void Draw(XElement element, IDrawing drawing, Graphics graphics)
        {
            bool rec = false;
            Action <XElement, Graphics> draw = drawing.GetDrawing(element, out rec);

            if (draw != null)
            {
                draw(element, graphics);
            }
            if (rec)
            {
                IEnumerable <XElement> nl = element.GetChildNodes();
                foreach (XElement node in nl)
                {
                    if (node is XElement)
                    {
                        Draw(node as XElement, drawing, graphics);
                    }
                }
            }
        }