private void Build()
{
base.Clear();
Hashtable categories = categorised? new Hashtable() : null;
for (int i = 0; i < innerStore.Count; i++)
{
ItemToolboxNode node = (ItemToolboxNode)innerStore [i];
node.SetParent(null);
if (!node.Filter(filter))
{
continue;
}
if (categorised)
{
string cat = node.Category;
if (cat.Length < 1)
{
cat = "Miscellaneous";
}
if (!categories.ContainsKey(cat))
{
categories.Add(cat, new CategoryToolboxNode(cat));
}
((CategoryToolboxNode)categories[cat]).Add(node);
}
else
{
base.AddNode(node);
}
}
if (categorised)
{
ArrayList arrList = new ArrayList(categories.Values);
arrList.Sort(new SortByName());
for (int i = 0; i < arrList.Count; i++)
{
base.AddNode((CategoryToolboxNode)arrList [i]);
}
}
}