public IEnumerable <PageTemplateDescriptor> GetPageTemplates()
        {
            using (var conn = new DataConnection(PublicationScope.Published))
            {
                var result = new List <PageTemplateDescriptor>();

                foreach (var xmlPageTemplate in conn.Get <IXmlPageTemplate>())
                {
                    string defaultPlaceholderId;
                    PlaceholderDescriptor[] placeholders;

                    ParseLayoutFile(xmlPageTemplate, out placeholders, out defaultPlaceholderId);

                    PageTemplateDescriptor descriptor = new XmlPageTemplateDescriptor(xmlPageTemplate)
                    {
                        Id    = xmlPageTemplate.Id,
                        Title = xmlPageTemplate.Title,
                        DefaultPlaceholderId    = defaultPlaceholderId,
                        PlaceholderDescriptions = placeholders
                    };

                    result.Add(descriptor);
                }

                return(result);
            }
        }
        public IEnumerable<PageTemplateDescriptor> GetPageTemplates()
        {
            using (var conn = new DataConnection(PublicationScope.Published))
            {
                var result = new List<PageTemplateDescriptor>();

                foreach (var xmlPageTemplate in conn.Get<IXmlPageTemplate>())
                {
                    string defaultPlaceholderId;
                    PlaceholderDescriptor[] placeholders;

                    ParseLayoutFile(xmlPageTemplate, out placeholders, out defaultPlaceholderId);

                    PageTemplateDescriptor descriptor = new XmlPageTemplateDescriptor(xmlPageTemplate)
                    {
                        Id = xmlPageTemplate.Id,
                        Title = xmlPageTemplate.Title,
                        DefaultPlaceholderId = defaultPlaceholderId,
                        PlaceholderDescriptions = placeholders
                    };

                    result.Add(descriptor);
                }

                return result;
            }
        }