/// <summary> Add information about an extension CSS file </summary>
        /// <param name="URL"> URL for this CSS </param>
        /// <param name="Condition"> Condition upon which this CSS file should be added </param>
        public void Add_CssFile(string URL, ExtensionCssInfoConditionEnum Condition)
        {
            if (CssFiles == null)
            {
                CssFiles = new List <ExtensionCssInfo>();
            }

            CssFiles.Add(new ExtensionCssInfo(URL, Condition));
        }
Example #2
0
        protected void magix_viewport_include_client_file(object sender, ActiveEventArgs e)
        {
            Node ip = Ip(e.Params);

            if (ShouldInspect(ip))
            {
                AppendInspectFromResource(
                    ip["inspect"],
                    "Magix.Core",
                    "Magix.Core.hyperlisp.inspect.hl",
                    "[magix.viewport.include-client-file-dox].value");
                AppendCodeFromResource(
                    ip,
                    "Magix.Core",
                    "Magix.Core.hyperlisp.inspect.hl",
                    "[magix.viewport.include-client-file-sample]");
                return;
            }

            Node dp = Dp(e.Params);

            if (!ip.ContainsValue("type"))
            {
                throw new ArgumentException("no [type] given to [magix.viewport.include-client-file]");
            }
            string type = Expressions.GetExpressionValue <string>(ip["type"].Get <string>(), dp, ip, false);

            if (!ip.ContainsValue("file"))
            {
                throw new ArgumentException("no [file] given to [magix.viewport.include-client-file]");
            }
            string file = Expressions.GetExpressionValue <string>(ip["file"].Get <string>(), dp, ip, false);

            if (type == "css")
            {
                if (!CssFiles.Contains(file))
                {
                    CssFiles.Add(file);
                    IncludeCssFile(file);
                }
            }
            else if (type == "javascript")
            {
                if (!JavaScriptFiles.Contains(file))
                {
                    JavaScriptFiles.Add(file);
                    IncludeJavaScriptFile(file);
                }
            }
            else
            {
                throw new ArgumentException("only 'css' and 'javascript' are legal types in [magix.viewport.include-client-file]");
            }
        }
Example #3
0
        public ABBPage AddCssFiles(params string[] fileNames)
        {
            if (fileNames == null)
            {
                return(this);
            }

            if (CssFiles == null)
            {
                CssFiles = new List <string>();
            }

            foreach (var fileName in fileNames)
            {
                CssFiles.Add(fileName);
            }

            return(this);
        }