Exemplo 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;
        }
Exemplo n.º 2
0
        public SitecoreMediaItem GetDocumentInfo(string path)
        {
            MediaItemStruct mediaItem = null;

            try
            {
                mediaItem = SitecoreClient.GetMediaStatistics(path);
            }
            catch (WebException)
            {
                throw;
            }
            catch (Exception e)
            {
                Globals.SitecoreAddin.LogException("Trying to Download Sitecore Media Item", e);
            }

            return(GetMediaSitecoreItem(mediaItem));
        }