Exemple #1
0
 public static string GetString(this ITextWritable @this)
 {
     using (var writer = new StringWriter())
     {
         @this.Write(writer);
         return(writer.ToString());
     }
 }
Exemple #2
0
 public static void WriteToFile(this ITextWritable @this, FileInfo file)
 {
     using (var stream = file.OpenWrite())
         using (var writer = new StreamWriter(stream))
         {
             stream.SetLength(0);
             @this.Write(writer);
         }
 }