protected virtual void RenderVerb(HtmlTextWriter writer, WebPartVerb verb)
        {
            WebControl control;
            string     eventArgument = verb.EventArgument;

            if (this.VerbButtonType == ButtonType.Button)
            {
                ZoneButton button = new ZoneButton(this, eventArgument)
                {
                    Text = verb.Text
                };
                control = button;
            }
            else
            {
                ZoneLinkButton button2 = new ZoneLinkButton(this, eventArgument)
                {
                    Text = verb.Text
                };
                if (this.VerbButtonType == ButtonType.Image)
                {
                    button2.ImageUrl = verb.ImageUrl;
                }
                control = button2;
            }
            control.ApplyStyle(base.VerbStyle);
            control.ToolTip = verb.Description;
            control.Enabled = verb.Enabled;
            control.Page    = this.Page;
            control.RenderControl(writer);
        }
        protected override void RenderHeader(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
            writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "2");
            writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
            writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            TitleStyle headerStyle = base.HeaderStyle;

            if (!headerStyle.IsEmpty)
            {
                Style style2 = new Style();
                if (!headerStyle.ForeColor.IsEmpty)
                {
                    style2.ForeColor = headerStyle.ForeColor;
                }
                style2.Font.CopyFrom(headerStyle.Font);
                if (!headerStyle.Font.Size.IsEmpty)
                {
                    style2.Font.Size = new FontUnit(new Unit(100.0, UnitType.Percentage));
                }
                if (!style2.IsEmpty)
                {
                    style2.AddAttributesToRender(writer, this);
                }
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Table);
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            HorizontalAlign horizontalAlign = headerStyle.HorizontalAlign;

            if (horizontalAlign != HorizontalAlign.NotSet)
            {
                TypeConverter converter = TypeDescriptor.GetConverter(typeof(HorizontalAlign));
                writer.AddAttribute(HtmlTextWriterAttribute.Align, converter.ConvertToString(horizontalAlign));
            }
            writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            writer.Write(this.HeaderText);
            writer.RenderEndTag();
            WebPartVerb headerCloseVerb = this.HeaderCloseVerb;

            if (headerCloseVerb.Visible)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                ZoneLinkButton button = new ZoneLinkButton(this, headerCloseVerb.EventArgument)
                {
                    Text     = headerCloseVerb.Text,
                    ImageUrl = headerCloseVerb.ImageUrl,
                    ToolTip  = headerCloseVerb.Description,
                    Enabled  = headerCloseVerb.Enabled,
                    Page     = this.Page
                };
                button.ApplyStyle(this.HeaderVerbStyle);
                button.RenderControl(writer);
                writer.RenderEndTag();
            }
            writer.RenderEndTag();
            writer.RenderEndTag();
        }
Esempio n. 3
0
        protected virtual void RenderVerb(HtmlTextWriter writer, WebPartVerb verb)
        {
            string     eventArgument = verb.EventArgument;
            WebControl verbControl;

            if (VerbButtonType == ButtonType.Button)
            {
                ZoneButton button = new ZoneButton(this, eventArgument);
                button.Text = verb.Text;
                verbControl = button;
            }
            else
            {
                ZoneLinkButton linkButton = new ZoneLinkButton(this, eventArgument);
                linkButton.Text = verb.Text;
                if (VerbButtonType == ButtonType.Image)
                {
                    linkButton.ImageUrl = verb.ImageUrl;
                }
                verbControl = linkButton;
            }

            verbControl.ApplyStyle(VerbStyle);
            verbControl.ToolTip = verb.Description;
            verbControl.Enabled = verb.Enabled;
            verbControl.Page    = Page;
            verbControl.RenderControl(writer);
        }
Esempio n. 4
0
        protected virtual void RenderCatalogPartLinks(HtmlTextWriter writer)
        {
            RenderInstructionText(writer);

            CatalogPart selectedCatalogPart = SelectedCatalogPart;

            foreach (CatalogPart catalogPart in CatalogParts)
            {
                WebPartDescriptionCollection availableWebParts = catalogPart.GetAvailableWebPartDescriptions();
                int count = ((availableWebParts != null) ? availableWebParts.Count : 0);

                string displayTitle = catalogPart.DisplayTitle;
                //
                string text = displayTitle + " (" + count.ToString(CultureInfo.CurrentCulture) + ")";

                if (catalogPart == selectedCatalogPart)
                {
                    Label label = new Label();
                    label.Text = text;
                    label.Page = Page;
                    label.ApplyStyle(SelectedPartLinkStyle);
                    label.RenderControl(writer);
                }
                else
                {
                    Debug.Assert(!String.IsNullOrEmpty(catalogPart.ID));
                    string eventArgument = selectEventArgument + ID_SEPARATOR + catalogPart.ID;

                    ZoneLinkButton linkButton = new ZoneLinkButton(this, eventArgument);
                    linkButton.Text    = text;
                    linkButton.ToolTip = SR.GetString(SR.CatalogZoneBase_SelectCatalogPart, displayTitle);
                    linkButton.Page    = Page;
                    linkButton.ApplyStyle(PartLinkStyle);
                    linkButton.RenderControl(writer);
                }

                writer.WriteBreak();
            }

            writer.WriteBreak();
        }
