示例#1
0
        private bool build(Element element)
        {
            String text = textEditor.Text;

            element.InnerRml = TextElementStrategy.EncodeToHtml(text);

            StringBuilder style = new StringBuilder();

            elementStyle.buildStyleAttribute(style);
            if (style.Length > 0)
            {
                element.SetAttribute("style", style.ToString());
            }
            else
            {
                element.RemoveAttribute("style");
            }

            StringBuilder classes = new StringBuilder();

            classes.AppendFormat("{0} ", primaryClassName);
            elementStyle.buildClassList(classes);
            if (classes.Length > 0)
            {
                element.SetAttribute("class", classes.ToString());
            }
            else
            {
                element.RemoveAttribute("class");
            }

            if (currentAction != null)
            {
                element.SetAttribute("onclick", currentAction.Name);
            }
            return(true);
        }
        private void build(Element element)
        {
            element.ClearLocalStyles();
            String text = textEditor.Text;

            element.InnerRml = EncodeToHtml(text);

            StringBuilder style = new StringBuilder();

            elementStyle.buildStyleAttribute(style);
            if (style.Length > 0)
            {
                element.SetAttribute("style", style.ToString());
            }
            else
            {
                element.RemoveAttribute("style");
            }

            StringBuilder classes = new StringBuilder();

            elementStyle.buildClassList(classes);
            element.ClassNames = classes.ToString();
        }