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);
        }
Beispiel #2
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);
        }
        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);
        }
Beispiel #4
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);
        }
        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);
        }
        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);
 }
Beispiel #8
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);
        }