diff -r 3145aadca3d2 -r 0c551e8818e0 External/Aga.Controls/Tree/NodeControls/NodeStateIcon.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/External/Aga.Controls/Tree/NodeControls/NodeStateIcon.cs Sun May 27 15:16:19 2012 +0000 @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using Aga.Controls.Properties; + +namespace Aga.Controls.Tree.NodeControls +{ + public class NodeStateIcon: NodeIcon + { + private Image _leaf; + private Image _opened; + private Image _closed; + + public NodeStateIcon() + { + _leaf = MakeTransparent(Resources.Leaf); + _opened = MakeTransparent(Resources.Folder); + _closed = MakeTransparent(Resources.FolderClosed); + } + + private static Image MakeTransparent(Bitmap bitmap) + { + bitmap.MakeTransparent(bitmap.GetPixel(0,0)); + return bitmap; + } + + protected override Image GetIcon(TreeNodeAdv node) + { + Image icon = base.GetIcon(node); + if (icon != null) + return icon; + else if (node.IsLeaf) + return _leaf; + else if (node.CanExpand && node.IsExpanded) + return _opened; + else + return _closed; + } + } +}