Example #1
0
        public PageLayoutManager(ApplicationPartManager applicationPartManager)
        {
            this.ApplicationPartManager = applicationPartManager;

            this.PageLayoutDescriptors = new PageLayoutDescriptorCollection();

            this.Initialize();
        }
Example #2
0
        public PageLayoutDescriptorCollection GetByKind(PageLayoutKind kind)
        {
            PageLayoutDescriptorCollection pageLayoutDescriptors = new PageLayoutDescriptorCollection();

            foreach (PageLayoutDescriptor pageLayoutDescriptor in this)
            {
                if (pageLayoutDescriptor.Kind == kind)
                {
                    pageLayoutDescriptors.Add(pageLayoutDescriptor);
                }
            }

            return(pageLayoutDescriptors);
        }
Example #3
0
        public string GetPageLayout(PageLayoutKind kind, string layoutName)
        {
            PageLayoutDescriptorCollection pageLayoutDescriptors = this.PageLayoutDescriptors.GetByKind(kind);

            foreach (PageLayoutDescriptor pageLayoutDescriptor in pageLayoutDescriptors)
            {
                if (pageLayoutDescriptor.Name == layoutName)
                {
                    return(pageLayoutDescriptor.RelativePath);
                }
            }

            return("");
        }