Esempio n. 5
0
        protected virtual void RenderCatalogPartLinks(HtmlTextWriter writer)
        {
            this.RenderInstructionText(writer);
            CatalogPart selectedCatalogPart = this.SelectedCatalogPart;

            foreach (CatalogPart part2 in this.CatalogParts)
            {
                WebPartDescriptionCollection availableWebPartDescriptions = part2.GetAvailableWebPartDescriptions();
                int    num          = (availableWebPartDescriptions != null) ? availableWebPartDescriptions.Count : 0;
                string displayTitle = part2.DisplayTitle;
                string str2         = displayTitle + " (" + num.ToString(CultureInfo.CurrentCulture) + ")";
                if (part2 == selectedCatalogPart)
                {
                    Label label = new Label {
                        Text = str2,
                        Page = this.Page
                    };
                    label.ApplyStyle(this.SelectedPartLinkStyle);
                    label.RenderControl(writer);
                }
                else
                {
                    string         eventArgument = "select" + '$' + part2.ID;
                    ZoneLinkButton button        = new ZoneLinkButton(this, eventArgument)
                    {
                        Text    = str2,
                        ToolTip = System.Web.SR.GetString("CatalogZoneBase_SelectCatalogPart", new object[] { displayTitle }),
                        Page    = this.Page
                    };
                    button.ApplyStyle(this.PartLinkStyle);
                    button.RenderControl(writer);
                }
                writer.WriteBreak();
            }
            writer.WriteBreak();
        }
 private void RenderAddVerbs(HtmlTextWriter writer)
 {
     WebPart webPartToConnect = this.WebPartToConnect;
     WebPartCollection webParts = null;
     if (base.WebPartManager != null)
     {
         webParts = base.WebPartManager.WebParts;
     }
     if ((webPartToConnect != null) || base.DesignMode)
     {
         bool designMode = base.DesignMode;
         if (!designMode && (base.WebPartManager != null))
         {
             foreach (ProviderConnectionPoint point in base.WebPartManager.GetEnabledProviderConnectionPoints(webPartToConnect))
             {
                 if (this.GetValidConsumers(webPartToConnect, point, webParts).Count != 0)
                 {
                     designMode = true;
                     break;
                 }
             }
         }
         if (designMode)
         {
             ZoneLinkButton button = new ZoneLinkButton(this, "connectconsumer") {
                 Text = this.ConnectToConsumerText
             };
             button.ApplyStyle(base.VerbStyle);
             button.Page = this.Page;
             button.RenderControl(writer);
             writer.WriteBreak();
         }
         bool flag2 = base.DesignMode;
         if (!flag2 && (base.WebPartManager != null))
         {
             foreach (ConsumerConnectionPoint point2 in base.WebPartManager.GetEnabledConsumerConnectionPoints(webPartToConnect))
             {
                 if (this.GetValidProviders(webPartToConnect, point2, webParts).Count != 0)
                 {
                     flag2 = true;
                     break;
                 }
             }
         }
         if (flag2)
         {
             ZoneLinkButton button2 = new ZoneLinkButton(this, "connectprovider") {
                 Text = this.ConnectToProviderText
             };
             button2.ApplyStyle(base.VerbStyle);
             button2.Page = this.Page;
             button2.RenderControl(writer);
             writer.WriteBreak();
         }
         if (flag2 || designMode)
         {
             writer.RenderBeginTag(HtmlTextWriterTag.Hr);
             writer.RenderEndTag();
         }
     }
 }
Esempio n. 7
0
        private void RenderVerb(HtmlTextWriter writer, WebPart webPart, WebPartVerb verb)
        {
            WebControl verbControl;
            bool       isEnabled = Zone.IsEnabled && verb.Enabled;

            ButtonType verbButtonType = Zone.TitleBarVerbButtonType;

            if (verb == Zone.HelpVerb)
            {
                //
                string resolvedHelpUrl = Zone.ResolveClientUrl(webPart.HelpUrl);

                //
                if (verbButtonType == ButtonType.Button)
                {
                    ZoneButton button = new ZoneButton(Zone, null);

                    if (isEnabled)
                    {
                        if (Zone.RenderClientScript)
                        {
                            button.OnClientClick = "__wpm.ShowHelp('" +
                                                   Util.QuoteJScriptString(resolvedHelpUrl) +
                                                   "', " +
                                                   ((int)webPart.HelpMode).ToString(CultureInfo.InvariantCulture) +
                                                   ");return;";
                        }
                        else
                        {
                            if (webPart.HelpMode != WebPartHelpMode.Navigate)
                            {
                                button.OnClientClick = "window.open('" +
                                                       Util.QuoteJScriptString(resolvedHelpUrl) +
                                                       "', '_blank', 'scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');return;";
                            }
                            else
                            {
                                button.OnClientClick = "window.location.href='" +
                                                       Util.QuoteJScriptString(resolvedHelpUrl) +
                                                       "';return;";
                            }
                        }
                    }
                    button.Text = verb.Text;
                    verbControl = button;
                }
                else
                {
                    HyperLink hyperLink = new HyperLink();

                    switch (webPart.HelpMode)
                    {
                    case WebPartHelpMode.Modal:
                        if (!Zone.RenderClientScript)
                        {
                            goto case WebPartHelpMode.Modeless;
                        }
                        hyperLink.NavigateUrl = "javascript:__wpm.ShowHelp('" +
                                                Util.QuoteJScriptString(resolvedHelpUrl) +
                                                "', 0)";
                        break;

                    case WebPartHelpMode.Modeless:
                        hyperLink.NavigateUrl = resolvedHelpUrl;
                        hyperLink.Target      = "_blank";
                        break;

                    case WebPartHelpMode.Navigate:
                        hyperLink.NavigateUrl = resolvedHelpUrl;
                        break;
                    }

                    hyperLink.Text = verb.Text;
                    if (verbButtonType == ButtonType.Image)
                    {
                        hyperLink.ImageUrl = verb.ImageUrl;
                    }
                    verbControl = hyperLink;
                }
            }
            else if (verb == Zone.ExportVerb)
            {
                string exportUrl = _manager.GetExportUrl(webPart);
                if (verbButtonType == ButtonType.Button)
                {
                    ZoneButton button = new ZoneButton(Zone, String.Empty);
                    button.Text = verb.Text;

                    if (isEnabled)
                    {
                        if ((webPart.ExportMode == WebPartExportMode.All) &&
                            (_personalizationScope == PersonalizationScope.User))
                        {
                            if (Zone.RenderClientScript)
                            {
                                button.OnClientClick = "__wpm.ExportWebPart('" +
                                                       Util.QuoteJScriptString(exportUrl) +
                                                       "', true, false);return false;";
                            }
                            else
                            {
                                button.OnClientClick = "if(__wpmExportWarning.length == 0 || "
                                                       + "confirm(__wpmExportWarning)){window.location='" +
                                                       Util.QuoteJScriptString(exportUrl) +
                                                       "';}return false;";
                            }
                        }
                        else
                        {
                            button.OnClientClick = "window.location='" +
                                                   Util.QuoteJScriptString(exportUrl) +
                                                   "';return false;";
                        }
                    }

                    verbControl = button;
                }
                else
                {
                    // Special case for export which must be a plain HyperLink
                    // (href=javascript:void(0) would ruin any redirecting script)
                    HyperLink link = new HyperLink();
                    link.Text = verb.Text;
                    if (verbButtonType == ButtonType.Image)
                    {
                        link.ImageUrl = verb.ImageUrl;
                    }
                    link.NavigateUrl = exportUrl;
                    if (webPart.ExportMode == WebPartExportMode.All)
                    {
                        // Confirm before exporting
                        if (Zone.RenderClientScript)
                        {
                            link.Attributes.Add("onclick", "return __wpm.ExportWebPart('', true, true)");
                        }
                        else
                        {
                            string onclick = "return (__wpmExportWarning.length == 0 || confirm(__wpmExportWarning))";
                            link.Attributes.Add("onclick", onclick);
                        }
                    }
                    verbControl = link;
                }
            }
            else
            {
                string eventArgument      = verb.GetEventArgument(webPart.ID);
                string clientClickHandler = verb.ClientClickHandler;

                if (verbButtonType == ButtonType.Button)
                {
                    ZoneButton button = new ZoneButton(Zone, eventArgument);
                    button.Text = verb.Text;
                    if (!String.IsNullOrEmpty(clientClickHandler) && isEnabled)
                    {
                        button.OnClientClick = clientClickHandler;
                    }
                    verbControl = button;
                }
                else
                {
                    ZoneLinkButton linkButton = new ZoneLinkButton(Zone, eventArgument);
                    linkButton.Text = verb.Text;
                    if (verbButtonType == ButtonType.Image)
                    {
                        linkButton.ImageUrl = verb.ImageUrl;
                    }
                    if (!String.IsNullOrEmpty(clientClickHandler) && isEnabled)
                    {
                        linkButton.OnClientClick = clientClickHandler;
                    }
                    verbControl = linkButton;
                }

                if (_manager != null && isEnabled)
                {
                    if (verb == Zone.CloseVerb)
                    {
                        // PERF: First check if this WebPart even has provider connection points
                        ProviderConnectionPointCollection connectionPoints = _manager.GetProviderConnectionPoints(webPart);
                        if (connectionPoints != null && connectionPoints.Count > 0 &&
                            Connections.ContainsProvider(webPart))
                        {
                            string onclick = "if (__wpmCloseProviderWarning.length >= 0 && " +
                                             "!confirm(__wpmCloseProviderWarning)) { return false; }";
                            verbControl.Attributes.Add("onclick", onclick);
                        }
                    }
                    else if (verb == Zone.DeleteVerb)
                    {
                        string onclick = "if (__wpmDeleteWarning.length >= 0 && !confirm(__wpmDeleteWarning)) { return false; }";
                        verbControl.Attributes.Add("onclick", onclick);
                    }
                }
            }

            verbControl.ApplyStyle(Zone.TitleBarVerbStyle);
            verbControl.ToolTip = String.Format(CultureInfo.CurrentCulture, verb.Description, webPart.DisplayTitle);
            verbControl.Enabled = verb.Enabled;
            verbControl.Page    = _page;
            verbControl.RenderControl(writer);
        }
