public void UpdateRecord(BaseRecord sc) { if (sc == null) { UpdateText(""); return; } FontLangInfo defLang; if (!Encoding.TryGetFontInfo(Properties.Settings.Default.LocalizationName, out defLang)) defLang = new FontLangInfo(1252, 1033, 0); var rb = new RTFBuilder(RTFFont.Arial, 16, defLang.lcid, defLang.charset); sc.GetFormattedHeader(rb); sc.GetFormattedData(rb); this.rtfInfo.Rtf = rb.ToString(); }
public static string MergeRTFFiles(IEnumerable<Chapter> chapters) { var rtfBuilder = new RTFBuilder(); foreach (var chapter in chapters) { rtfBuilder.BackColor(KnownColor.White); rtfBuilder.Font(RTFFont.CenturyGothic); rtfBuilder.FontSize(14); rtfBuilder.Alignment(StringAlignment.Center); rtfBuilder.AppendLine("\"" + chapter.ChapterName + "\""); rtfBuilder.AppendRTF(chapter.RTF); } return rtfBuilder.ToString(); }
/// <summary> /// Merges the contents of 2 RichTextBoxes /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void button4_Click(object sender, EventArgs e) { RTFBuilderbase sb = new RTFBuilder(); BuilderCode(sb); this.richTextBox3.Rtf = sb.ToString(); this.richTextBox4.Rtf = sb.ToString(); sb.Clear(); sb.AppendRTFDocument(this.richTextBox3.Rtf); sb.AppendRTFDocument(this.richTextBox4.Rtf); this.richTextBox2.Rtf = sb.ToString(); }
/// <summary> /// Merges the output of one RtfBuilder into another /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void button3_Click(object sender, EventArgs e) { RTFBuilderbase sb = new RTFBuilder(); BuilderCode(sb); RTFBuilderbase sb2 = new RTFBuilder(); BuilderCode(sb2); sb.AppendRTFDocument(sb2.ToString()); this.richTextBox2.Rtf = sb.ToString(); }
private void button1_Click(object sender, EventArgs e) { RTFBuilderbase sb = new RTFBuilder(); BuilderCode(sb); this.richTextBox1.Rtf = sb.ToString(); }