Esempio n. 1
0
 public static async Task Write(string filePath, string content, bool overwrite = IOHelper.DefaultOverwriteValue)
 {
     using (var writer = StreamWriterHelper.NewWrite(filePath, overwrite))
     {
         await writer.WriteAsync(content);
     }
 }
 public static async Task WriteAllLines(string filePath, IEnumerable <string> lines, string lineSeparator, bool overwrite = IOHelper.DefaultOverwriteValue)
 {
     using (var writer = StreamWriterHelper.NewWrite(filePath, overwrite))
     {
         await StreamWriterHelper.WriteAllLines(writer, lines, lineSeparator);
     }
 }
        public static StreamWriter NewWrite(string filePath, bool overwrite = IOHelper.DefaultOverwriteValue)
        {
            var stream = FileStreamHelper.NewWrite(filePath, overwrite);

            var output = StreamWriterHelper.NewCloseAfter(stream);

            return(output);
        }
Esempio n. 4
0
 public static Task WriteAllLines(string filePath, IEnumerable <string> lines, bool overwrite = IOHelper.DefaultOverwriteValue)
 {
     return(StreamWriterHelper.WriteAllLines(filePath, lines, overwrite));
 }
 public static Task WriteAllLines(StreamWriter writer, IEnumerable <string> lines)
 {
     return(StreamWriterHelper.WriteAllLines(writer, lines, Strings.NewLineForEnvironment));
 }