Esempio n. 8
0
        protected virtual void RenderCatalogPartLinks(HtmlTextWriter writer) {
            RenderInstructionText(writer);

            CatalogPart selectedCatalogPart = SelectedCatalogPart;
            foreach (CatalogPart catalogPart in CatalogParts) {
                WebPartDescriptionCollection availableWebParts = catalogPart.GetAvailableWebPartDescriptions();
                int count = ((availableWebParts != null) ? availableWebParts.Count : 0);

                string displayTitle = catalogPart.DisplayTitle;
                // 
                string text = displayTitle + " (" + count.ToString(CultureInfo.CurrentCulture) + ")";

                if (catalogPart == selectedCatalogPart) {
                    Label label = new Label();
                    label.Text = text;
                    label.Page = Page;
                    label.ApplyStyle(SelectedPartLinkStyle);
                    label.RenderControl(writer);
                }
                else {
                    Debug.Assert(!String.IsNullOrEmpty(catalogPart.ID));
                    string eventArgument = selectEventArgument + ID_SEPARATOR + catalogPart.ID;

                    ZoneLinkButton linkButton = new ZoneLinkButton(this, eventArgument);
                    linkButton.Text = text;
                    linkButton.ToolTip = SR.GetString(SR.CatalogZoneBase_SelectCatalogPart, displayTitle);
                    linkButton.Page = Page;
                    linkButton.ApplyStyle(PartLinkStyle);
                    linkButton.RenderControl(writer);
                }

                writer.WriteBreak();
            }

            writer.WriteBreak();
        }
Esempio n. 9
0
        protected virtual void RenderVerb(HtmlTextWriter writer, WebPartVerb verb) {
            string eventArgument = verb.EventArgument;
            WebControl verbControl;
            if (VerbButtonType == ButtonType.Button) {
                ZoneButton button = new ZoneButton(this, eventArgument);
                button.Text = verb.Text;
                verbControl = button;
            } else {
                ZoneLinkButton linkButton = new ZoneLinkButton(this, eventArgument);
                linkButton.Text = verb.Text;
                if (VerbButtonType == ButtonType.Image) {
                    linkButton.ImageUrl = verb.ImageUrl;
                }
                verbControl = linkButton;
            }

            verbControl.ApplyStyle(VerbStyle);
            verbControl.ToolTip = verb.Description;
            verbControl.Enabled = verb.Enabled;
            verbControl.Page = Page;
            verbControl.RenderControl(writer);
        }
