public void GetDecendents() { if (Retreieved) { return; } Descendents.Clear(); var children = SitecoreClient.GetChildrenDirectories(Path); foreach (var child in children) { var path = string.Format("{0}/{1}", Path, child.Name); var sitecorePath = new SitecorePath(child.Name, path); foreach (var nestedDir in child.Children) { var nestedPath = string.Format("{0}/{1}", path, nestedDir); sitecorePath.Descendents.Add(new SitecorePath(nestedDir, nestedPath)); } Descendents.Add(sitecorePath); } Retreieved = true; }
public static void AddTreeNode(SitecorePath sitecorePath, TreeNodeCollection collection) { if (sitecorePath.NestedNodesAdded) { return; } foreach (var decendent in sitecorePath.Descendents) { collection.Add(decendent.GetNode()); } sitecorePath.NestedNodesAdded = true; }
private void UpdateNestedNode() { try { if (ControlReference.InvokeRequired) { ControlReference.Invoke(new UpdateNestedNodeDel(UpdateNestedNode)); } else { SitecorePath.GetDecendents(); AddTreeNode(SitecorePath, Node.Nodes); UpdateNodeColor(Color.Black, false); } } catch (System.Net.WebException e) { Globals.SitecoreAddin.LogException("Updating nested node:", e); } catch (System.Web.Services.Protocols.SoapException e) { Globals.SitecoreAddin.LogException("Updating nested node:", e); } }
public UpdateNode(SitecorePath sitecorePath, TreeNode node, UserControl control) { Node = node; ControlReference = control; SitecorePath = sitecorePath; }