AddStyleElement() public method

Adds a element type to be used as style elements (e.g. as in the HTML style element)
public AddStyleElement ( string ns, string localName ) : void
ns string The namespace URI of the element
localName string The local-name of the element
return void
Exemplo n.º 1
0
        public void Init()
        {
            if(!initDone)
            {
                doc = new CssXmlDocument();
                doc.AddStyleElement("http://www.w3.org/2000/svg", "style");
                doc.Load("http://www.sharpvectors.org/tests/css_unittest_01.svg");
                cssStyleSheet = (CssStyleSheet)doc.StyleSheets[0];
                colorRules = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[4]).Style;

                initDone = true;
            }
        }
Exemplo n.º 2
0
        public void Init()
        {
            if (!initDone)
            {
                doc = new CssXmlDocument();
                doc.AddStyleElement("http://www.w3.org/2000/svg", "style");
                doc.Load("http://www.sharpvectors.org/tests/css_unittest_01.svg");
                cssStyleSheet = (CssStyleSheet)doc.StyleSheets[0];
                colorRules    = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[4]).Style;

                initDone = true;
            }
        }
Exemplo n.º 3
0
        public static CssXmlDocument GetXmlDoc(string content, string style)
        {
            CssXmlDocument doc = new CssXmlDocument();
            doc.AddStyleElement("", "style");

            string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<root>";
            xml += "<style type='text/css'>" + style + "</style>";
            xml += content;
            xml += "</root>";

            doc.LoadXml(xml);
            return doc;
        }
Exemplo n.º 4
0
        public static CssXmlDocument GetXmlDoc(string content, string style)
        {
            CssXmlDocument doc = new CssXmlDocument();

            doc.AddStyleElement("", "style");

            string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<root>";

            xml += "<style type='text/css'>" + style + "</style>";
            xml += content;
            xml += "</root>";

            doc.LoadXml(xml);
            return(doc);
        }