private bool drawTree(Graphics g) { if (_boxen == null) { return(false); } _config = _boxen.getConfiguration() as TreeConfiguration; if (_config == null) { return(false); } _g = g; _g.Clear(_config.BackColor.GetColor()); _g.ScaleTransform(_zoom, _zoom); _g.TranslateTransform(_margin, _margin); // TODO create and cache outside paint // TODO need to dispose _duplPen = _config.DuplLine.GetPen(); _multEdge = _config.MMargLine.GetPen(); _border = _config.NodeBorder.GetPen(); _spousePen = _config.SpouseLine.GetPen(); _childPen = _config.ChildLine.GetPen(); PaintEdges(GetTree().getRoot()); _nextLevel = 1; // paint the boxes foreach (var node in _boxen.getNodeBounds().Keys) { paintNode(node); } return(true); }