示例#1
0
        public static String MergeStyle(String oStyle, String newStyle)
        {
            Dictionary <String, Dictionary <String, String> > oDic = Css.From(oStyle);
            Dictionary <String, Dictionary <String, String> > nDic = Css.From(newStyle);

            foreach (KeyValuePair <String, Dictionary <String, String> > kv in nDic)
            {
                if (oDic.ContainsKey(kv.Key))
                {
                    Dictionary <String, String> oCssValues = oDic[kv.Key];
                    Dictionary <String, String> nCssValues = kv.Value;

                    Dictionary <String, String> cssValues = mergetCssValues(oCssValues, nCssValues);

                    oDic[kv.Key] = resetOrder(cssValues);
                }
                else
                {
                    oDic[kv.Key] = resetOrder(kv.Value);
                }
            }

            return(Css.To(oDic));
        }
示例#2
0
        //-----------------------------------------------------------------------------------------------------------------------

        public static String mergeStyle(String strStyle, String name, Dictionary <String, String> result)
        {
            Dictionary <String, Dictionary <String, String> > dic = mergeDic(strStyle, name, result);

            return(Css.To(dic));
        }