protected override void OnPaint(PaintEventArgs e) { int count = 0; Items = new Items(); if (data != null) { PIDL pidl = (PIDL)data.Clone(); while (!pidl.IsDesktop) { Items.Add(new Item(pidl)); pidl = (PIDL)pidl.GetParentFolder().Clone(); count++; } pidl.DisplayName = "My Computer"; Item item = Items.Add(new Item(pidl)); item.Rectangle = new Rectangle(0, 3, 16, 16); item.X = 0; item.Y = 3; item.Hotspot = new Rectangle(17, 3, 17, 16); pidl.Dispose(); int index = sysimagelist.IconIndex(data.Pidl); e.Graphics.DrawImage(sysimagelist.Icon(index).ToBitmap(), new Rectangle(3, 3, 16, 16)); DrawItems(e.Graphics); } Rectangle rect = ClientRectangle; rect.Width--; rect.Height--; e.Graphics.DrawRectangle(RectPen, rect); base.OnPaint(e); }
public System.Collections.ArrayList GetAncestors() { System.Collections.ArrayList list = new System.Collections.ArrayList(); if (this.pidl == IntPtr.Zero) { return(list); } PIDL pidl = (PIDL)Clone(); while (pidl != null) { list.Add(pidl); pidl = pidl.GetParentFolder(); } return(list); }