Пример #1
0
 private void AddResourceRecursive(IResource res, string resType, int propParent, int indent,
                                   AcceptResourceDelegate acceptDelegate)
 {
     Items.Add(res);
     SetItemIndent(res, indent);
     foreach (IResource child in res.GetLinksTo(resType, propParent))
     {
         if (acceptDelegate == null || acceptDelegate(child))
         {
             AddResourceRecursive(child, resType, propParent, indent + 16, acceptDelegate);
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Adds a hierarchy of resources with the specified root and parent link to the combo box.
 /// </summary>
 /// <param name="rootResource">The root of the resource hierarchy.</param>
 /// <param name="resType">The type of resources to add, or null if resources of all types
 /// are added.</param>
 /// <param name="propParent">The ID of a link property linking a resource in a hierarchy
 /// to its parent.</param>
 /// <param name="acceptDelegate">The delegate which can be used to filter out parts of the
 /// hierarchy.</param>
 public void AddResourceHierarchy(IResource rootResource, string resType, int propParent,
                                  AcceptResourceDelegate acceptDelegate)
 {
     AddResourceRecursive(rootResource, resType, propParent, 0, acceptDelegate);
 }