Ejemplo n.º 1
0
 /// <summary>
 /// Returns the preview text if based on the document list property <see cref="ShowText"/>.
 /// </summary>
 /// <param name="container">The container of the currently rendered PageList template.</param>
 /// <returns>Preview text for the document if <see cref="ShowText"/> is set to true, otherwise <see cref="String.Empty"/>.</returns>
 protected string GetPreviewText(PageTemplateContainer container)
 {
     if (ShowText)
     {
         return container.PreviewText;
     }
     return string.Empty;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns the preview text if based on the document list property <see cref="ShowText"/>.
 /// </summary>
 /// <param name="container">The container of the currently rendered PageList template.</param>
 /// <returns>Preview text for the document if <see cref="ShowText"/> is set to true, otherwise <see cref="String.Empty"/>.</returns>
 protected string GetPreviewText(PageTemplateContainer container)
 {
     if (ShowText)
     {
         return(container.PreviewText);
     }
     return(string.Empty);
 }
Ejemplo n.º 3
0
        private void CreateItemTemplateControl(PageData page, int level, bool hasChildren, PageReference currentPageLink)
        {
            PageTemplateContainer template = new PageTemplateContainer(page, level, hasChildren);

            if (level == 1)
            {
                if (page.PageLink.CompareToIgnoreWorkID(currentPageLink) && this.IsExpanded(page.PageLink))
                {
                    this.InstantiateSelectedExpandedTopTemplate(template);
                }
                else if (this.IsExpanded(page.PageLink))
                {
                    this.InstantiateExpandedTopTemplate(template);
                }
                else if (page.PageLink.CompareToIgnoreWorkID(currentPageLink))
                {
                    this.InstantiateSelectedTopTemplate(template);
                }
                else
                {
                    this.InstantiateTopTemplate(template);
                }
            }
            else if (page.PageLink.CompareToIgnoreWorkID(currentPageLink) && this.IsExpanded(page.PageLink))
            {
                this.InstantiateSelectedExpandedItemTemplate(template);
            }
            else if (this.IsExpanded(page.PageLink))
            {
                this.InstantiateExpandedItemTemplate(template);
            }
            else if (page.PageLink.CompareToIgnoreWorkID(currentPageLink))
            {
                this.InstantiateSelectedItemTemplate(template);
            }
            else
            {
                this.InstantiateItemTemplate(template);
            }
            if (ItemDataBound != null)
            {
                var pageTreeEventArgs = new PageTreeEventArgs
                {
                    Item     = template,
                    DataItem = page
                };
                ItemDataBound.Invoke(this, pageTreeEventArgs);
            }
            this.Controls.Add(template);
        }
Ejemplo n.º 4
0
 private void CreateItemTemplateControl(PageData page, int level, bool hasChildren, PageReference currentPageLink)
 {
     PageTemplateContainer template = new PageTemplateContainer(page, level, hasChildren);
     if (level == 1)
     {
         if (page.PageLink.CompareToIgnoreWorkID(currentPageLink) && this.IsExpanded(page.PageLink))
         {
             this.InstantiateSelectedExpandedTopTemplate(template);
         }
         else if (this.IsExpanded(page.PageLink))
         {
             this.InstantiateExpandedTopTemplate(template);
         }
         else if (page.PageLink.CompareToIgnoreWorkID(currentPageLink))
         {
             this.InstantiateSelectedTopTemplate(template);
         }
         else
         {
             this.InstantiateTopTemplate(template);
         }
     }
     else if (page.PageLink.CompareToIgnoreWorkID(currentPageLink) && this.IsExpanded(page.PageLink))
     {
         this.InstantiateSelectedExpandedItemTemplate(template);
     }
     else if (this.IsExpanded(page.PageLink))
     {
         this.InstantiateExpandedItemTemplate(template);
     }
     else if (page.PageLink.CompareToIgnoreWorkID(currentPageLink))
     {
         this.InstantiateSelectedItemTemplate(template);
     }
     else
     {
         this.InstantiateItemTemplate(template);
     }
     if (ItemDataBound != null)
     {
         var pageTreeEventArgs = new PageTreeEventArgs
         {
             Item = template,
             DataItem = page
         };
         ItemDataBound.Invoke(this, pageTreeEventArgs);
     }
     this.Controls.Add(template);
 }