Inheritance: BaseWebControl
        public static void InsertjQueryMain(Page thePage)
        {
            jquery jq = FindjQueryMain(thePage);

            if (jq == null)
            {
                jq = new jquery();
                jq.UseJqueryMigrate = true;

                thePage.Header.Controls.AddAt(0, jq);
            }
        }
        public static jquery FindjQueryMain(Control control)
        {
            jquery jquery1 = null;

            if (control is Page)
            {
                Page thePage = (Page)control;
                foreach (Control c in thePage.Header.Controls)
                {
                    if (c is jquery)
                    {
                        jquery1 = (jquery)c;
                        break;
                    }
                    else
                    {
                        jquery1 = FindjQueryMain(c);
                        if (jquery1 != null)
                        {
                            break;
                        }
                    }
                }
            }
            else
            {
                foreach (Control c in control.Controls)
                {
                    if (c is jquery)
                    {
                        jquery1 = (jquery)c;
                        break;
                    }
                    else
                    {
                        jquery1 = FindjQueryMain(c);
                        if (jquery1 != null)
                        {
                            break;
                        }
                    }
                }
            }

            return(jquery1);
        }
        public static void InsertjQueryMain(Page thePage)
        {
            jquery jq = FindjQueryMain(thePage);

            if (jq == null) {
                jq = new jquery();
                jq.UseJqueryMigrate = true;

                thePage.Header.Controls.AddAt(0, jq);
            }
        }
示例#4
0
        protected override void RenderContents(HtmlTextWriter output)
        {
            string sJQFile = "";

            output.WriteLine();

            if (!this.StylesheetOnly) {
                jquery j1 = new jquery();
                j1.JQVersion = this.JQVersion;
                j1.UseJqueryMigrate = this.UseJqueryMigrate;
                this.Controls.Add(j1);

                jqueryui j2 = new jqueryui();
                //j2.JQUIVersion = this.JQUIVersion;
                this.Controls.Add(j2);

                j1.RenderControl(output);
                j2.RenderControl(output);
            }

            sJQFile = "";

            switch (this.SelectedSkin) {
                case jQueryTheme.GlossyBlack:
                    sJQFile = GetWebResourceUrl("Carrotware.Web.UI.Controls.jquerybasic.jquery-ui-black.css");
                    break;
                case jQueryTheme.Purple:
                    sJQFile = GetWebResourceUrl("Carrotware.Web.UI.Controls.jquerybasic.jquery-ui-purple.css");
                    break;
                case jQueryTheme.Green:
                    sJQFile = GetWebResourceUrl("Carrotware.Web.UI.Controls.jquerybasic.jquery-ui-green.css");
                    break;
                case jQueryTheme.Blue:
                    sJQFile = GetWebResourceUrl("Carrotware.Web.UI.Controls.jquerybasic.jquery-ui-blue.css");
                    break;
                case jQueryTheme.LightGreen:
                    sJQFile = GetWebResourceUrl("Carrotware.Web.UI.Controls.jquerybasic.jquery-ui-lightgreen.css");
                    break;
                case jQueryTheme.Silver:
                default:
                    sJQFile = GetWebResourceUrl("Carrotware.Web.UI.Controls.jquerybasic.jquery-ui-silver.css");
                    break;
            }

            if (this.SelectedSkin != jQueryTheme.NotUsed) {
                output.Write("<!-- JQuery UI CSS " + SelectedSkin.ToString() + " --> <link href=\"" + sJQFile + "\" type=\"text/css\" rel=\"stylesheet\" /> \r\n");
            }
        }