//----------------------------------------------------------------------------------------------------------------------- public static String mergeStyle(String oStyle, String newStyle) { Dictionary <String, Dictionary <String, String> > oDic = Css.FromAndFill(oStyle); Dictionary <String, Dictionary <String, String> > nDic = Css.FromAndFill(newStyle); foreach (KeyValuePair <String, Dictionary <String, String> > kv in nDic) { oDic[kv.Key] = kv.Value; } return(Css.To(oDic)); }
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)); }
//----------------------------------------------------------------------------------------------------------------------- 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)); }