/// <summary> /// Builds the items in the path. Ensures that all items have the type T. /// </summary> /// <param name="path">A path in the addin tree.</param> /// <param name="caller">The owner used to create the objects.</param> /// <param name="throwOnNotFound">If true, throws a <see cref="TreePathNotFoundException"/> /// if the path is not found. If false, an empty ArrayList is returned when the /// path is not found.</param> public static List <T> BuildItems <T>(string path, object caller, bool throwOnNotFound) { AddInTreeNode node = GetTreeNode(path, throwOnNotFound); if (node == null) { return(new List <T>()); } else { return(node.BuildChildItems <T>(caller)); } }
public void Apply(IList items) { AddInTreeNode node = AddInTree.GetTreeNode(path, false); if (node != null) { foreach (object o in node.BuildChildItems(caller)) { items.Add(o); } } else { MessageService.ShowError("IncludeDoozer: AddinTree-Path not found: " + path); } }