Ejemplo n.º 1
0
        private void RenderCatalogPart(HtmlTextWriter writer, CatalogPart catalogPart, CatalogPartChrome chrome, ref bool firstCell) {
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            if (!firstCell) {
                writer.AddStyleAttribute(HtmlTextWriterStyle.PaddingTop, "0");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            firstCell = false;

            chrome.RenderCatalogPart(writer, catalogPart);

            writer.RenderEndTag();  // Td
            writer.RenderEndTag();  // Tr
        }
Ejemplo n.º 2
0
        protected override void RenderBody(HtmlTextWriter writer)
        {
            RenderBodyTableBeginTag(writer);
            if (DesignMode)
            {
                RenderDesignerRegionBeginTag(writer, Orientation.Vertical);
            }

            CatalogPartCollection catalogParts = CatalogParts;

            if (catalogParts != null && catalogParts.Count > 0)
            {
                bool firstCell = true;
                // Only render links if there is more than 1 catalog part (VSWhidbey 77672)
                if (catalogParts.Count > 1)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    firstCell = false;
                    RenderCatalogPartLinks(writer);
                    writer.RenderEndTag();  // Td
                    writer.RenderEndTag();  // Tr
                }

                CatalogPartChrome chrome = CatalogPartChrome;
                if (DesignMode)
                {
                    foreach (CatalogPart catalogPart in catalogParts)
                    {
                        RenderCatalogPart(writer, catalogPart, chrome, ref firstCell);
                    }
                }
                else
                {
                    CatalogPart selectedCatalogPart = SelectedCatalogPart;
                    if (selectedCatalogPart != null)
                    {
                        RenderCatalogPart(writer, selectedCatalogPart, chrome, ref firstCell);
                    }
                }

                writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                // Mozilla renders padding on an empty TD without this attribute
                writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "0");

                // Add an extra row with height of 100%, to [....] up any extra space
                // if the height of the zone is larger than its contents
                // Mac IE needs height=100% set on <td> instead of <tr>
                writer.AddStyleAttribute(HtmlTextWriterStyle.Height, "100%");

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.RenderEndTag(); // Td
                writer.RenderEndTag(); // Tr
            }
            else
            {
                RenderEmptyZoneText(writer);
            }

            if (DesignMode)
            {
                RenderDesignerRegionEndTag(writer);
            }
            RenderBodyTableEndTag(writer);
        }
Ejemplo n.º 3
0
        private void RenderCatalogPart(HtmlTextWriter writer, CatalogPart catalogPart, CatalogPartChrome chrome, ref bool firstCell)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            if (!firstCell)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.PaddingTop, "0");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            firstCell = false;

            chrome.RenderCatalogPart(writer, catalogPart);

            writer.RenderEndTag();  // Td
            writer.RenderEndTag();  // Tr
        }
Ejemplo n.º 4
0
        // We don't need to handle WebPartManager.DisplayModeChanged in this class.
        // We need it in EditorZoneBase since the available editor parts changes when the
        // WebPartToEdit changes, but the list of catalog parts never changes
        // when the DisplayMode changes.

        protected internal override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            CatalogPartChrome.PerformPreRender();
            Page.RegisterRequiresPostBack(this);
        }