Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 /// <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;
     }
 }
Ejemplo n.º 4
0
 public static string Load(string text, System.Drawing.Font font)
 {
     RtfConverter converter = new RtfConverter();
     converter.Font = font;
     return converter.Load(text);
 }
Ejemplo n.º 5
0
 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;
 }