public void Visit(HtmlItalic h) { if (h.Container is HtmlDiv) { sb.Append(Tabs(h.Depth)); } sb.Append(string.Format("<{0}", h.Tag)); foreach (var a in h.Attributes.Where(a => a.IsSet)) { sb.Append(a); } sb.Append(">"); foreach (var c in h.Contents) { Visit(c); } sb.Append(string.Format("</{0}>", h.Tag)); if (h.Container is HtmlDiv) { sb.AppendLine(); } }
private void btnItalic_Click(object sender, EventArgs e) { HtmlItalic italic = new HtmlItalic(); italic.Value = "Hasan Kahraman"; txtHtmlKod.AppendText(italic.GetHtmlString()); txtHtmlKod.AppendText(Environment.NewLine); }
public virtual void Visit(FormHeader formHeader, HtmlContainer htmlContainer) { if (formHeader.Icon == FormIcon.NotSet) { return; } HtmlItalic htmlItalic = new HtmlItalic(); htmlItalic.Class.AddRange(IconClass(formHeader.Icon)); htmlContainer.Insert(0, htmlItalic); }
public virtual void Visit(FormDatePicker formDatePicker, HtmlContainer htmlContainer) { if (formDatePicker.Icon == FormIcon.NotSet) { return; } HtmlTextBox htmlTextBox = null; int i; for (i = 0; i < htmlContainer.Contents.Count; i++) { if (htmlContainer.Contents[i] is HtmlTextBox) { htmlTextBox = (HtmlTextBox)htmlContainer.Contents[i]; break; } } if (htmlTextBox == null) { return; } htmlContainer.Remove(htmlTextBox); HtmlItalic htmlItalic = new HtmlItalic(); htmlItalic.Class.AddRange(IconClass(formDatePicker.Icon)); HtmlDiv htmlDiv = new HtmlDiv(); htmlDiv.Add(htmlTextBox); htmlDiv.Insert(prepend ? 0 : 1, htmlItalic); htmlContainer.Insert(i, htmlDiv); }