本文整理汇总了C#中System.IO.StringWriter.WriteLineAsync方法的典型用法代码示例。如果您正苦于以下问题:C# System.IO.StringWriter.WriteLineAsync方法的具体用法?C# System.IO.StringWriter.WriteLineAsync怎么用?C# System.IO.StringWriter.WriteLineAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.StringWriter
的用法示例。
在下文中一共展示了System.IO.StringWriter.WriteLineAsync方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransformAsync
public async Task<IEnumerable<Tuple<string, string>>> TransformAsync(string file, string content) {
var baseFile = file.Substring(0, file.Length - ".js.bundle".Length);
var outputFile = baseFile + ".js";
using (var writer = new System.IO.StringWriter()) {
foreach (var dep in FindDepenencies(content)) {
var inputFile = dep.ToUri(Helper.BaseUri).LocalPath;
var inputContent = await Utilities.ReadAllTextAsync(inputFile);
await writer.WriteLineAsync("///#source 1 1 " + dep + Environment.NewLine + inputContent);
}
var result = writer.ToString();
await Utilities.WriteAllTextAsync(outputFile, result);
JsHelper.MinifyJsWithSourceMap(outputFile, result);
return new Tuple<string, string>[0];
}
}
示例2: TransformAsync
public async Task<IEnumerable<Tuple<string, string>>> TransformAsync(string file, string content) {
string css;
using (var writer = new System.IO.StringWriter()) {
foreach (var dep in FindDepenencies(content)) {
var inputFile = dep.ToUri(Helper.BaseUri).LocalPath;
var inputContent = await Utilities.ReadAllTextAsync(inputFile);
await writer.WriteLineAsync(inputContent);
}
css = writer.ToString();
}
var baseFile = file.Substring(0, file.Length - ".css.bundle".Length);
return new[]{
Tuple.Create(baseFile + ".css", css),
Tuple.Create(baseFile + ".min.css", MinifyCss(file, css)),
};
}