Example #1
0
        protected override void OnInit(EventArgs e)
        {
            Response.Expires = -1;
            Response.AddHeader("Cache-Control", "no-cache");
            Response.AddHeader("Pragma", "no-cache");

            root  = HyperLinkManager.GetHyperLink("");
            roots = HyperLinkManager.GetSecureHyperLink("");

            if (null != beta && 1 == Config.GetInt("Web.BetaSite", 0))
            {
                beta.Visible = true;
            }

            if (null != test && 1 == Config.GetInt("Web.TestSite", 0))
            {
                test.Visible = true;
            }
        }
Example #2
0
        protected override void CreateChildControls()
        {
            CultureInfo culture = UDDI.Localization.GetCulture();

            string isoLangCode = culture.LCID.ToString();

            string file = "/help/" + isoLangCode + "/" + HelpFile + ".aspx";

            string defaultlang = Config.GetString("Setup.WebServer.ProductLanguage", "en");
            int    lcid        = 1033;

            //
            // 'cultureIDValue is expected to contain a neutral culture.  ie,
            // 'en', or 'ko', or 'de'.  All but a few neutral cultures have
            // a default specific culture.  For example, the default specific
            // culture of 'en' is 'en-US'.
            //
            // Traditional & simplified Chinese (zh-CHT and zh-CHS respectively)
            // are examples of neutral cultures which have no default specific
            // culture!
            //
            // So what happens below is this:  First we try to lookup the default
            // specific culture for the neutral culture that we were given.  If that
            // fails (ie, if CreateSpecificCulture throws), we just get the lcid
            // of the neutral culture.
            //
            try
            {
                lcid = CultureInfo.CreateSpecificCulture(defaultlang).LCID;
            }
            catch
            {
                CultureInfo ci = new CultureInfo(defaultlang);
                lcid = ci.LCID;
            }

            if (!File.Exists(Server.MapPath(root + file)))
            {
                file = "/help/" + lcid.ToString() + "/" + HelpFile + ".aspx";
            }


            file = HyperLinkManager.GetNonSecureHyperLink(file);

            HtmlAnchor anchor = new HtmlAnchor();

            if (((UddiPage)Page).IsIE4 || ((UddiPage)Page).IsIE5 || ((UddiPage)Page).IsNetscape6)
            {
                //
                // Standards recommend pointer, but IE4 used hand.
                //
                if (((UddiPage)Page).IsIE4)
                {
                    anchor.Style.Add("cursor", "hand");
                }
                else
                {
                    anchor.Style.Add("cursor", "pointer");
                }

                anchor.Attributes.Add("onclick", "ShowHelp( '" + file + "' )");
                anchor.HRef = "";
            }
            else
            {
                anchor.HRef = file;
            }

            anchor.Target    = "help";
            anchor.InnerHtml = "<img src='" + root + "/images/help.gif' border='0'>";

            Controls.Add(anchor);
        }
Example #3
0
        protected void RenderText(HtmlTextWriter output)
        {
            switch (this.Type)
            {
            case MenuItemType.Item:
                HyperLink l = new HyperLink();
                l.Text = this.Text;
                if (null != this.NavigateTarget && "" != this.NavigateTarget.Trim())
                {
                    l.Target = this.NavigateTarget;
                }

                string classname = this.Name + "_Text";

                if (this.Selected)
                {
                    classname += "Selected";
                }
                else
                {
                    if (null != this.NavigatePage)
                    {
                        if (RequireHttps)
                        {
                            l.NavigateUrl = HyperLinkManager.GetSecureHyperLink(NavigatePage);
                        }
                        else if (RequireHttp)
                        {
                            l.NavigateUrl = HyperLinkManager.GetNonSecureHyperLink(NavigatePage);
                        }
                        else
                        {
                            l.NavigateUrl = HyperLinkManager.GetHyperLink(NavigatePage);
                        }
                    }
                    else if (null != this.NavigateUrl)
                    {
                        l.NavigateUrl = this.NavigateUrl;
                    }
                }


                l.CssClass = classname;
                l.Target   = this.NavigateTarget;

                output.Write("<nobr>");
                l.RenderControl(output);
                output.Write("</nobr>");
                break;

            case MenuItemType.Separator:
                Image i = new Image();
                i.ImageUrl    = Root + "/images/pixel.gif";
                i.Height      = new Unit(1);
                i.Width       = new Unit(1);
                i.BorderWidth = new Unit(0);
                i.RenderControl(output);
                break;

            case MenuItemType.Title:
                Label label = new Label();
                label.Text = this.Text;
                output.Write("<nobr>");
                label.RenderControl(output);
                output.Write("</nobr>");
                break;
            }
        }