Esempio n. 10
0
        protected override void RenderHeader(HtmlTextWriter writer) {
            // Render title bar
            writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
            writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "2");
            writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
            writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");

            TitleStyle headerStyle = HeaderStyle;
            if (!headerStyle.IsEmpty) {
                // Apply font and forecolor from HeaderStyle to inner table
                Style style = new Style();
                if (!headerStyle.ForeColor.IsEmpty) {
                    style.ForeColor = headerStyle.ForeColor;
                }
                style.Font.CopyFrom(headerStyle.Font);
                if (!headerStyle.Font.Size.IsEmpty) {
                    // If the font size is specified on the HeaderStyle, force the font size to 100%,
                    // so it inherits the font size from its parent in IE compatibility mode. I would
                    // think that "1em" would work here as well, but "1em" doesn't work when you change
                    // the font size in the browser.
                    style.Font.Size = new FontUnit(new Unit(100, UnitType.Percentage));
                }
                if (!style.IsEmpty) {
                    style.AddAttributesToRender(writer, this);
                }
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Table);

            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            // Copied from Panel.cs
            // 
            HorizontalAlign hAlign = headerStyle.HorizontalAlign;
            if (hAlign != HorizontalAlign.NotSet) {
                TypeConverter hac = TypeDescriptor.GetConverter(typeof(HorizontalAlign));
                writer.AddAttribute(HtmlTextWriterAttribute.Align, hac.ConvertToString(hAlign));
            }

            writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            writer.Write(HeaderText);
            writer.RenderEndTag();  // Td

            WebPartVerb headerCloseVerb = HeaderCloseVerb;
            if (headerCloseVerb.Visible) {
                writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                ZoneLinkButton closeButton = new ZoneLinkButton(this, headerCloseVerb.EventArgument);
                closeButton.Text = headerCloseVerb.Text;
                closeButton.ImageUrl = headerCloseVerb.ImageUrl;
                closeButton.ToolTip = headerCloseVerb.Description;
                closeButton.Enabled = headerCloseVerb.Enabled;
                closeButton.Page = Page;
                closeButton.ApplyStyle(HeaderVerbStyle);
                closeButton.RenderControl(writer);
                writer.RenderEndTag();  // Td
            }

            writer.RenderEndTag();  // Tr
            writer.RenderEndTag();  // Table
        }
 protected virtual void RenderCatalogPartLinks(HtmlTextWriter writer)
 {
     this.RenderInstructionText(writer);
     CatalogPart selectedCatalogPart = this.SelectedCatalogPart;
     foreach (CatalogPart part2 in this.CatalogParts)
     {
         WebPartDescriptionCollection availableWebPartDescriptions = part2.GetAvailableWebPartDescriptions();
         int num = (availableWebPartDescriptions != null) ? availableWebPartDescriptions.Count : 0;
         string displayTitle = part2.DisplayTitle;
         string str2 = displayTitle + " (" + num.ToString(CultureInfo.CurrentCulture) + ")";
         if (part2 == selectedCatalogPart)
         {
             Label label = new Label {
                 Text = str2,
                 Page = this.Page
             };
             label.ApplyStyle(this.SelectedPartLinkStyle);
             label.RenderControl(writer);
         }
         else
         {
             string eventArgument = "select" + '$' + part2.ID;
             ZoneLinkButton button = new ZoneLinkButton(this, eventArgument) {
                 Text = str2,
                 ToolTip = System.Web.SR.GetString("CatalogZoneBase_SelectCatalogPart", new object[] { displayTitle }),
                 Page = this.Page
             };
             button.ApplyStyle(this.PartLinkStyle);
             button.RenderControl(writer);
         }
         writer.WriteBreak();
     }
     writer.WriteBreak();
 }
        private void RenderVerb(HtmlTextWriter writer, WebPart webPart, WebPartVerb verb)
        {
            WebControl control;
            bool flag = this.Zone.IsEnabled && verb.Enabled;
            ButtonType titleBarVerbButtonType = this.Zone.TitleBarVerbButtonType;
            if (verb != this.Zone.HelpVerb)
            {
                if (verb == this.Zone.ExportVerb)
                {
                    string exportUrl = this._manager.GetExportUrl(webPart);
                    if (titleBarVerbButtonType == ButtonType.Button)
                    {
                        ZoneButton button2 = new ZoneButton(this.Zone, string.Empty) {
                            Text = verb.Text
                        };
                        if (flag)
                        {
                            if ((webPart.ExportMode == WebPartExportMode.All) && (this._personalizationScope == PersonalizationScope.User))
                            {
                                if (this.Zone.RenderClientScript)
                                {
                                    button2.OnClientClick = "__wpm.ExportWebPart('" + Util.QuoteJScriptString(exportUrl) + "', true, false);return false;";
                                }
                                else
                                {
                                    button2.OnClientClick = "if(__wpmExportWarning.length == 0 || confirm(__wpmExportWarning)){window.location='" + Util.QuoteJScriptString(exportUrl) + "';}return false;";
                                }
                            }
                            else
                            {
                                button2.OnClientClick = "window.location='" + Util.QuoteJScriptString(exportUrl) + "';return false;";
                            }
                        }
                        control = button2;
                    }
                    else
                    {
                        HyperLink link2 = new HyperLink {
                            Text = verb.Text
                        };
                        if (titleBarVerbButtonType == ButtonType.Image)
                        {
                            link2.ImageUrl = verb.ImageUrl;
                        }
                        link2.NavigateUrl = exportUrl;
                        if (webPart.ExportMode == WebPartExportMode.All)
                        {
                            if (this.Zone.RenderClientScript)
                            {
                                link2.Attributes.Add("onclick", "return __wpm.ExportWebPart('', true, true)");
                            }
                            else
                            {
                                string str3 = "return (__wpmExportWarning.length == 0 || confirm(__wpmExportWarning))";
                                link2.Attributes.Add("onclick", str3);
                            }
                        }
                        control = link2;
                    }
                }
                else
                {
                    string eventArgument = verb.GetEventArgument(webPart.ID);
                    string clientClickHandler = verb.ClientClickHandler;
                    if (titleBarVerbButtonType == ButtonType.Button)
                    {
                        ZoneButton button3 = new ZoneButton(this.Zone, eventArgument) {
                            Text = verb.Text
                        };
                        if (!string.IsNullOrEmpty(clientClickHandler) && flag)
                        {
                            button3.OnClientClick = clientClickHandler;
                        }
                        control = button3;
                    }
                    else
                    {
                        ZoneLinkButton button4 = new ZoneLinkButton(this.Zone, eventArgument) {
                            Text = verb.Text
                        };
                        if (titleBarVerbButtonType == ButtonType.Image)
                        {
                            button4.ImageUrl = verb.ImageUrl;
                        }
                        if (!string.IsNullOrEmpty(clientClickHandler) && flag)
                        {
                            button4.OnClientClick = clientClickHandler;
                        }
                        control = button4;
                    }
                    if ((this._manager != null) && flag)
                    {
                        if (verb == this.Zone.CloseVerb)
                        {
                            ProviderConnectionPointCollection providerConnectionPoints = this._manager.GetProviderConnectionPoints(webPart);
                            if (((providerConnectionPoints != null) && (providerConnectionPoints.Count > 0)) && this.Connections.ContainsProvider(webPart))
                            {
                                string str6 = "if (__wpmCloseProviderWarning.length >= 0 && !confirm(__wpmCloseProviderWarning)) { return false; }";
                                control.Attributes.Add("onclick", str6);
                            }
                        }
                        else if (verb == this.Zone.DeleteVerb)
                        {
                            string str7 = "if (__wpmDeleteWarning.length >= 0 && !confirm(__wpmDeleteWarning)) { return false; }";
                            control.Attributes.Add("onclick", str7);
                        }
                    }
                }
                goto Label_040C;
            }
            string str = this.Zone.ResolveClientUrl(webPart.HelpUrl);
            if (titleBarVerbButtonType == ButtonType.Button)
            {
                ZoneButton button = new ZoneButton(this.Zone, null);
                if (flag)
                {
                    if (this.Zone.RenderClientScript)
                    {
                        button.OnClientClick = "__wpm.ShowHelp('" + Util.QuoteJScriptString(str) + "', " + ((int) webPart.HelpMode).ToString(CultureInfo.InvariantCulture) + ");return;";
                    }
                    else if (webPart.HelpMode != WebPartHelpMode.Navigate)
                    {
                        button.OnClientClick = "window.open('" + Util.QuoteJScriptString(str) + "', '_blank', 'scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');return;";
                    }
                    else
                    {
                        button.OnClientClick = "window.location.href='" + Util.QuoteJScriptString(str) + "';return;";
                    }
                }
                button.Text = verb.Text;
                control = button;
                goto Label_040C;
            }
            HyperLink link = new HyperLink();
            switch (webPart.HelpMode)
            {
                case WebPartHelpMode.Modal:
                    if (!this.Zone.RenderClientScript)
                    {
                        break;
                    }
                    link.NavigateUrl = "javascript:__wpm.ShowHelp('" + Util.QuoteJScriptString(str) + "', 0)";
                    goto Label_0187;

                case WebPartHelpMode.Modeless:
                    break;

                case WebPartHelpMode.Navigate:
                    link.NavigateUrl = str;
                    goto Label_0187;

                default:
                    goto Label_0187;
            }
            link.NavigateUrl = str;
            link.Target = "_blank";
        Label_0187:
            link.Text = verb.Text;
            if (titleBarVerbButtonType == ButtonType.Image)
            {
                link.ImageUrl = verb.ImageUrl;
            }
            control = link;
        Label_040C:
            control.ApplyStyle(this.Zone.TitleBarVerbStyle);
            control.ToolTip = string.Format(CultureInfo.CurrentCulture, verb.Description, new object[] { webPart.DisplayTitle });
            control.Enabled = verb.Enabled;
            control.Page = this._page;
            control.RenderControl(writer);
        }
 protected virtual void RenderVerb(HtmlTextWriter writer, WebPartVerb verb)
 {
     WebControl control;
     string eventArgument = verb.EventArgument;
     if (this.VerbButtonType == ButtonType.Button)
     {
         ZoneButton button = new ZoneButton(this, eventArgument) {
             Text = verb.Text
         };
         control = button;
     }
     else
     {
         ZoneLinkButton button2 = new ZoneLinkButton(this, eventArgument) {
             Text = verb.Text
         };
         if (this.VerbButtonType == ButtonType.Image)
         {
             button2.ImageUrl = verb.ImageUrl;
         }
         control = button2;
     }
     control.ApplyStyle(base.VerbStyle);
     control.ToolTip = verb.Description;
     control.Enabled = verb.Enabled;
     control.Page = this.Page;
     control.RenderControl(writer);
 }
 protected override void RenderHeader(HtmlTextWriter writer)
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
     writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "2");
     writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
     writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
     TitleStyle headerStyle = base.HeaderStyle;
     if (!headerStyle.IsEmpty)
     {
         Style style2 = new Style();
         if (!headerStyle.ForeColor.IsEmpty)
         {
             style2.ForeColor = headerStyle.ForeColor;
         }
         style2.Font.CopyFrom(headerStyle.Font);
         if (!headerStyle.Font.Size.IsEmpty)
         {
             style2.Font.Size = new FontUnit(new Unit(100.0, UnitType.Percentage));
         }
         if (!style2.IsEmpty)
         {
             style2.AddAttributesToRender(writer, this);
         }
     }
     writer.RenderBeginTag(HtmlTextWriterTag.Table);
     writer.RenderBeginTag(HtmlTextWriterTag.Tr);
     HorizontalAlign horizontalAlign = headerStyle.HorizontalAlign;
     if (horizontalAlign != HorizontalAlign.NotSet)
     {
         TypeConverter converter = TypeDescriptor.GetConverter(typeof(HorizontalAlign));
         writer.AddAttribute(HtmlTextWriterAttribute.Align, converter.ConvertToString(horizontalAlign));
     }
     writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
     writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     writer.Write(this.HeaderText);
     writer.RenderEndTag();
     WebPartVerb headerCloseVerb = this.HeaderCloseVerb;
     if (headerCloseVerb.Visible)
     {
         writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
         writer.RenderBeginTag(HtmlTextWriterTag.Td);
         ZoneLinkButton button = new ZoneLinkButton(this, headerCloseVerb.EventArgument) {
             Text = headerCloseVerb.Text,
             ImageUrl = headerCloseVerb.ImageUrl,
             ToolTip = headerCloseVerb.Description,
             Enabled = headerCloseVerb.Enabled,
             Page = this.Page
         };
         button.ApplyStyle(this.HeaderVerbStyle);
         button.RenderControl(writer);
         writer.RenderEndTag();
     }
     writer.RenderEndTag();
     writer.RenderEndTag();
 }
