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


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

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


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

示例1: generate_visualizers

        public void generate_visualizers()
        {
            var path = @"C:\code\diagnostics\src\FubuMVC.Diagnostics\Visualization\Visualizers\ConfigurationActions";

            var types = typeof (FubuRequest).Assembly.GetExportedTypes()
                .Where(x => x.IsConcreteTypeOf<IConfigurationAction>());

            var fileSystem = new FileSystem();

            types.Each(x =>
            {
                var writer = new StringWriter();
                /*
            <use master="" />
            <viewdata model="FubuMVC.Diagnostics.Visualization.BehaviorNodeViewModel" />
                 */
                writer.WriteLine("<use master=\"\" />");
                writer.WriteLine("<viewdata model=\"{0}\" />", x.FullName);

                var file = path.AppendPath(x.Name + ".spark");

                fileSystem.WriteStringToFile(file, writer.ToString());

            });
        }
开发者ID:jbogard,项目名称:fubumvc,代码行数:25,代码来源:debugging.cs

示例2: ToString

 public override string ToString()
 {
     System.IO.StringWriter s = new System.IO.StringWriter();
     s.WriteLine("Circle with");
     s.WriteLine(base.ToString());
     s.WriteLine("Radius {0}", Radius);
     return s.ToString();
 }
开发者ID:91xie,项目名称:Visual-Studio-2010,代码行数:8,代码来源:Program.cs

示例3: Class1

        static Class1()
        {
            // Create test writer object to hold expected output
            System.IO.StringWriter expectedOut = new System.IO.StringWriter();

            // Write expected output to string writer object
            expectedOut.WriteLine("in finally");
            expectedOut.WriteLine("done");

            // Create and initialize test log object
            testLog = new TestUtil.TestLog(expectedOut);
        }
开发者ID:l1183479157,项目名称:coreclr,代码行数:12,代码来源:simplenonlocalexitnestedintrycatch.cs

示例4: BisectionConsoleWriteLine

 public static string BisectionConsoleWriteLine(theFunction1 fBisection, double x1, double x2, double eps)
 {
     System.IO.StringWriter s = new System.IO.StringWriter();
     s.WriteLine("x1=({0}) x2=({1}) iterations=({2})", x1, x2, eps);
     if (BisectionValid(fBisection, x1, x2) == true)
     {
         s.WriteLine("Bisection Valid = TRUE");
         s.WriteLine("m=({0})", BisectionMethod(fBisection, x1, x2, eps));
     }
     else { s.WriteLine("Bisection Valid = FALSE"); }
     return s.ToString();
 }
开发者ID:91xie,项目名称:Visual-Studio-2010,代码行数:12,代码来源:Class1.cs

示例5: Class1

        static Class1()
        {
            // Create test writer object to hold expected output
            System.IO.StringWriter expectedOut = new System.IO.StringWriter();

            // Write expected output to string writer object
            expectedOut.WriteLine("1234");
            expectedOut.WriteLine("test2");
            expectedOut.WriteLine("end outer catch test2");
            expectedOut.WriteLine("1234");
            // Create and initialize test log object
            testLog = new TestUtil.TestLog(expectedOut);
        }
开发者ID:l1183479157,项目名称:coreclr,代码行数:13,代码来源:oponerror.cs

示例6: Class1

        static Class1()
        {
            // Create test writer object to hold expected output
            System.IO.StringWriter expectedOut = new System.IO.StringWriter();

            // Write expected output to string writer object
            expectedOut.WriteLine("in Try catch");
            expectedOut.WriteLine("in Try finally");
            expectedOut.WriteLine("in Finally");
            expectedOut.WriteLine("Caught an exception");
            expectedOut.WriteLine("in Catch");

            // Create and initialize test log object
            testLog = new TestUtil.TestLog(expectedOut);
        }
开发者ID:CheneyWu,项目名称:coreclr,代码行数:15,代码来源:tryfinallytrycatch.cs

