Exemple #1
0
        public void getStrFormatadoTest()
        {
            AtributoCss attCss = new AtributoCss("c100", "backgroundcolor", "blue");

            Assert.AreEqual(".c100{backgroundcolor:blue}", attCss.getStrFormatado());

            attCss = new AtributoCss("c101", "margin", "10px");

            attCss.addValor("11px");
            attCss.addValor("12px");
            attCss.addValor("13px");

            Assert.AreEqual(".c101{margin:10px 11px 12px 13px}", attCss.getStrFormatado());
        }
Exemple #2
0
        private string addCssNovo(string strNome, string strValor)
        {
            if (string.IsNullOrEmpty(strNome))
            {
                return(null);
            }

            if (string.IsNullOrEmpty(strValor))
            {
                return(null);
            }

            AtributoCss atrCss = new AtributoCss((STR_CLASS_NOME_SUFIXO + this.lstAttCss.Count), strNome, strValor);

            this.lstAttCss.Add(atrCss);
            this.stbConteudo.Append(atrCss.getStrFormatado());

            this.arrBteConteudo = null;
            this.dttAlteracao   = DateTime.Now;

            return(atrCss.strClass);
        }