本文整理汇总了C#中System.IO.TextWriter类的典型用法代码示例。如果您正苦于以下问题:C# System.IO.TextWriter类的具体用法?C# System.IO.TextWriter怎么用?C# System.IO.TextWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.IO.TextWriter类属于命名空间,在下文中一共展示了System.IO.TextWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TextWriterErrorListener
public TextWriterErrorListener(TextWriter writer)
{
if (writer == null)
throw new ArgumentNullException("writer");
_writer = writer;
}
示例2: BeginAssembly
public override void BeginAssembly()
{
if (_consoleOnly)
{
base.BeginAssembly();
Init = System.IO.TextWriter.Null; //This is a publi member that other classes may use!
return;
}
OpenOutput(Filename + ".cpp");
base.BeginAssembly();
Init = new System.IO.StringWriter();
var execDir = System.IO.Path.GetDirectoryName(System.IO.Path.GetFullPath(System.Reflection.Assembly.GetExecutingAssembly().Location));
if (execDir.EndsWith("Debug"))
execDir = execDir.Replace("Debug", "Release");
WriteOutput(@"
#using <System.dll>
//#using <{0}/MCDynamicRuntime.dll>
//#using <{0}/mjr.exe>
using namespace System;
using namespace mjr;
namespace MDRSrcGen
{{
ref class Program
{{
", execDir.Replace('\\', '/'));
}
示例3: HtmlTextWriter
public HtmlTextWriter(System.IO.TextWriter inner)
{
this._inner = inner;
var nl = inner.NewLine;
this.CoreNewLine = nl.ToCharArray();
this._windowsNewLine = nl == "\r\n";
}
示例4: Format
/// <summary>
/// Formats a complete HTML document describing the given
/// <see cref="Error"/> instance.
/// </summary>
public override void Format(TextWriter writer, Error error)
{
if (writer == null) throw new ArgumentNullException("writer");
if (error == null) throw new ArgumentNullException("error");
var page = new ErrorMailHtmlPage(error);
writer.Write(page.TransformText());
}
示例5: Generate
// This method is OPTIONAL, you may choose to implement Write and WriteLiteral without use of __razor_writer
// and provide another means of invoking Execute.
//
/// <summary>Executes the template, writing to the provided text writer.</summary>
/// <param name=""writer"">The TextWriter to which to write the template output.</param>
public void Generate(System.IO.TextWriter writer)
{
Html = new HtmlHelper (writer);
Url = new UrlHelper ();
__razor_writer = writer;
Execute ();
__razor_writer = null;
}
示例6: DumpChildren
protected override void DumpChildren(TextWriter Out, uint Depth)
{
foreach (VEntry e in Fields.Values) {
Indent(Out, Depth);
Out.Write(e.Name);
Out.WriteLine(" =");
e.Value.Dump(Out, Depth+1);
}
}
示例7: Game
public Game(int players, System.IO.TextWriter log)
{
this.Log = log;
this.Deck = new Deck();
this.Players = Enumerable.Range(0, players).Select(i => new Player(this, i)).ToList();
this.Fails = FAILS;
this.Hints = HINTS;
this.FinalTurns = players;
}
示例8: GetStringTemplateWriter
public static ITemplateWriter GetStringTemplateWriter(this TemplateGroup group, TextWriter writer)
{
if (group == null)
throw new ArgumentNullException("group");
if (writer == null)
throw new ArgumentNullException("writer");
return new AutoIndentWriter(writer);
}
示例9: WriteAfter
/// <summary>
/// Writes flow state that is true on exit from the basic block.
/// </summary>
/// <param name="arch"></param>
/// <param name="writer"></param>
public void WriteAfter(IProcessorArchitecture arch, TextWriter writer)
{
EmitRegisters(arch, "// DataOut:", DataOut, writer);
writer.WriteLine();
EmitFlagGroup(arch, "// DataOut (flags):", grfOut, writer);
writer.WriteLine();
EmitLocals("// LocalsOut:", writer);
if (TerminatesProcess)
writer.WriteLine("// Terminates process");
}
示例10: PrintStackTrace
internal static void PrintStackTrace(this Exception e, TextWriter writer)
{
writer.WriteLine(e.ToString());
string trace = e.StackTrace ?? string.Empty;
foreach (string line in trace.Split('\n', '\r'))
{
if (!string.IsNullOrEmpty(line))
writer.WriteLine(" " + line);
}
}
示例11: Main
public static void Main(string[] args)
{
nick = "SecureIRC";
owner = "SecureIRC";
server = "irc.entalyan.com";
port = 6999;
chan = "#SecureIRC";
pass = ""; //Enter just the password
//Connect to irc server and get input and output text streams from TcpClient.
sock.Connect(server, port);
if (!sock.Connected)
{
Console.WriteLine("Failed to connect!");
return;
}
input = new System.IO.StreamReader(sock.GetStream());
output = new System.IO.StreamWriter(sock.GetStream());
//Starting USER and NICK login commands
output.Write(
"PASS " + nick + ":" + pass + "\r\n" +
"USER " + nick + " 0 * :" + owner + "\r\n" +
"NICK " + nick + "\r\n" +
"PRIVMSG #SecureIRC Successful login at: " + DateTime.Now.ToString() + "\r\n"
);
output.Flush();
Listen();
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
示例12: zombolize
public static void zombolize(string[] args)
{
if(args.Length!=6)
{
ConsoleLog.WriteLine("Usage: zombolize loginlist dictionary proxylist threadcount outfile");
return;
}
m_NickNameList=new NerZul.Core.Utils.StringHolder(args[1]);
m_Dictionary=System.IO.File.ReadAllLines(args[2]);
m_ProxyList=new NerZul.Core.Utils.StringSelector(args[3]);
int ThreadCount=int.Parse(args[4]);
m_OutS=new System.IO.StreamWriter(args[5]);
m_List=new System.Collections.Generic.List<Engine.Zomboloid.LoginPassword>();
for(int i=0; i<ThreadCount;i++)
{
new System.Threading.Thread(zombolize_thread).Start();
}
while(true)
{
System.Threading.Thread.Sleep(500);
lock(m_ThreadCountLock)
{
if(m_ThreadCount<=0) return;
}
}
}
示例13: JsonWriter
public JsonWriter()
{
_instStringBuilder = new System.Text.StringBuilder();
_writer = new System.IO.StringWriter(_instStringBuilder);
Init();
}
示例14: CommandBase
public CommandBase()
{
//by default, read from/write to standard streams
this.In = System.Console.In;
this.Out = System.Console.Out;
this.Error = System.Console.Error;
}
示例15: Initializer
protected void Initializer(string FeatureName)
{
this.In = System.Console.In;
this.Out = System.Console.Out;
this.Error = System.Console.Out;
Name = FeatureName;
}