本文整理汇总了C#中TextWriter.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# TextWriter.WriteLine方法的具体用法?C# TextWriter.WriteLine怎么用?C# TextWriter.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextWriter
的用法示例。
在下文中一共展示了TextWriter.WriteLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Print
public void Print(TextWriter tw, string indent = "")
{
tw.WriteLine(indent + this.Name + "\\" + " " + this.GetSize() + " B");
foreach (var file in this.Files)
tw.WriteLine(indent + " " + file.Name + " " + file.Size + " B");
foreach (var folder in this.Folders)
folder.Print(tw, indent + " ");
}
示例2: Log
public static void Log(string logMessage, TextWriter w)
{
w.Write("\r\nLog Entry : ");
w.WriteLine("{0} {1}", DateTime.Now.ToLongTimeString(),
DateTime.Now.ToLongDateString());
w.WriteLine(" :");
w.WriteLine(" :{0}", logMessage);
w.WriteLine("-------------------------------");
}
示例3: Render
public void Render(ViewContext viewContext, TextWriter writer)
{
foreach (PartialView part in _parts)
{
viewContext.ViewData = part.Data;
writer.WriteLine(string.Format("<div id=\"update-{0}\">", part.ForId));
part.View.Render(viewContext, writer);
writer.WriteLine(string.Format("</div>"));
}
}
示例4: LogCall
private void LogCall(TextWriter logger, IDictionary<string, object> env)
{
var req = new Request(env);
logger.WriteLine("{0} - Request: Environment#{1}", DateTime.Now, env.Count);
logger.WriteLine("Environment: ");
LogDictionary(logger, env);
logger.WriteLine("Headers: ");
LogHeaders(logger, req.Headers);
}
示例5: Write
public static void Write(object element, int depth, TextWriter log)
{
ObjectDumper dumper = new ObjectDumper(depth);
dumper.writer = log;
dumper.WriteObject(null, element);
log.WriteLine(new string('-', 20));
}
示例6: Footer
static void Footer (TextWriter tw)
{
tw.WriteLine (@"## Feedback
Please report any documentation errors, typos or suggestions to the
[[Gendarme Google Group|http://groups.google.com/group/gendarme]]. Thanks!");
}
示例7: Footer
static void Footer (TextWriter tw)
{
tw.WriteLine (@"= Feedback =
Please report any documentation errors, typos or suggestions to the
[http://groups.google.com/group/gendarme Gendarme Google Group]. Thanks!
[[Category:Gendarme]]");
}
示例8: LogDictionary
private void LogDictionary(TextWriter logger, IDictionary<string, object> dictionary)
{
foreach (KeyValuePair<string, object> pair in dictionary)
{
logger.WriteLine("{0} - T:{1}, V:{2}", pair.Key,
(pair.Value == null ? "(null)" : pair.Value.GetType().FullName),
(pair.Value == null ? "(null)" : pair.Value.ToString()));
}
}
示例9: Usage
public static void Usage(TextWriter w)
{
w.WriteLine("Usage: WiFile.exe package.msi /l [filename,filename2,...]");
w.WriteLine("Usage: WiFile.exe package.msi /x [filename,filename2,...]");
w.WriteLine("Usage: WiFile.exe package.msi /u [filename,filename2,...]");
w.WriteLine();
w.WriteLine("Lists (/l), extracts (/x) or updates (/u) files in an MSI or MSM.");
w.WriteLine("Files are extracted using their source path relative to the package.");
w.WriteLine("Specified filenames do not include paths.");
w.WriteLine("Filenames may be a pattern such as *.exe or file?.dll");
}
示例10: WriteInfo
public void WriteInfo(TextWriter tw)
{
tw.WriteLine("data size = 0x{0:X}", dataSize);
tw.WriteLine("#nodes = 0x{0:X}", nodeNum);
tw.WriteLine("nodes @ 0x{0:X}", nodeOffs);
tw.WriteLine("#poses = 0x{0:X}", poseNum);
tw.WriteLine("pose size list @ 0x{0:X}", sizeOffs);
tw.WriteLine("#vecs = 0x{0:X}", vecNum);
tw.WriteLine("vecs @ 0x{0:X}", vecOffs);
tw.WriteLine("#pose bits = 0x{0:X}", nbits);
}
示例11: LogHeaders
private void LogHeaders(TextWriter logger, IDictionary<string, string[]> headers)
{
foreach (KeyValuePair<string, string[]> header in headers)
{
foreach (string value in header.Value)
{
logger.WriteLine("{0}: {1}", header.Key, value ?? "(null)");
}
}
}
示例12: WriteLine
private void WriteLine(TextWriter stream, String message, Object[] args, Boolean error = false)
{
if (String.IsNullOrEmpty(message)) {
stream.WriteLine();
return;
}
if (error) Console.ForegroundColor = ConsoleColor.Red;
if (!String.IsNullOrEmpty(this.Prefix)) {
if (!error) Console.ForegroundColor = ConsoleColor.Cyan;
stream.Write(this.Prefix);
stream.Write(' ');
if (!error) Console.ResetColor();
}
if (this.PrintTimestamp) {
stream.Write(DateTime.Now.ToString("HH:mm:ss.fff"));
stream.Write(' ');
}
if ((null != args) && (0 < args.Length))
message = String.Format(message, args);
stream.WriteLine(message);
if (error) Console.ResetColor();
}
示例13: Run
public void Run(string [] args)
{
fs1 = File.CreateText ("type-hierarchy.xml");
fs1.WriteLine ("<android-hierarchy xmlns:android='" + android_ns + "'>");
foreach (var arg in new string [] {"http://developer.android.com/reference/android/view/View.html"}) {
var baseUrl = resolver.ResolveUri (null, arg);
var doc = FetchXmlDocument (baseUrl);
ProcessDocument (baseUrl);
foreach (XmlElement node in doc.SelectNodes ("//div[@id='subclasses-direct' or @id='subclasses-indirect']")) {
foreach (XmlElement link in node.SelectNodes ("div/table[@class='jd-sumtable-expando']/tr/td[@class='jd-linkcol']/a[@href]")) {
if (link.PreviousSibling != null && link.PreviousSibling.Value.Contains ("extends"))
continue; // it is a link to generic type argument.
var durl = resolver.ResolveUri (baseUrl, link.GetAttribute ("href"));
ProcessDocument (durl);
}
}
}
fs1.WriteLine ("</android-hierarchy>");
fs1.Close ();
}
示例14: CsWriter
public CsWriter(string filename)
{
_writer = new StreamWriter(filename);
_writer.WriteLine("// Licensed to the .NET Foundation under one or more agreements.");
_writer.WriteLine("// The .NET Foundation licenses this file to you under the MIT license.");
_writer.WriteLine("// See the LICENSE file in the project root for more information.");
_writer.WriteLine();
_writer.WriteLine("// NOTE: This is a generated file - do not manually edit!");
_writer.WriteLine();
}
示例15: Logger
public Logger(TextWriter writer)
{
_lwriter = writer;
_loggerTask = Task.Factory.StartNew(() =>
{
var cToken = _cts.Token;
for (; ; )
{
_lwriter.WriteLine(_buf.Receive());
if (cToken.IsCancellationRequested && _buf.Count == 0)
return;
}
});
}