Esempio n. 15
0
        protected override void RenderHeader(HtmlTextWriter writer)
        {
            // Render title bar
            writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
            writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "2");
            writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
            writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");

            TitleStyle headerStyle = HeaderStyle;

            if (!headerStyle.IsEmpty)
            {
                // Apply font and forecolor from HeaderStyle to inner table
                Style style = new Style();
                if (!headerStyle.ForeColor.IsEmpty)
                {
                    style.ForeColor = headerStyle.ForeColor;
                }
                style.Font.CopyFrom(headerStyle.Font);
                if (!headerStyle.Font.Size.IsEmpty)
                {
                    // If the font size is specified on the HeaderStyle, force the font size to 100%,
                    // so it inherits the font size from its parent in IE compatibility mode. I would
                    // think that "1em" would work here as well, but "1em" doesn't work when you change
                    // the font size in the browser.
                    style.Font.Size = new FontUnit(new Unit(100, UnitType.Percentage));
                }
                if (!style.IsEmpty)
                {
                    style.AddAttributesToRender(writer, this);
                }
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Table);

            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            // Copied from Panel.cs
            //
            HorizontalAlign hAlign = headerStyle.HorizontalAlign;

            if (hAlign != HorizontalAlign.NotSet)
            {
                TypeConverter hac = TypeDescriptor.GetConverter(typeof(HorizontalAlign));
                writer.AddAttribute(HtmlTextWriterAttribute.Align, hac.ConvertToString(hAlign));
            }

            writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            writer.Write(HeaderText);
            writer.RenderEndTag();  // Td

            WebPartVerb headerCloseVerb = HeaderCloseVerb;

            if (headerCloseVerb.Visible)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                ZoneLinkButton closeButton = new ZoneLinkButton(this, headerCloseVerb.EventArgument);
                closeButton.Text     = headerCloseVerb.Text;
                closeButton.ImageUrl = headerCloseVerb.ImageUrl;
                closeButton.ToolTip  = headerCloseVerb.Description;
                closeButton.Enabled  = headerCloseVerb.Enabled;
                closeButton.Page     = Page;
                closeButton.ApplyStyle(HeaderVerbStyle);
                closeButton.RenderControl(writer);
                writer.RenderEndTag();  // Td
            }

            writer.RenderEndTag();  // Tr
            writer.RenderEndTag();  // Table
        }
        private void RenderVerb(HtmlTextWriter writer, WebPart webPart, WebPartVerb verb) {
            WebControl verbControl;
            bool isEnabled = Zone.IsEnabled && verb.Enabled;

            ButtonType verbButtonType = Zone.TitleBarVerbButtonType;

            if (verb == Zone.HelpVerb) {
                // 
                string resolvedHelpUrl = Zone.ResolveClientUrl(webPart.HelpUrl);

                // 
                if (verbButtonType == ButtonType.Button) {
                    ZoneButton button = new ZoneButton(Zone, null);

                    if (isEnabled) {
                        if (Zone.RenderClientScript) {
                            button.OnClientClick = "__wpm.ShowHelp('" +
                                Util.QuoteJScriptString(resolvedHelpUrl) +
                                "', " +
                                ((int)webPart.HelpMode).ToString(CultureInfo.InvariantCulture) +
                                ");return;";
                        }
                        else {
                            if (webPart.HelpMode != WebPartHelpMode.Navigate) {
                                button.OnClientClick = "window.open('" +
                                    Util.QuoteJScriptString(resolvedHelpUrl) +
                                    "', '_blank', 'scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');return;";
                            }
                            else {
                                button.OnClientClick = "window.location.href='" +
                                    Util.QuoteJScriptString(resolvedHelpUrl) +
                                    "';return;";
                            }
                        }
                    }
                    button.Text = verb.Text;
                    verbControl = button;
                }
                else {
                    HyperLink hyperLink = new HyperLink();

                    switch (webPart.HelpMode) {
                        case WebPartHelpMode.Modal:
                            if (!Zone.RenderClientScript) {
                                goto case WebPartHelpMode.Modeless;
                            }
                            hyperLink.NavigateUrl = "javascript:__wpm.ShowHelp('" +
                                Util.QuoteJScriptString(resolvedHelpUrl) +
                                "', 0)";
                            break;
                        case WebPartHelpMode.Modeless:
                            hyperLink.NavigateUrl = resolvedHelpUrl;
                            hyperLink.Target = "_blank";
                            break;
                        case WebPartHelpMode.Navigate:
                            hyperLink.NavigateUrl = resolvedHelpUrl;
                            break;
                    }

                    hyperLink.Text = verb.Text;
                    if (verbButtonType == ButtonType.Image) {
                        hyperLink.ImageUrl = verb.ImageUrl;
                    }
                    verbControl = hyperLink;
                }
            }
            else if (verb == Zone.ExportVerb) {
                string exportUrl = _manager.GetExportUrl(webPart);
                if (verbButtonType == ButtonType.Button) {
                    ZoneButton button = new ZoneButton(Zone, String.Empty);
                    button.Text = verb.Text;

                    if (isEnabled) {
                        if ((webPart.ExportMode == WebPartExportMode.All) &&
                            (_personalizationScope == PersonalizationScope.User)) {
                            if (Zone.RenderClientScript) {
                                button.OnClientClick = "__wpm.ExportWebPart('" +
                                    Util.QuoteJScriptString(exportUrl) +
                                    "', true, false);return false;";
                            }
                            else {
                                button.OnClientClick = "if(__wpmExportWarning.length == 0 || "
                                    + "confirm(__wpmExportWarning)){window.location='" +
                                    Util.QuoteJScriptString(exportUrl) +
                                    "';}return false;";
                            }
                        }
                        else {
                            button.OnClientClick = "window.location='" +
                                Util.QuoteJScriptString(exportUrl) +
                                "';return false;";
                        }
                    }

                    verbControl = button;
                }
                else {
                    // Special case for export which must be a plain HyperLink
                    // (href=javascript:void(0) would ruin any redirecting script)
                    HyperLink link = new HyperLink();
                    link.Text = verb.Text;
                    if (verbButtonType == ButtonType.Image) {
                        link.ImageUrl = verb.ImageUrl;
                    }
                    link.NavigateUrl = exportUrl;
                    if (webPart.ExportMode == WebPartExportMode.All) {
                        // Confirm before exporting
                        if (Zone.RenderClientScript) {
                            link.Attributes.Add("onclick", "return __wpm.ExportWebPart('', true, true)");
                        }
                        else {
                            string onclick = "return (__wpmExportWarning.length == 0 || confirm(__wpmExportWarning))";
                            link.Attributes.Add("onclick", onclick);
                        }
                    }
                    verbControl = link;
                }
            }
            else {
                string eventArgument = verb.GetEventArgument(webPart.ID);
                string clientClickHandler = verb.ClientClickHandler;

                if (verbButtonType == ButtonType.Button) {
                    ZoneButton button = new ZoneButton(Zone, eventArgument);
                    button.Text = verb.Text;
                    if (!String.IsNullOrEmpty(clientClickHandler) && isEnabled) {
                        button.OnClientClick = clientClickHandler;
                    }
                    verbControl = button;
                }
                else {
                    ZoneLinkButton linkButton = new ZoneLinkButton(Zone, eventArgument);
                    linkButton.Text = verb.Text;
                    if (verbButtonType == ButtonType.Image) {
                        linkButton.ImageUrl = verb.ImageUrl;
                    }
                    if (!String.IsNullOrEmpty(clientClickHandler) && isEnabled) {
                        linkButton.OnClientClick = clientClickHandler;
                    }
                    verbControl = linkButton;
                }

                if (_manager != null && isEnabled) {
                    if (verb == Zone.CloseVerb) {
                        // PERF: First check if this WebPart even has provider connection points
                        ProviderConnectionPointCollection connectionPoints = _manager.GetProviderConnectionPoints(webPart);
                        if (connectionPoints != null && connectionPoints.Count > 0 &&
                            Connections.ContainsProvider(webPart)) {
                            string onclick = "if (__wpmCloseProviderWarning.length >= 0 && " +
                                "!confirm(__wpmCloseProviderWarning)) { return false; }";
                            verbControl.Attributes.Add("onclick", onclick);
                        }
                    }
                    else if (verb == Zone.DeleteVerb) {
                        string onclick = "if (__wpmDeleteWarning.length >= 0 && !confirm(__wpmDeleteWarning)) { return false; }";
                        verbControl.Attributes.Add("onclick", onclick);
                    }
                }
            }

            verbControl.ApplyStyle(Zone.TitleBarVerbStyle);
            verbControl.ToolTip = String.Format(CultureInfo.CurrentCulture, verb.Description, webPart.DisplayTitle);
            verbControl.Enabled = verb.Enabled;
            verbControl.Page = _page;
            verbControl.RenderControl(writer);
        }
        private void RenderAddVerbs(HtmlTextWriter writer) {
            WebPart webPartToConnect = WebPartToConnect;

            WebPartCollection webParts = null;
            if (WebPartManager != null) {
                webParts = WebPartManager.WebParts;
            }

            if (webPartToConnect != null || DesignMode) {
                // Are there any compatible consumers?
                bool consumersAvailable = DesignMode;
                if (!consumersAvailable && WebPartManager != null) {
                    ProviderConnectionPointCollection providers =
                        WebPartManager.GetEnabledProviderConnectionPoints(webPartToConnect);
                    foreach (ProviderConnectionPoint provider in providers) {
                        if (GetValidConsumers(webPartToConnect, provider, webParts).Count != 0) {
                            consumersAvailable = true;
                            break;
                        }
                    }
                }
                if (consumersAvailable) {
                    ZoneLinkButton connectConsumerButton = new ZoneLinkButton(this, connectConsumerEventArgument);
                    connectConsumerButton.Text = ConnectToConsumerText;
                    connectConsumerButton.ApplyStyle(VerbStyle);
                    connectConsumerButton.Page = Page;
                    connectConsumerButton.RenderControl(writer);
                    writer.WriteBreak();
                }

                // Are there any compatible providers?
                bool providersAvailable = DesignMode;
                if (!providersAvailable && WebPartManager != null) {
                    ConsumerConnectionPointCollection consumers =
                        WebPartManager.GetEnabledConsumerConnectionPoints(webPartToConnect);
                    foreach (ConsumerConnectionPoint consumer in consumers) {
                        if (GetValidProviders(webPartToConnect, consumer, webParts).Count != 0) {
                            providersAvailable = true;
                            break;
                        }
                    }
                }
                if (providersAvailable) {
                    ZoneLinkButton connectProviderButton = new ZoneLinkButton(this, connectProviderEventArgument);
                    connectProviderButton.Text = ConnectToProviderText;
                    connectProviderButton.ApplyStyle(VerbStyle);
                    connectProviderButton.Page = Page;
                    connectProviderButton.RenderControl(writer);
                    writer.WriteBreak();
                }

                // Add separator if anything was rendered
                if (providersAvailable || consumersAvailable) {
                    writer.RenderBeginTag(HtmlTextWriterTag.Hr);
                    writer.RenderEndTag();
                }
            }
        }
