private void CloseFolderWithoutRunningDocuments(List <string> docs, UIHierarchyItems items)
        {
            foreach (var item in items.Cast <UIHierarchyItem>().Where(item => item.UIHierarchyItems.Count > 0))
            {
                CloseFolderWithoutRunningDocuments(docs, item.UIHierarchyItems);

                if (ShouldCloseFolder(docs, item))
                {
                    item.UIHierarchyItems.Expanded = false;
                }
            }
        }
        private void CollapseHierarchy(UIHierarchyItems items)
        {
            foreach (var item in items.Cast <UIHierarchyItem>().Where(item => item.UIHierarchyItems.Count > 0))
            {
                CollapseHierarchy(item.UIHierarchyItems);

                if (ShouldCollapse(item))
                {
                    item.UIHierarchyItems.Expanded = false;
                }
            }
        }