示例#1
0
 public string GetPropValue(string PropName)
 {
     FieldInfo[] CSSProps = this.GetType().GetFields();
     foreach (FieldInfo CSSProp in CSSProps)
     {
         if (CSSProp.Name == PropName)
         {
             return(CSSProp.GetValue(this).ToString());
         }
     }
     return("error");
 }
示例#2
0
        public string GetCompiledCode(string ClassName, string Extention)
        {
            string CompiledCSS = "." + ClassName + Extention + "{\n";

            FieldInfo[] CSSProps = this.GetType().GetFields();
            foreach (FieldInfo CSSProp in CSSProps)
            {
                if (CSSProp.GetValue(this).ToString() != "")
                {
                    CompiledCSS += CSSProp.Name.Replace('_', '-') + ':' + CSSProp.GetValue(this) + ";\n";
                }
            }
            CompiledCSS += "}\n";
            return(CompiledCSS);
        }
示例#3
0
        public string GetEmbemdedCSS(WebObject.Base ClassObject)
        {
            string CompiledCSS = "";

            FieldInfo[] CSSProps = this.GetType().GetFields();
            foreach (FieldInfo CSSProp in CSSProps)
            {
                if (CSSProp.GetValue(this).ToString() != "")
                {
                    if (ClassObject.CSS.GetPropValue(CSSProp.Name) != CSSProp.GetValue(this).ToString())
                    {
                        CompiledCSS += CSSProp.Name.Replace('_', '-') + ':' + CSSProp.GetValue(this) + ";";
                    }
                }
            }
            return(CompiledCSS);
        }