Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
 public UpdateNode(SitecorePath sitecorePath, TreeNode node, UserControl control)
 {
     Node             = node;
     ControlReference = control;
     SitecorePath     = sitecorePath;
 }