示例#1
0
        public static StyleSheet Load(StyleSheetReader reader)
        {
            StyleSheet result = new StyleSheet();

            while (!reader.EndOfStream)
            {
                switch (reader.Status)
                {
                case StyleSheetReader.ReadStatus.AtRule:
                    result.Nodes.Add(AtRule.Parse(reader.ReadAtRule()));
                    break;

                case StyleSheetReader.ReadStatus.RuleSet:
                    result.Nodes.Add(RuleSet.Parse(reader.ReadRuleSet()));
                    break;

                case StyleSheetReader.ReadStatus.Comment:
                    result.Nodes.Add(Comment.Parse(reader.ReadComment()));
                    break;

                default:
                    break;
                }
            }

            return(result);
        }
示例#2
0
文件: StyleSheet.cs 项目: Epitomy/CMS
        public static StyleSheet Load(StyleSheetReader reader)
        {
            StyleSheet result = new StyleSheet();

            while (!reader.EndOfStream)
            {
                switch (reader.Status)
                {
                    case StyleSheetReader.ReadStatus.AtRule:
                        result.Nodes.Add(AtRule.Parse(reader.ReadAtRule()));
                        break;
                    case StyleSheetReader.ReadStatus.RuleSet:
                        result.Nodes.Add(RuleSet.Parse(reader.ReadRuleSet()));
                        break;
                    case StyleSheetReader.ReadStatus.Comment:
                        result.Nodes.Add(Comment.Parse(reader.ReadComment()));
                        break;
                    default:
                        break;
                }
            }

            return result;
        }