private void CreateMediaTree(IEnumerable <Media> nodes, FolderListItem folder)
        {
            foreach (var media in nodes.Where(media => media != null && media.ContentType != null && media.ContentType.Alias == Constants.Conventions.MediaTypes.Folder))
            {
                var subFolder = new FolderListItem
                {
                    id   = media.Id,
                    name = media.Text
                };

                if (media.HasChildren)
                {
                    CreateMediaTree(media.Children, subFolder);
                }

                folder.folders.Add(subFolder);
            }
        }
Esempio n. 2
0
        private void CreateMediaTree(IEnumerable<Media> nodes, FolderListItem folder)
        {
            foreach (var media in nodes.Where(media => media != null && media.ContentType != null && media.ContentType.Alias == Constants.Conventions.MediaTypes.Folder))
            {
                var subFolder = new FolderListItem
                {
                    id = media.Id,
                    name = media.Text
                };

                if (media.HasChildren)
                {
                    CreateMediaTree(media.Children, subFolder);
                }

                folder.folders.Add(subFolder);
            }
        }