public static string Serialize(string rtf, int start, int length) { try { Cursor.Current = Cursors.WaitCursor; RtfConverter converter = new RtfConverter(); converter.Rtf = rtf; return converter.Serialize(start, length); } finally { Cursor.Current = Cursors.Default; } }
public static string LoadAndCopyToClipboard(string text, System.Drawing.Font font) { RtfConverter converter = new RtfConverter(); converter.Font = font; converter.Load(text); Clipboard.SetDataObject(new DataObject(DataFormats.Rtf, converter.Rtf)); return converter.Rtf; }
/// <summary> /// NOTE: /// this assumes that "this" is a new one and doesn't conflict with /// other rtfConverters (always create a new). /// </summary> /// <param name="snippet"></param> /// <param name="rtf"></param> public static string GetTextFromRtf(string rtf) { try { string retVal; Cursor.Current = Cursors.WaitCursor; RtfConverter converter = new RtfConverter(); converter.Rtf = rtf; retVal = converter.Serialize(0,converter.Text.Length); return retVal; } finally { Cursor.Current = Cursors.Default; } }
public static string Load(string text, System.Drawing.Font font) { RtfConverter converter = new RtfConverter(); converter.Font = font; return converter.Load(text); }
public static string FormatClipboard(System.Drawing.Font font) { RtfConverter converter = new RtfConverter(); converter.Font = font; converter.PasteAndFormat(); Clipboard.SetDataObject(new DataObject(DataFormats.Rtf, converter.Rtf)); return converter.Rtf; }