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


C# System.IO.TextWriter.WriteLine方法代码示例

本文整理汇总了C#中System.IO.TextWriter.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# System.IO.TextWriter.WriteLine方法的具体用法?C# System.IO.TextWriter.WriteLine怎么用?C# System.IO.TextWriter.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.TextWriter的用法示例。


在下文中一共展示了System.IO.TextWriter.WriteLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: Emit

		public override void Emit(IProcessorArchitecture arch, TextWriter writer)
		{
			EmitRegisters(arch, "// DataOut:", DataOut, writer);
            writer.WriteLine();
			EmitFlagGroup(arch, "// DataOut (flags):", grfOut, writer);
            writer.WriteLine();
            SymbolicIn.Emit(arch, "// SymbolicIn:", writer);
            writer.WriteLine();
            EmitLocals("// LocalsOut:", writer);
            if (TerminatesProcess)
                writer.WriteLine("// Terminates process");
		}
开发者ID:relaxar,项目名称:reko,代码行数:12,代码来源:BlockFlow.cs

示例3: 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

示例4: DumpChildren

 protected override void DumpChildren(TextWriter Out, uint Depth)
 {
     foreach (Element e in Elements) {
     e.First.Dump(Out, Depth);
     if (e.ArrowPos != null) {
         Indent(Out, Depth+1);
         Out.WriteLine("->");
         e.Second.Dump(Out, Depth+1);
     }
     }
 }
开发者ID:cakoose,项目名称:cks,代码行数:11,代码来源:VCollection.cs

示例5: RunTest

 /// <summary>
 /// Runs the test.
 /// </summary>
 /// <param name="name">Name.</param>
 /// <param name="testMethod">Test method.</param>
 /// <param name="output">Output.</param>
 public static void RunTest(string name, Action testMethod, TextWriter output = null)
 {
     if (output == null)
         output = Console.Out;
     string _oldNL = output.NewLine;
     try
     {
         output.WriteLine(_runTestFormatStart, name);
         testMethod();
         output.WriteLine(_runTestFormatSuccess, name);
     }
     catch (FaultException<ExceptionDetail> ex)
     {
         output.WriteLine(_runTestFormatError, name);
         output.WriteLine(_runTestFormatException, ex.GetType().FullName, ex.Message, ex.StackTrace);
         foreach (DictionaryEntry de in ex.Data)
             output.Write("\t{0} = {1}\n", de.Key.ToString(), de.Value.ToString());
         int indent = 0;
         for (ExceptionDetail detail = ex.Detail; detail != null; detail = detail.InnerException)
             output.WriteLine(string.Concat(" ------ Inner Exception ------\n",
                 string.Format(_runTestFormatException, detail.Type, detail.Message, detail.StackTrace))
                 .Replace("\n", string.Concat("\n", new string(' ', ++indent * 2))).TrimStart('\n'));
     }
     catch (Exception ex)
     {
         output.WriteLine(_runTestFormatError, name);
         output.WriteLine(_runTestFormatException, ex.GetType().FullName, ex.Message, ex.StackTrace);
         foreach (DictionaryEntry de in ex.Data)
             output.Write("\t{0} = {1}\n", de.Key.ToString(), de.Value.ToString());
         int indent = 0;
         for (Exception innerEx = ex.InnerException; innerEx != null; innerEx = innerEx.InnerException)
             output.WriteLine(string.Concat("\n ------ Inner Exception ------\n",
                 string.Format(_runTestFormatException, innerEx.GetType().FullName, innerEx.Message, innerEx.StackTrace))
                 .Replace("\n", string.Concat("\n", new string(' ', ++indent * 2))).TrimStart('\n'));
     }
     finally
     {
         output.NewLine = _oldNL;			// you COULD wrap this in a using() if you write a class implementing IDisposable with this line in Dispose()
     }
 }
开发者ID:jbowwww,项目名称:ArtefactService,代码行数:46,代码来源:Program.cs

示例6: Dump

 public void Dump(TextWriter Out, uint Depth)
 {
     Indent(Out, Depth);
     Out.WriteLine(DumpHeader());
     DumpChildren(Out, Depth+1);
 }
开发者ID:cakoose,项目名称:cks,代码行数:6,代码来源:Node.cs

示例7: DisplayVersion

 private void DisplayVersion(TextWriter stdout)
 {
     stdout.WriteLine("Pickles version {0}", Assembly.GetExecutingAssembly().GetName().Version);
 }
