// Loads up the given css into the document public void loadCss(string css) { // Variables int index= 0; CssSelector selector; CssCode block; css= destroyComments(css); //Console.WriteLine("Loading Css..."); for(int i= 0; i< css.Length; i++) { try{ index= css.IndexOf("{", i); if(index== -1) break; selector= new CssSelector(css.Substring(i, index-i)); i= index; index= css.IndexOf("}", i); if(index== -1) break; block= new CssCode(css.Substring(i+1, index-i-1)); code.add(new CssStatement(selector, block)); i= index; }catch(Exception e) { Console.WriteLine(e); } } //Console.WriteLine("Css Loaded!"); }
public CssStatement(CssSelector sel, CssCode pmCode) { selections= sel; code= pmCode; }