Exemple #1
0
        private string GetBackgroundDetail(string cssSrcName, string value)
        {
            ///分析name字段
            string type = cssSrcName.Substring(cssSrcName.LastIndexOf('-') + 1);   //(background-color)中的color

            switch (type)
            {
            case "color":
                return(_regexBorderColor.Match(value).Value);

            case "image":
                return(_regexListImage.Match(value).Value);

            case "repeat":
                return(_regexBackgroundRepeat.Match(value).Value);

            case "attachment":
                return(_regexBackgroundAttachment.Match(value).Value);

            case "position":
                KeyValuePair <string, string> hv = CssUtility.ParseBackgroundPosition(value);
                return(hv.Key + " " + hv.Value);

            default:
                Debug.Fail("未知的type:" + type);
                break;
            }
            return(null);
        }