当前位置: 首页>>代码示例>>C#>>正文


C# IO.TextWriter类代码示例

本文整理汇总了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;
        }
开发者ID:mahanteshck,项目名称:antlrcs,代码行数:7,代码来源:TextWriterErrorListener.cs

示例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('\\', '/'));
    }
开发者ID:reshadi2,项目名称:mcjs,代码行数:32,代码来源:CppAsmGenerator.cs

示例3: HtmlTextWriter

        public HtmlTextWriter(System.IO.TextWriter inner)
        {
            this._inner = inner;

            var nl = inner.NewLine;
            this.CoreNewLine = nl.ToCharArray();
            this._windowsNewLine = nl == "\r\n";
        }
开发者ID:boombuler,项目名称:CommonMark.NET,代码行数:8,代码来源:HtmlTextWriter.cs

示例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());
        }
开发者ID:ramsenthil18,项目名称:elmah,代码行数:13,代码来源:ErrorMailHtmlFormatter.cs

示例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;
 }
开发者ID:rrawla,项目名称:PortableRazor,代码行数:13,代码来源:ViewBase.cs

示例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);
     }
 }
开发者ID:cakoose,项目名称:cks,代码行数:9,代码来源:VRecord.cs

示例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;
 }
开发者ID:martijneken,项目名称:hanabi,代码行数:9,代码来源:Program.cs

示例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);
        }
开发者ID:mahanteshck,项目名称:antlrcs,代码行数:9,代码来源:TemplateExtensions.cs

示例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");
 }
开发者ID:relaxar,项目名称:reko,代码行数:15,代码来源:BlockFlow.cs

示例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);
     }
 }
开发者ID:JSchofield,项目名称:antlrcs,代码行数:10,代码来源:ExceptionExtensions.cs

示例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();

        }
开发者ID:Entalyan,项目名称:Simple-IRC-Tests,代码行数:34,代码来源:Program.cs

示例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;
                }
            }
        }
开发者ID:sasha237,项目名称:NorthCitadel,代码行数:27,代码来源:Zomboloid.cs

示例13: JsonWriter

        public JsonWriter()
        {
            _instStringBuilder = new System.Text.StringBuilder();
            _writer = new System.IO.StringWriter(_instStringBuilder);

            Init();
        }
开发者ID:CraigTaylor,项目名称:App.Port,代码行数:7,代码来源:JsonWriter.cs

示例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;
 }
开发者ID:varixto,项目名称:stellar,代码行数:7,代码来源:CommandBase.cs

示例15: Initializer

 protected void Initializer(string FeatureName)
 {
     this.In = System.Console.In;
     this.Out = System.Console.Out;
     this.Error = System.Console.Out;
     Name = FeatureName;
 }
开发者ID:Ngauet,项目名称:automatedframework,代码行数:7,代码来源:ConsoleBase.cs


注:本文中的System.IO.TextWriter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。