Esempio n. 18
0
        private void RenderVerb(HtmlTextWriter writer, WebPart webPart, WebPartVerb verb)
        {
            WebControl control;
            bool       flag = this.Zone.IsEnabled && verb.Enabled;
            ButtonType titleBarVerbButtonType = this.Zone.TitleBarVerbButtonType;

            if (verb != this.Zone.HelpVerb)
            {
                if (verb == this.Zone.ExportVerb)
                {
                    string exportUrl = this._manager.GetExportUrl(webPart);
                    if (titleBarVerbButtonType == ButtonType.Button)
                    {
                        ZoneButton button2 = new ZoneButton(this.Zone, string.Empty)
                        {
                            Text = verb.Text
                        };
                        if (flag)
                        {
                            if ((webPart.ExportMode == WebPartExportMode.All) && (this._personalizationScope == PersonalizationScope.User))
                            {
                                if (this.Zone.RenderClientScript)
                                {
                                    button2.OnClientClick = "__wpm.ExportWebPart('" + Util.QuoteJScriptString(exportUrl) + "', true, false);return false;";
                                }
                                else
                                {
                                    button2.OnClientClick = "if(__wpmExportWarning.length == 0 || confirm(__wpmExportWarning)){window.location='" + Util.QuoteJScriptString(exportUrl) + "';}return false;";
                                }
                            }
                            else
                            {
                                button2.OnClientClick = "window.location='" + Util.QuoteJScriptString(exportUrl) + "';return false;";
                            }
                        }
                        control = button2;
                    }
                    else
                    {
                        HyperLink link2 = new HyperLink {
                            Text = verb.Text
                        };
                        if (titleBarVerbButtonType == ButtonType.Image)
                        {
                            link2.ImageUrl = verb.ImageUrl;
                        }
                        link2.NavigateUrl = exportUrl;
                        if (webPart.ExportMode == WebPartExportMode.All)
                        {
                            if (this.Zone.RenderClientScript)
                            {
                                link2.Attributes.Add("onclick", "return __wpm.ExportWebPart('', true, true)");
                            }
                            else
                            {
                                string str3 = "return (__wpmExportWarning.length == 0 || confirm(__wpmExportWarning))";
                                link2.Attributes.Add("onclick", str3);
                            }
                        }
                        control = link2;
                    }
                }
                else
                {
                    string eventArgument      = verb.GetEventArgument(webPart.ID);
                    string clientClickHandler = verb.ClientClickHandler;
                    if (titleBarVerbButtonType == ButtonType.Button)
                    {
                        ZoneButton button3 = new ZoneButton(this.Zone, eventArgument)
                        {
                            Text = verb.Text
                        };
                        if (!string.IsNullOrEmpty(clientClickHandler) && flag)
                        {
                            button3.OnClientClick = clientClickHandler;
                        }
                        control = button3;
                    }
                    else
                    {
                        ZoneLinkButton button4 = new ZoneLinkButton(this.Zone, eventArgument)
                        {
                            Text = verb.Text
                        };
                        if (titleBarVerbButtonType == ButtonType.Image)
                        {
                            button4.ImageUrl = verb.ImageUrl;
                        }
                        if (!string.IsNullOrEmpty(clientClickHandler) && flag)
                        {
                            button4.OnClientClick = clientClickHandler;
                        }
                        control = button4;
                    }
                    if ((this._manager != null) && flag)
                    {
                        if (verb == this.Zone.CloseVerb)
                        {
                            ProviderConnectionPointCollection providerConnectionPoints = this._manager.GetProviderConnectionPoints(webPart);
                            if (((providerConnectionPoints != null) && (providerConnectionPoints.Count > 0)) && this.Connections.ContainsProvider(webPart))
                            {
                                string str6 = "if (__wpmCloseProviderWarning.length >= 0 && !confirm(__wpmCloseProviderWarning)) { return false; }";
                                control.Attributes.Add("onclick", str6);
                            }
                        }
                        else if (verb == this.Zone.DeleteVerb)
                        {
                            string str7 = "if (__wpmDeleteWarning.length >= 0 && !confirm(__wpmDeleteWarning)) { return false; }";
                            control.Attributes.Add("onclick", str7);
                        }
                    }
                }
                goto Label_040C;
            }
            string str = this.Zone.ResolveClientUrl(webPart.HelpUrl);

            if (titleBarVerbButtonType == ButtonType.Button)
            {
                ZoneButton button = new ZoneButton(this.Zone, null);
                if (flag)
                {
                    if (this.Zone.RenderClientScript)
                    {
                        button.OnClientClick = "__wpm.ShowHelp('" + Util.QuoteJScriptString(str) + "', " + ((int)webPart.HelpMode).ToString(CultureInfo.InvariantCulture) + ");return;";
                    }
                    else if (webPart.HelpMode != WebPartHelpMode.Navigate)
                    {
                        button.OnClientClick = "window.open('" + Util.QuoteJScriptString(str) + "', '_blank', 'scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');return;";
                    }
                    else
                    {
                        button.OnClientClick = "window.location.href='" + Util.QuoteJScriptString(str) + "';return;";
                    }
                }
                button.Text = verb.Text;
                control     = button;
                goto Label_040C;
            }
            HyperLink link = new HyperLink();

            switch (webPart.HelpMode)
            {
            case WebPartHelpMode.Modal:
                if (!this.Zone.RenderClientScript)
                {
                    break;
                }
                link.NavigateUrl = "javascript:__wpm.ShowHelp('" + Util.QuoteJScriptString(str) + "', 0)";
                goto Label_0187;

            case WebPartHelpMode.Modeless:
                break;

            case WebPartHelpMode.Navigate:
                link.NavigateUrl = str;
                goto Label_0187;

            default:
                goto Label_0187;
            }
            link.NavigateUrl = str;
            link.Target      = "_blank";
Label_0187:
            link.Text = verb.Text;
            if (titleBarVerbButtonType == ButtonType.Image)
            {
                link.ImageUrl = verb.ImageUrl;
            }
            control = link;
Label_040C:
            control.ApplyStyle(this.Zone.TitleBarVerbStyle);
            control.ToolTip = string.Format(CultureInfo.CurrentCulture, verb.Description, new object[] { webPart.DisplayTitle });
            control.Enabled = verb.Enabled;
            control.Page    = this._page;
            control.RenderControl(writer);
        }