示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AppSettings.IsDemo && (UseTitanDemoHelper.IsProductsSet() || UseTitanDemoHelper.IsThemeSet()))
        {
            GlobalPlaceHolder.Visible = true;
            StringBuilder builder = new StringBuilder();

            if (UseTitanDemoHelper.IsProductsSet())
            {
                //We have product(s)
                var products = UseTitanDemoHelper.GetProducts().Split(',').ToList();
                products.Remove("1"); //We remove Titan Core

                if (products.Count() == 1)
                {
                    builder.Append(UseTitanProducts.GetHTML((TitanProduct)Convert.ToInt32(products[0])));
                }
                else
                {
                    for (int i = 0; i < products.Count(); i++)
                    {
                        builder.Append(UseTitanProducts.GetHTML((TitanProduct)Convert.ToInt32(products[i])));
                        if (i < products.Count() - 1)
                        {
                            builder.Append(" <br> ");
                        }
                    }
                }
            }

            if (UseTitanDemoHelper.IsThemeSet())
            {
                //We have theme preset

                if (UseTitanDemoHelper.IsProductsSet())
                {
                    builder.Append(" <br>with the theme ");
                }
                else
                {
                    builder.Append(" the theme ");
                }

                builder.AppendFormat("<b class='theme-name'>{0}</b>", UseTitanDemoHelper.GetTheme());
            }

            MainTextLiteral.Text = builder.ToString();
        }
    }
示例#2
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (AppSettings.IsDemo)
        {
            if (Request.QueryString["products"] != null)
            {
                UseTitanDemoHelper.SetProducts(Request.QueryString["products"]);
            }

            if (Request.QueryString["theme"] != null)
            {
                UseTitanDemoHelper.SetTheme(Request.QueryString["theme"]);
            }

            if (Page.MasterPageFile == "/Sites.master" && AppSettings.Site.Theme != "titan")
            {
                Page.MasterPageFile = String.Format("/Themes/{0}/Sites.master", AppSettings.Site.Theme);
            }
        }
    }