public ProcessBackground ( String background ) : String>.IDictionary |
||
background | String | |
Результат | String>.IDictionary |
/** * @param css the css map to populate * @param key the property * @param value the value */ private void SplitRules(IDictionary <String, String> css, String key, String value) { if (Util.EqualsIgnoreCase(CSS.Property.BORDER, key)) { CssUtils.MapPutAll(css, utils.ParseBorder(value)); } else if (Util.EqualsIgnoreCase(CSS.Property.MARGIN, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "margin-", "")); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_WIDTH, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "border-", "-width")); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_STYLE, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "border-", "-style")); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_COLOR, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "border-", "-color")); } else if (Util.EqualsIgnoreCase(CSS.Property.PADDING, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "padding-", "")); } else if (Util.EqualsIgnoreCase(CSS.Property.FONT, key)) { CssUtils.MapPutAll(css, utils.ProcessFont(value)); } else if (Util.EqualsIgnoreCase(CSS.Property.LIST_STYLE, key)) { CssUtils.MapPutAll(css, utils.ProcessListStyle(value)); } else if (Util.EqualsIgnoreCase(CSS.Property.BACKGROUND, key)) { IDictionary <String, String> backgroundStyles = utils.ProcessBackground(value); foreach (String backgroundKey in backgroundStyles.Keys) { if (!css.ContainsKey(backgroundKey)) { css[backgroundKey] = backgroundStyles[backgroundKey]; } } } else { css[key] = value; } }
virtual public void PopulateOneCss(IDictionary <String, String> aggregatedProps, IDictionary <String, String> cssDeclaration) { IDictionary <String, String> css = new Dictionary <String, String>(); foreach (KeyValuePair <String, String> e in cssDeclaration) { String key = utils.StripDoubleSpacesTrimAndToLowerCase(e.Key); String value = utils.StripDoubleSpacesAndTrim(e.Value); if (Util.EqualsIgnoreCase(CSS.Property.BORDER, key)) { CssUtils.MapPutAll(css, utils.ParseBorder(value)); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_TOP, key)) { CssUtils.MapPutAll(css, utils.ParseBorder(value, CSS.Property.BORDER_TOP)); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_BOTTOM, key)) { CssUtils.MapPutAll(css, utils.ParseBorder(value, CSS.Property.BORDER_BOTTOM)); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_LEFT, key)) { CssUtils.MapPutAll(css, utils.ParseBorder(value, CSS.Property.BORDER_LEFT)); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_RIGHT, key)) { CssUtils.MapPutAll(css, utils.ParseBorder(value, CSS.Property.BORDER_RIGHT)); } else if (Util.EqualsIgnoreCase(CSS.Property.MARGIN, key)) { IDictionary <String, String> margins = utils.ParseBoxValues(value, "margin-", ""); foreach (String marginKey in margins.Keys) { if (!css.ContainsKey(marginKey)) { css.Add(marginKey, margins[marginKey]); } } } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_WIDTH, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "border-", "-width")); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_STYLE, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "border-", "-style")); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_COLOR, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "border-", "-color")); } else if (Util.EqualsIgnoreCase(CSS.Property.PADDING, key)) { IDictionary <String, String> paddings = utils.ParseBoxValues(value, "padding-", ""); foreach (String paddingKey in paddings.Keys) { if (!css.ContainsKey(paddingKey)) { css.Add(paddingKey, paddings[paddingKey]); } } //CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "padding-", "")); } else if (Util.EqualsIgnoreCase(CSS.Property.FONT, key)) { CssUtils.MapPutAll(css, utils.ProcessFont(value)); } else if (Util.EqualsIgnoreCase(CSS.Property.LIST_STYLE, key)) { CssUtils.MapPutAll(css, utils.ProcessListStyle(value)); } else if (key.ToLowerInvariant().Contains(CSS.Property.BACKGROUND)) { IDictionary <String, String> backgroundStyles = utils.ProcessBackground(value); foreach (String backgroundKey in backgroundStyles.Keys) { if (!css.ContainsKey(backgroundKey)) { css.Add(backgroundKey, backgroundStyles[backgroundKey]); } } } else { css[key] = value; } } CssUtils.MapPutAll(aggregatedProps, css); }
public void PopulateOneCss(ICssFile cssFile, IDictionary <String, String> aggregatedProps, String selector) { IDictionary <String, String> t = cssFile.Get(selector); IDictionary <String, String> css = new Dictionary <String, String>(); foreach (KeyValuePair <String, String> e in t) { String key = utils.StripDoubleSpacesTrimAndToLowerCase(e.Key); String value = utils.StripDoubleSpacesAndTrim(e.Value); if (Util.EqualsIgnoreCase(CSS.Property.BORDER, key)) { CssUtils.MapPutAll(css, utils.ParseBorder(value)); } else if (Util.EqualsIgnoreCase(CSS.Property.MARGIN, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "margin-", "")); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_WIDTH, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "border-", "-width")); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_STYLE, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "border-", "-style")); } else if (Util.EqualsIgnoreCase(CSS.Property.BORDER_COLOR, key)) { CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "border-", "-color")); } else if (Util.EqualsIgnoreCase(CSS.Property.PADDING, key)) { IDictionary <String, String> paddings = utils.ParseBoxValues(value, "padding-", ""); foreach (String paddingKey in paddings.Keys) { if (!css.ContainsKey(paddingKey)) { css.Add(paddingKey, paddings[paddingKey]); } } //CssUtils.MapPutAll(css, utils.ParseBoxValues(value, "padding-", "")); } else if (Util.EqualsIgnoreCase(CSS.Property.FONT, key)) { CssUtils.MapPutAll(css, utils.ProcessFont(value)); } else if (Util.EqualsIgnoreCase(CSS.Property.LIST_STYLE, key)) { CssUtils.MapPutAll(css, utils.ProcessListStyle(value)); } else if (Util.EqualsIgnoreCase(CSS.Property.BACKGROUND, key)) { IDictionary <String, String> backgroundStyles = utils.ProcessBackground(value); foreach (String backgroundKey in backgroundStyles.Keys) { if (!css.ContainsKey(backgroundKey)) { css.Add(backgroundKey, backgroundStyles[backgroundKey]); } } } else { css[key] = value; } } CssUtils.MapPutAll(aggregatedProps, css); }