Пример #1
0
        public void SetUp() {
            LoggerFactory.GetInstance().SetLogger(new SysoLogger(3));
            css = new CssSelector();
            root = new Tag("root");
            rChild = new Tag("rChild");
            rChild.Parent = root;
            root.Children.Add(rChild);

            Dictionary<String, String> rootAttr = new Dictionary<String, String>();
            rootAttr["class"] = "rootClass";
            rootAttr["id"] = "rootId";
            idroot = new Tag("root", rootAttr);
            Dictionary<String, String> classAttr = new Dictionary<String, String>();
            classAttr["class"] = "childClass";
            classAttr["id"] = "childId";
        }
Пример #2
0
        public CssRule(IList <ICssSelectorItem> selector, IDictionary <String, String> declarations)
        {
            this.selector              = new CssSelector(selector);
            this.normalDeclarations    = declarations;
            this.importantDeclarations = new Dictionary <string, string>();

            foreach (KeyValuePair <String, String> declaration in normalDeclarations)
            {
                int exclIndex = declaration.Value.IndexOf('!');
                if (exclIndex > 0 && importantMatcher.IsMatch(declaration.Value))
                {
                    importantDeclarations[declaration.Key] = declaration.Value.Substring(0, exclIndex).Trim();
                }
            }
            //remove important declarations from normal declarations
            foreach (String key in importantDeclarations.Keys)
            {
                normalDeclarations.Remove(key);
            }
        }
Пример #3
0
 /**
  * Constructs a new CssFilesImpl.
  */
 public CssFilesImpl()
 {
     this.files = new List<ICssFile>();
     this.utils = CssUtils.GetInstance();
     this.select = new CssSelector();
 }
Пример #4
0
        /**
         * Constructs a new CssFilesImpl.
         */

        public CssFilesImpl()
        {
            this.files  = new List <ICssFile>();
            this.utils  = CssUtils.GetInstance();
            this.select = new CssSelector();
        }