开发者ID:vavavivi,项目名称:pickles,代码行数:4,代码来源:CommandLineArgumentParser.cs

示例8: EmitLocals

        private void EmitLocals(string caption, TextWriter writer)
        {
            if (StackVarsOut.Count <= 0)
                return;

            writer.Write(caption);
            SortedList<string, string> list = new SortedList<string, string>();
            foreach (KeyValuePair<Storage, int> de in StackVarsOut)
            {
                Storage id = (Storage)de.Key;
                StringWriter sb = new StringWriter();
                id.Write(sb);
                string sName = sb.ToString();

                list[sName] = string.Format("{0}({1})", sName, de.Value);
            }
            foreach (string s in list.Values)
            {
                writer.Write(" ");
                writer.Write(s);
            }
            writer.WriteLine();
        }
开发者ID:nemerle,项目名称:reko,代码行数:23,代码来源:BlockFlow.cs

示例9: WriteBefore

 /// <summary>
 /// Writes flow state that is true on entry to the basic block.
 /// </summary>
 /// <param name="arch"></param>
 /// <param name="writer"></param>
 public void WriteBefore(IProcessorArchitecture arch, TextWriter writer)
 {
     SymbolicIn.Emit(arch, "// SymbolicIn:", writer);
     writer.WriteLine();
 }
开发者ID:nemerle,项目名称:reko,代码行数:10,代码来源:BlockFlow.cs

示例10: 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:nemerle,项目名称:reko,代码行数:15,代码来源:BlockFlow.cs

示例11: Stats

        private static void Stats(TextWriter writer)
        {
            MemoryManager memmgr = MemoryManager.Global;
            writer.WriteLine("-- Used: {0}", memmgr.UsedBytes);
            writer.WriteLine("-- Allocated: {0}", memmgr.AllocatedBytes);

            VirtualMemoryManager vmm = memmgr as VirtualMemoryManager;
            if (vmm != null)
                vmm.Dump(writer);
        }
开发者ID:modulexcite,项目名称:nasmjit,代码行数:10,代码来源:TestMemoryManager.cs

示例12: PrintGrammar

 public virtual void PrintGrammar( TextWriter output )
 {
     ANTLRTreePrinter printer = new ANTLRTreePrinter( new Antlr.Runtime.Tree.CommonTreeNodeStream( grammarTree ) );
     //printer.setASTNodeClass( "org.antlr.tool.GrammarAST" );
     try
     {
         string g = printer.toString( this, false );
         output.WriteLine( g );
     }
     catch ( RecognitionException re )
     {
         ErrorManager.Error( ErrorManager.MSG_SYNTAX_ERROR, re );
     }
 }
开发者ID:jamilgeor,项目名称:antlrcs,代码行数:14,代码来源:Grammar.cs

示例13: TimedWriteLine

            public TimedWriteLine(System.IO.TextWriter output, string testName = null)
            {
                this.output = output;

                this._testName = testName ??
                    new StackTrace(1, fNeedFileInfo: false).GetFrame(0).GetMethod().Name;

                output.WriteLine(_testName);
                _sw.Start();
            }
开发者ID:haf,项目名称:MessageTemplates,代码行数:10,代码来源:PerfTests.cs

示例14: InitLog

 public static void InitLog()
 {
     Writer = new System.IO.StreamWriter("log.log");
     Writer.WriteLine("----------log started------------");
 }
开发者ID:krayushkin,项目名称:EduWIQA_importer,代码行数:5,代码来源:Program.cs

示例15: LogSuspiciousResults

        private void LogSuspiciousResults()
        {
            LogWriter = System.IO.File.CreateText("E:\\temp\\sorata\\result.txt");
            foreach (MIPSEvaluator.Result res in MIPS.Results)
            {
                bool log = false;
                for (int i = 0; i < res.Arguments.Length; i++)
                    if ((res.Arguments[i] >> 24) == 0x04 || (res.Arguments[i] >> 24) == 0x05 || (res.Arguments[i] >> 24) == 0x06)
                        log = true;

                if (log) LogWriter.WriteLine(res.ToString());
            }
            LogWriter.Close();
        }
开发者ID:kskjer,项目名称:SceneNavi,代码行数:14,代码来源:GameActor.cs


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