示例7: OrganizeExternalNamespaces

 void OrganizeExternalNamespaces()
 {
     foreach (Assembly asm in Parameters.References)
     {
         try
         {
             NameResolutionService.OrganizeAssemblyTypes(asm);
         }
         catch (ReflectionTypeLoadException x)
         {
             System.IO.StringWriter loadErrors = new System.IO.StringWriter();
             loadErrors.Write("'" + asm.FullName + "' - (" + GetLocation(asm) + "):");
             loadErrors.WriteLine(x.Message);
             foreach(Exception e in x.LoaderExceptions)
             {
                 loadErrors.WriteLine(e.Message);
             }
             Errors.Add(
                 CompilerErrorFactory.FailedToLoadTypesFromAssembly(
                     loadErrors.ToString(), x));
         }
         catch (Exception x)
         {
             Errors.Add(
                 CompilerErrorFactory.FailedToLoadTypesFromAssembly(
                     "'" + asm.FullName + "' - (" + GetLocation(asm) + "): " + x.Message, x));
         }
     }
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:29,代码来源:InitializeNameResolutionService.cs

示例8: RegisterEnableRemoveButtonScript

		private void RegisterEnableRemoveButtonScript()
		{
			Type t = this.Page.GetType();
			string scriptName = "_kh_RegisterEnableRemoveButton";
			if (!this.Page.ClientScript.IsClientScriptBlockRegistered(t, scriptName))
			{
				System.IO.StringWriter sw1 = new System.IO.StringWriter();
				sw1.WriteLine("function EnableRemoveButton(removeButtonId, hfId) ");
				sw1.WriteLine("{ ");
				sw1.WriteLine("	var hf = document.getElementById(hfId); ");
				sw1.WriteLine("	if (hf); ");
				sw1.WriteLine("		document.getElementById(removeButtonId).disabled = (hf.value == '||' || hf.value == '|');");
				sw1.WriteLine("} ");
				this.Page.ClientScript.RegisterClientScriptBlock(t, scriptName, sw1.ToString(), true);
			}
		}
开发者ID:dlnuckolls,项目名称:glorykidd-public,代码行数:16,代码来源:ExternalTermControl.ascx.cs

示例9: ToString

 public string ToString(bool verbose)
 {
     System.IO.StringWriter writer = new System.IO.StringWriter();
     foreach (CompilerError error in InnerList)
     {
         writer.WriteLine(error.ToString(verbose));
     }
     return writer.ToString();
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:9,代码来源:CompilerErrorCollection.cs

示例10: GenerateHexDump

 public static string GenerateHexDump(byte[] data) {
     if (data == null || data.Length == 0)
         return "";
     int size = data.Length;
     //ByteBuffer buffer = new ByteBuffer(data);
     System.IO.MemoryStream buffer = new System.IO.MemoryStream(data);
     //long remaining = (buffer.Length - buffer.Position);
     string ascii = "";
     //StringBuilder sb = new StringBuilder((buffer.Remaining * 3) - 1);
     StringBuilder sb = new StringBuilder(((int)(buffer.Length - buffer.Position) * 3) - 1);
     System.IO.StringWriter writer = new System.IO.StringWriter(sb);
     int lineCount = 0;
     for (int i = 0; i < size; i++) {
         int val = buffer.ReadByte() & 0xFF;
         writer.Write((char)highDigits[val]);
         writer.Write((char)lowDigits[val]);
         writer.Write(" ");
         ascii += GetAsciiEquivalent(val) + " ";
         lineCount++;
         if (i == 0)
             continue;
         if ((i + 1) % 8 == 0)
             writer.Write("  ");
         if ((i + 1) % 16 == 0) {
             writer.Write(" ");
             writer.Write(ascii);
             writer.WriteLine();
             ascii = "";
             lineCount = 0;
         } else if (i == size - 1) {///HALF-ASSED ATTEMPT TO GET THE LAST LINE OF ASCII TO LINE UP CORRECTLY
             //while(lineCount < 84) {
             //    writer.Write(" ");
             //    lineCount++;
             //}
             for (int y = lineCount; y < 25; y++) {
                 writer.Write(" ");
             }
             writer.Write(ascii);
             writer.WriteLine();
         }
     }
     return sb.ToString();
 }
开发者ID:MagicWishMonkey,项目名称:aoi.net,代码行数:43,代码来源:Hex.cs

示例11: ReadFromFileToString

 static string ReadFromFileToString(string aTextFile)
 {
     System.IO.StreamReader InputFile = new System.IO.StreamReader(aTextFile);
     System.IO.StringWriter s = new System.IO.StringWriter();
     while (!InputFile.EndOfStream)
     {
         s.WriteLine(InputFile.ReadLine());
     }
     return s.ToString();
 }
开发者ID:91xie,项目名称:Visual-Studio-2010,代码行数:10,代码来源:Program.cs

示例12: StringReader

 static string StringReader(string Input)
 {
     System.IO.StringWriter s = new System.IO.StringWriter();
     System.IO.StreamReader theFile = new System.IO.StreamReader(Input);
     while (theFile.EndOfStream != true)
     {
         s.WriteLine(theFile.ReadLine());
     }
     return s.ToString();
 }
开发者ID:91xie,项目名称:Visual-Studio-2010,代码行数:10,代码来源:Program.cs

示例13: Serialize

        public static string Serialize(System.Collections.Generic.Dictionary<string, object> ht)
        {
            System.IO.StringWriter wr = new System.IO.StringWriter();
            wr.Write("{");

            //this should guarantee english decimal separators. If not, try en-us.
            //System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
            //System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            bool fFirst = true;

            foreach (var kvp in ht)
            {
                if (!fFirst)
                {
                    wr.WriteLine(",");
                }
                else
                {
                    wr.WriteLine();
                    fFirst = false;
                }
                wr.Write(string.Format("\t\"{0:S}\": ", kvp.Key));

                if (kvp.Value is double)
                    wr.Write(((double)kvp.Value).ToString());
                else if (kvp.Value is int)
                    wr.Write(((int)kvp.Value).ToString());
                else if (kvp.Value is long)
                    wr.Write(((long)kvp.Value).ToString());
                else if (kvp.Value is DateTime)
                    wr.Write(UnixTicks(((DateTime)kvp.Value)).ToString());
                else
                    wr.Write(string.Format("\"{0:S}\"", kvp.Value.ToString()));
            }

            wr.WriteLine();
            wr.WriteLine("}");
            wr.Flush();

            return wr.ToString();
        }
开发者ID:simgreci,项目名称:xetohub,代码行数:42,代码来源:EventHubWriter.cs

示例14: FormatInnerException

        public static string FormatInnerException(Exception exception)
        {
            var writer = new System.IO.StringWriter();
            var lastStacktrace = exception.StackTrace;
            var tabCount = 0;
            var currentException = exception;

            while(currentException != null)
            {
                writer.WriteLine("{0}{1}", new string('\t', tabCount), currentException.Message);
                lastStacktrace = currentException.StackTrace;

                tabCount++;
                currentException = currentException.InnerException;
            }

            writer.WriteLine(lastStacktrace);

            return writer.ToString();
        }
开发者ID:jamisliao,项目名称:aws-sdk-net-samples,代码行数:20,代码来源:Utilities.cs

示例15: Class1

        static Class1()
        {
            // Create test writer object to hold expected output
            System.IO.StringWriter expectedOut = new System.IO.StringWriter();

            // Write expected output to string writer object
            System.Exception exp = new System.Exception();
            expectedOut.WriteLine("In f1");
            expectedOut.WriteLine("In f2");
            expectedOut.WriteLine("In f2's catch " + exp.Message);
            expectedOut.WriteLine("In f1's catch " + exp.Message);
            expectedOut.WriteLine("In main's catch1 " + exp.Message);
            expectedOut.WriteLine("In f1");
            expectedOut.WriteLine("In f2");
            expectedOut.WriteLine("In f2's catch " + exp.Message);
            expectedOut.WriteLine("In f1's catch " + exp.Message);
            expectedOut.WriteLine("In main's catch2 " + exp.Message);

            // Create and initialize test log object
            testLog = new TestUtil.TestLog(expectedOut);
        }
开发者ID:CheneyWu,项目名称:coreclr,代码行数:21,代码来源:samerethrowtwice.cs


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