System.IO.TextWriter.WriteLine(char)

Here are the examples of the csharp api System.IO.TextWriter.WriteLine(char) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

40 Examples 7

19 Source : TokenWriter.cs
with MIT License
from AndresTraks

private void WriteBlock(BlockToken block)
        {
            WriteToken(block.Header);

            WriteIndent();
            _writer.WriteLine('{');
            _indent++;

            IToken precedingToken = null;
            foreach (IToken child in block.Children)
            {
                WriteToken(child, precedingToken);
                precedingToken = child;
            }

            _indent--;
            WriteIndent();
            _writer.WriteLine('}');
        }

19 Source : IniFile.cs
with GNU General Public License v3.0
from cumulusmx

internal void Flush()
		{
			lock (m_Lock)
			{
				// *** If local cache was not modified, exit ***
				if (!m_CacheModified) return;

				var success = false;
				var retries = replacedulus.LogFileRetries;
				do
				{
					try
					{
						// *** Open the file ***
						using (StreamWriter sw = new StreamWriter(m_FileName))
						{
							// *** Cycle on all sections ***
							bool First = false;
							foreach (KeyValuePair<string, Dictionary<string, string>> SectionPair in m_Sections)
							{
								Dictionary<string, string> Section = SectionPair.Value;
								if (First) sw.WriteLine();
								First = true;

								// *** Write the section name ***
								sw.Write('[');
								sw.Write(SectionPair.Key);
								sw.WriteLine(']');

								// *** Cycle on all key+value pairs in the section ***
								foreach (KeyValuePair<string, string> ValuePair in Section)
								{
									// *** Write the key+value pair ***
									sw.Write(ValuePair.Key);
									sw.Write('=');
									sw.WriteLine(ValuePair.Value);
								}
							}
						}

						success = true;
						m_CacheModified = false;
					}
					catch (IOException ex)
					{
						if (ex.HResult == -2147024864) // 0x80070020
						{
							retries--;
							System.Threading.Thread.Sleep(250);
						}
						else
						{
							throw;
						}
					}
					catch
					{
						throw;
					}
				} while (!success && retries >= 0);
			}
		}

19 Source : VDFNode.cs
with GNU General Public License v3.0
from Depressurizer

public void SaveAsText(StreamWriter stream, int indent)
        {
            if (NodeType != ValueType.Array)
            {
                return;
            }

            Dictionary<string, VDFNode> data = NodeArray;
            foreach (KeyValuePair<string, VDFNode> entry in data)
            {
                if (entry.Value.NodeType == ValueType.Array)
                {
                    WriteText_WriteWhitespace(stream, indent);
                    WriteText_WriteFormattedString(stream, entry.Key);
                    stream.WriteLine();

                    WriteText_WriteWhitespace(stream, indent);
                    stream.WriteLine('{');

                    entry.Value.SaveAsText(stream, indent + 1);

                    WriteText_WriteWhitespace(stream, indent);
                    stream.WriteLine('}');
                }
                else
                {
                    WriteText_WriteWhitespace(stream, indent);
                    WriteText_WriteFormattedString(stream, entry.Key);
                    stream.Write("\t\t");

                    WriteText_WriteFormattedString(stream, entry.Value.NodeData.ToString());
                    stream.WriteLine();
                }
            }
        }

19 Source : NbtTest.cs
with MIT License
from dotnetGame

public void StartChild()
            {
                _tw.Write($"{Enumerable.Repeat('\t', _curDepth).Aggregate("", (s, c) => string.Concat(s, c))}");
                _tw.WriteLine(_lastVisitedList.Last() ? '[' : '{');
                ++_curDepth;
            }

19 Source : NbtTest.cs
with MIT License
from dotnetGame

public void EndChild()
            {
                --_curDepth;
                _tw.Write($"{Enumerable.Repeat('\t', _curDepth).Aggregate("", (s, c) => string.Concat(s, c))}");
                _tw.WriteLine(_lastVisitedList.Last() ? ']' : '}');
                _lastVisitedList.RemoveAt(_lastVisitedList.Count - 1);
            }

19 Source : Console.cs
with MIT License
from dotnetGame

[MethodImplAttribute(MethodImplOptions.NoInlining)]
        public static void WriteLine(char value)
        {
            Out.WriteLine(value);
        }

19 Source : TextWriter.cs
with MIT License
from dotnetGame

[MethodImpl(MethodImplOptions.Synchronized)]
            public override void WriteLine(char value) => _out.WriteLine(value);

19 Source : TestLogger.cs
with Apache License 2.0
from elastic

public override void WriteLine(char value)
		{
			lock (Lock)
				base.WriteLine(value);
		}

19 Source : MultiplyMatrices.cs
with Apache License 2.0
from fancunwei

private static void OfferToPrint(int rowCount, int colCount, double[,] matrix)
        {
            Console.Error.Write("Computation complete. Print results (y/n)? ");
            char c = Console.ReadKey(true).KeyChar;
            Console.Error.WriteLine(c);
            if (Char.ToUpperInvariant(c) == 'Y')
            {
                if (!Console.IsOutputRedirected) Console.WindowWidth = 180;
                Console.WriteLine();
                for (int x = 0; x < rowCount; x++)
                {
                    Console.WriteLine("ROW {0}: ", x);
                    for (int y = 0; y < colCount; y++)
                    {
                        Console.Write("{0:#.##} ", matrix[x, y]);
                    }
                    Console.WriteLine();
                }
            }
        }

19 Source : INIParser.cs
with BSD 3-Clause "New" or "Revised" License
from FireFox2000000

private void PerformFlush()
    {
        // *** If local cache was not modified, exit ***
        if (!m_CacheModified) return;
        m_CacheModified = false;

        // *** Copy content of original iniString to temporary string, replace modified values ***
        StringWriter sw = new StringWriter();

        try
        {
            Dictionary<string, string> CurrentSection = null;
            Dictionary<string, string> CurrentSection2 = null;
            StringReader sr = null;
            try
            {
                // *** Open the original file ***
                sr = new StringReader(m_iniString);

                // *** Read the file original content, replace changes with local cache values ***
                string s;
                string SectionName;
                string Key = null;
                string Value = null;
                bool Unmodified;
                bool Reading = true;

                bool Deleted = false;
                string Key2 = null;
                string Value2 = null;

                StringBuilder sb_temp;

                while (Reading)
                {
                    s = sr.ReadLine();
                    Reading = (s != null);

                    // *** Check for end of iniString ***
                    if (Reading)
                    {
                        Unmodified = true;
                        s = s.Trim();
                        SectionName = ParseSectionName(s);
                    }
                    else
                    {
                        Unmodified = false;
                        SectionName = null;
                    }

                    // *** Check for section names ***
                    if ((SectionName != null) || (!Reading))
                    {
                        if (CurrentSection != null)
                        {
                            // *** Write all remaining modified values before leaving a section ****
                            if (CurrentSection.Count > 0)
                            {
                                // *** Optional: All blank lines before new values and sections are removed ****
                                sb_temp = sw.GetStringBuilder();
                                while ((sb_temp[sb_temp.Length - 1] == '\n') || (sb_temp[sb_temp.Length - 1] == '\r'))
                                {
                                    sb_temp.Length = sb_temp.Length - 1;
                                }
                                sw.WriteLine();

                                foreach (string fkey in CurrentSection.Keys)
                                {
                                    if (CurrentSection.TryGetValue(fkey, out Value))
                                    {
                                        sw.Write(fkey);
                                        sw.Write('=');
                                        sw.WriteLine(Value);
                                    }
                                }
                                sw.WriteLine();
                                CurrentSection.Clear();
                            }
                        }

                        if (Reading)
                        {
                            // *** Check if current section is in local modified cache ***
                            if (!m_Modified.TryGetValue(SectionName, out CurrentSection))
                            {
                                CurrentSection = null;
                            }
                        }
                    }
                    else if (CurrentSection != null)
                    {
                        // *** Check for key+value pair ***
                        if (ParseKeyValuePair(s, ref Key, ref Value))
                        {
                            if (CurrentSection.TryGetValue(Key, out Value))
                            {
                                // *** Write modified value to temporary file ***
                                Unmodified = false;
                                CurrentSection.Remove(Key);

                                sw.Write(Key);
                                sw.Write('=');
                                sw.WriteLine(Value);
                            }
                        }
                    }

                    // ** Check if the section/key in current line has been deleted ***
                    if (Unmodified)
                    {
                        if (SectionName != null)
                        {
                            if (!m_Sections.ContainsKey(SectionName))
                            {
                                Deleted = true;
                                CurrentSection2 = null;
                            }
                            else
                            {
                                Deleted = false;
                                m_Sections.TryGetValue(SectionName, out CurrentSection2);
                            }

                        }
                        else if (CurrentSection2 != null)
                        {
                            if (ParseKeyValuePair(s, ref Key2, ref Value2))
                            {
                                if (!CurrentSection2.ContainsKey(Key2)) Deleted = true;
                                else Deleted = false;
                            }
                        }
                    }


                    // *** Write unmodified lines from the original iniString ***
                    if (Unmodified)
                    {
                        if (isComment(s)) sw.WriteLine(s);
                        else if (!Deleted) sw.WriteLine(s);
                    }
                }

                // *** Close string reader ***
                sr.Close();
                sr = null;
            }
            finally
            {
                // *** Cleanup: close string reader ***                  
                if (sr != null) sr.Close();
                sr = null;
            }

            // *** Cycle on all remaining modified values ***
            foreach (KeyValuePair<string, Dictionary<string, string>> SectionPair in m_Modified)
            {
                CurrentSection = SectionPair.Value;
                if (CurrentSection.Count > 0)
                {
                    if (!string.IsNullOrEmpty(sw.ToString()))
                        sw.WriteLine();

                    // *** Write the section name ***
                    sw.Write('[');
                    sw.Write(SectionPair.Key);
                    sw.WriteLine(']');

                    // *** Cycle on all key+value pairs in the section ***
                    foreach (KeyValuePair<string, string> ValuePair in CurrentSection)
                    {
                        // *** Write the key+value pair ***
                        sw.Write(ValuePair.Key);
                        sw.Write('=');
                        sw.WriteLine(ValuePair.Value);
                    }
                    CurrentSection.Clear();
                }
            }
            m_Modified.Clear();

            // *** Get result to iniString ***
            m_iniString = sw.ToString();
            sw.Close();
            sw = null;

            // ** Write iniString to file ***
            if (m_FileName != null)
            {
                File.WriteAllText(m_FileName, m_iniString);
            }
        }
        finally
        {
            // *** Cleanup: close string writer ***                  
            if (sw != null) sw.Close();
            sw = null;
        }
    }

19 Source : ColoredTextWriter.cs
with MIT License
from fuse-open

public override void WriteLine(char value)
		{
			_textWriter.WriteLine(value);
		}

19 Source : TextWriter.cs
with MIT License
from GrapeCity

public override void WriteLine(char value)
        {
            lock (this)
            {
                writer.WriteLine(value);
            }
        }

19 Source : NotationLLSD.cs
with BSD 3-Clause "New" or "Revised" License
from HalcyonGrid

private static void SerializeLLSDNotationMapFormatted(StringWriter writer, string intend, OSDMap osdMap)
        {
            writer.WriteLine();
            writer.Write(intend);
            writer.WriteLine(mapBeginNotationMarker);
            int lastIndex = osdMap.Count - 1;
            int idx = 0;

            foreach (KeyValuePair<string, OSD> kvp in osdMap)
            {
                writer.Write(intend + baseIndent);
                writer.Write(singleQuotesNotationMarker);
                writer.Write(EscapeCharacter(kvp.Key, singleQuotesNotationMarker));
                writer.Write(singleQuotesNotationMarker);
                writer.Write(keyNotationDelimiter);
                SerializeLLSDNotationElementFormatted(writer, intend, kvp.Value);
                if (idx < lastIndex)
                {
                    writer.WriteLine();
                    writer.Write(intend + baseIndent);
                    writer.WriteLine(kommaNotationDelimiter);
                }

                idx++;
            }
            writer.WriteLine();
            writer.Write(intend);
            writer.Write(mapEndNotationMarker);
        }

19 Source : MyNMock2Extensions.cs
with MIT License
from inthehand

public override void DescribeTo(System.IO.TextWriter writer)
            {
                writer.Write("ArrayMatcher");
                if (_lastError != null) {
                    writer.Write(", last error: ");
                    writer.Write(_lastError);
                }
                writer.WriteLine('.');
            }

19 Source : FormattedTextWriter.cs
with MIT License
from joergkrause

public override void WriteLine(char value)
        {
            OutputIndent();
            baseWriter.WriteLine(value);
            indentPending = true;
            onNewLine = true;
            currentColumn = 0;
        }

19 Source : CodeGenerator.cs
with MIT License
from katalash

public void WriteLine(char c)
        {
            WriteIndentation();
            _sw.WriteLine(c);
        }

19 Source : IndentedTextWriter.cs
with GNU General Public License v2.0
from kee-org

public override void WriteLine(char value)
        {
            WritePendingTabs();
            _writer.WriteLine(value);
            _tabsPending = true;
        }

19 Source : INIFile.cs
with GNU General Public License v3.0
from logicpulse

private void PerformFlush()
        {
            // *** If local cache was not modified, exit ***
            if (!_cacheModified) return;
            _cacheModified = false;

            // *** Check if original file exists ***
            bool OriginalFileExists = File.Exists(_fileName);

            // *** Get temporary file name ***
            string TmpFileName = Path.ChangeExtension(_fileName, "$n$");

            // *** Copy content of original file to temporary file, replace modified values ***
            StreamWriter sw = null;

            // *** Create the temporary file ***
            sw = new StreamWriter(TmpFileName);

            try
            {
                Dictionary<string, string> CurrentSection = null;
                if (OriginalFileExists)
                {
                    StreamReader sr = null;
                    try
                    {
                        // *** Open the original file ***
                        sr = new StreamReader(_fileName);

                        // *** Read the file original content, replace changes with local cache values ***
                        string s;
                        string SectionName;
                        string Key = null;
                        string Value = null;
                        bool Unmodified;
                        bool Reading = true;
                        while (Reading)
                        {
                            s = sr.ReadLine();
                            Reading = (s != null);

                            // *** Check for end of file ***
                            if (Reading)
                            {
                                Unmodified = true;
                                s = s.Trim();
                                SectionName = ParseSectionName(s);
                            }
                            else
                            {
                                Unmodified = false;
                                SectionName = null;
                            }

                            // *** Check for section names ***
                            if ((SectionName != null) || (!Reading))
                            {
                                if (CurrentSection != null)
                                {
                                    // *** Write all remaining modified values before leaving a section ****
                                    if (CurrentSection.Count > 0)
                                    {
                                        foreach (string fkey in CurrentSection.Keys)
                                        {
                                            if (CurrentSection.TryGetValue(fkey, out Value))
                                            {
                                                sw.Write(fkey);
                                                sw.Write('=');
                                                sw.WriteLine(Value);
                                            }
                                        }
                                        sw.WriteLine();
                                        CurrentSection.Clear();
                                    }
                                }

                                if (Reading)
                                {
                                    // *** Check if current section is in local modified cache ***
                                    if (!_modified.TryGetValue(SectionName, out CurrentSection))
                                    {
                                        CurrentSection = null;
                                    }
                                }
                            }
                            else if (CurrentSection != null)
                            {
                                // *** Check for key+value pair ***
                                if (ParseKeyValuePair(s, ref Key, ref Value))
                                {
                                    if (CurrentSection.TryGetValue(Key, out Value))
                                    {
                                        // *** Write modified value to temporary file ***
                                        Unmodified = false;
                                        CurrentSection.Remove(Key);

                                        sw.Write(Key);
                                        sw.Write('=');
                                        sw.WriteLine(Value);
                                    }
                                }
                            }

                            // *** Write unmodified lines from the original file ***
                            if (Unmodified)
                            {
                                sw.WriteLine(s);
                            }
                        }

                        // *** Close the original file ***
                        sr.Close();
                        sr = null;
                    }
                    finally
                    {
                        // *** Cleanup: close files ***                  
                        if (sr != null) sr.Close();
                        sr = null;
                    }
                }

                // *** Cycle on all remaining modified values ***
                foreach (KeyValuePair<string, Dictionary<string, string>> SectionPair in _modified)
                {
                    CurrentSection = SectionPair.Value;
                    if (CurrentSection.Count > 0)
                    {
                        sw.WriteLine();

                        // *** Write the section name ***
                        sw.Write('[');
                        sw.Write(SectionPair.Key);
                        sw.WriteLine(']');

                        // *** Cycle on all key+value pairs in the section ***
                        foreach (KeyValuePair<string, string> ValuePair in CurrentSection)
                        {
                            // *** Write the key+value pair ***
                            sw.Write(ValuePair.Key);
                            sw.Write('=');
                            sw.WriteLine(ValuePair.Value);
                        }
                        CurrentSection.Clear();
                    }
                }
                _modified.Clear();

                // *** Close the temporary file ***
                sw.Close();
                sw = null;

                // *** Rename the temporary file ***
                File.Copy(TmpFileName, _fileName, true);

                // *** Delete the temporary file ***
                File.Delete(TmpFileName);
            }
            finally
            {
                // *** Cleanup: close files ***                  
                if (sw != null) sw.Close();
                sw = null;
            }
        }

19 Source : ScriptExportEnum.cs
with MIT License
from mafaca

public sealed override void Export(TextWriter writer, int intent)
		{
			writer.WriteIndent(intent);
			writer.Write("{0} enum {1}", Keyword, TypeName);
			if (Base != null && Base.TypeName != MonoUtils.IntName)
			{
				writer.Write(" : {0}", Base.TypeName);
			}
			writer.WriteLine();

			writer.WriteIndent(intent++);
			writer.WriteLine('{');

			foreach (ScriptExportField field in Fields)
			{
				field.ExportEnum(writer, intent);
			}

			writer.WriteIndent(--intent);
			writer.WriteLine('}');
		}

19 Source : ScriptExportType.cs
with MIT License
from mafaca

public void Export(TextWriter writer)
		{
			ExportUsings(writer);
			if (Namespace == string.Empty)
			{
				Export(writer, 0);
			}
			else
			{
				writer.WriteLine("namespace {0}", Namespace);
				writer.WriteLine('{');
				Export(writer, 1);
				writer.WriteLine('}');
			}
		}

19 Source : ScriptExportType.cs
with MIT License
from mafaca

public virtual void Export(TextWriter writer, int intent)
		{
			if (IsSerializable)
			{
				writer.WriteIndent(intent);
				writer.WriteLine("[{0}]", ScriptExportAttribute.SerializableName);
			}

			writer.WriteIndent(intent);
			writer.Write("{0} {1} {2}", Keyword, IsStruct ? "struct" : "clreplaced", TypeName);
			if (Base != null && !SerializableType.IsBasic(Base.Namespace, Base.NestedName))
			{
				writer.Write(" : {0}", Base.GetTypeNestedName(DeclaringType));
			}
			writer.WriteLine();
			writer.WriteIndent(intent++);
			writer.WriteLine('{');

			foreach (ScriptExportType nestedType in NestedTypes)
			{
				nestedType.Export(writer, intent);
				writer.WriteLine();
			}

			foreach (ScriptExportEnum nestedEnum in NestedEnums)
			{
				nestedEnum.Export(writer, intent);
				writer.WriteLine();
			}

			foreach (ScriptExportDelegate @delegate in NestedDelegates)
			{
				@delegate.Export(writer, intent);
			}
			if (NestedDelegates.Count > 0)
			{
				writer.WriteLine();
			}

			if (Constructor != null)
			{
				Constructor.Export(writer, intent);
				writer.WriteLine();
			}
			foreach (ScriptExportMethod method in Methods)
			{
				method.Export(writer, intent);
				writer.WriteLine();
			}
			foreach (ScriptExportProperty property in Properties)
			{
				property.Export(writer, intent);
			}
			if (Properties.Count > 0)
			{
				writer.WriteLine();
			}
			foreach (ScriptExportField field in Fields)
			{
				field.Export(writer, intent);
			}

			writer.WriteIndent(--intent);
			writer.WriteLine('}');
		}

19 Source : IndentedTextWriter.cs
with MIT License
from meziantou

public override void WriteLine(char value)
        {
            OutputTabs();
            InnerWriter.WriteLine(value);
            _tabsPending = true;
        }

19 Source : AjaxMinBundleTask.cs
with MIT License
from microsoft

protected override void GenerateJavaScript(OutputGroup outputGroup, IList<InputGroup> inputGroups, SwitchParser switchParser, string outputPath, Encoding outputEncoding)
        {
            // create the output file, clobbering any existing content
            if (!FileWriteOperation(outputPath, switchParser.IfNotNull(p => p.Clobber), () =>
                {
                    using (var writer = new StreamWriter(outputPath, false, outputEncoding))
                    {
                        if (inputGroups != null && inputGroups.Count > 0)
                        {
                            // for each input file, copy to the output, separating them with a newline, a semicolon, and another newline
                            var addSeparator = false;
                            foreach (var inputGroup in inputGroups)
                            {
                                if (addSeparator)
                                {
                                    writer.WriteLine();
                                    writer.WriteLine(';');
                                }
                                else
                                {
                                    addSeparator = true;
                                }

                                writer.Write(inputGroup.Source);
                            }
                        }
                    }

                    return true;
                }))
            {
                // could not write file
                Log.LogError(Strings.CouldNotWriteOutputFile, outputPath);
            }
        }

19 Source : V3SourceMap.cs
with MIT License
from microsoft

private void WritePropertyStart(string name)
        {
            if (m_hasProperty)
            {
                m_writer.WriteLine(',');
            }

            OutputEscapedString(name);
            m_writer.Write(':');
            m_hasProperty = true;
        }

19 Source : BlockSyntax.cs
with BSD 3-Clause "New" or "Revised" License
from MSDN-WhiteKnight

public override void ToText(TextWriter target)
        {
            if (this._header.Length > 0)
            {
                target.Write(this._indent);

                for (int i = 0; i < this._header.Length; i++) _header[i].ToText(target);

                target.WriteLine();
                target.Write(this._indent);
                target.WriteLine('{');
            }
            else
            {
                target.Write(this._indent);
                target.WriteLine('{');
            }

            for (int i = 0; i < _children.Count; i++)
            {
                _children[i].ToText(target);
            }

            target.Write(this._indent);
            target.WriteLine('}');
            target.Flush();
        }

19 Source : CilGraph.cs
with BSD 3-Clause "New" or "Revised" License
from MSDN-WhiteKnight

public void Print(
            TextWriter output = null, 
            bool IncludeSignature = false, 
            bool IncludeDefaults = false, 
            bool IncludeAttributes = false,
            bool IncludeHeader = false)
        {
            if (output == null) output = Console.Out;

            CilGraphNode node = this._Root;

            if (IncludeSignature)
            {
                PrintSignature(output);
                output.WriteLine('{');
            }

            if (IncludeAttributes)
            {
                //attributes
                try
                {
                    PrintAttributes(output);
                }
                catch (InvalidOperationException) { }
                catch (TypeLoadException ex)
                {
                    Diagnostics.OnError(
                        this,
                        new CilErrorEventArgs(ex, "Failed to load attributes for " + this._Method.ToString())
                        );
                }
            }

            if (IncludeDefaults)
            {
                //optional parameters
                PrintDefaults(output);
            }            

            //method header           
            if (IncludeHeader)
            {
                PrintHeader(output);
            }

            output.WriteLine();

            //instructions
            if (node != null)
            {
                SyntaxNode[] elems = this.BodyreplacedyntaxTree();

                for (int i = 0; i < elems.Length; i++)
                {
                    elems[i].ToText(output);
                }

            }//endif

            if (IncludeSignature) output.WriteLine("}");            
        }

19 Source : XmlDomWriter.cs
with GNU General Public License v3.0
from NKINC

virtual public void Write(XmlNode node) {
            
            // is there anything to do?
            if (node == null) {
                return;
            }
            
            XmlNodeType type = node.NodeType;
            switch (type) {
                case XmlNodeType.Doreplacedent: {
                    XmlDoreplacedent doreplacedent = (XmlDoreplacedent)node;
                    fXML11 = false; //"1.1".Equals(GetVersion(doreplacedent));
                    if (!fCanonical) {
                        if (fXML11) {
                            fOut.WriteLine("<?xml version=\"1.1\" encoding=\"UTF-8\"?>");
                        } else {
                            fOut.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                        }
                        fOut.Flush();
                        Write(doreplacedent.DoreplacedentType);
                    }
                    Write(doreplacedent.DoreplacedentElement);
                    break;
                }
                
                case XmlNodeType.DoreplacedentType: {
                    XmlDoreplacedentType doctype = (XmlDoreplacedentType)node;
                    fOut.Write("<!DOCTYPE ");
                    fOut.Write(doctype.Name);
                    String publicId = doctype.PublicId;
                    String systemId = doctype.SystemId;
                    if (publicId != null) {
                        fOut.Write(" PUBLIC '");
                        fOut.Write(publicId);
                        fOut.Write("' '");
                        fOut.Write(systemId);
                        fOut.Write('\'');
                    } else if (systemId != null) {
                        fOut.Write(" SYSTEM '");
                        fOut.Write(systemId);
                        fOut.Write('\'');
                    }
                    String internalSubset = doctype.InternalSubset;
                    if (internalSubset != null) {
                        fOut.WriteLine(" [");
                        fOut.Write(internalSubset);
                        fOut.Write(']');
                    }
                    fOut.WriteLine('>');
                    break;
                }
                
                case XmlNodeType.Element: {
                    fOut.Write('<');
                    fOut.Write(node.Name);
                    XmlAttribute[] attrs = SortAttributes(node.Attributes);
                    for (int i = 0; i < attrs.Length; i++) {
                        XmlAttribute attr = attrs[i];
                        fOut.Write(' ');
                        fOut.Write(attr.Name);
                        fOut.Write("=\"");
                        NormalizeAndPrint(attr.Value, true);
                        fOut.Write('"');
                    }
                    fOut.Write('>');
                    fOut.Flush();
                    
                    XmlNode child = node.FirstChild;
                    while (child != null) {
                        Write(child);
                        child = child.NextSibling;
                    }
                    break;
                }
                
                case XmlNodeType.EnreplacedyReference: {
                    if (fCanonical) {
                        XmlNode child = node.FirstChild;
                        while (child != null) {
                            Write(child);
                            child = child.NextSibling;
                        }
                    } else {
                        fOut.Write('&');
                        fOut.Write(node.Name);
                        fOut.Write(';');
                        fOut.Flush();
                    }
                    break;
                }
                
                case XmlNodeType.CDATA: {
                    if (fCanonical) {
                        NormalizeAndPrint(node.Value, false);
                    } else {
                        fOut.Write("<![CDATA[");
                        fOut.Write(node.Value);
                        fOut.Write("]]>");
                    }
                    fOut.Flush();
                    break;
                }
                
                case XmlNodeType.SignificantWhitespace:
                case XmlNodeType.Whitespace:
                case XmlNodeType.Text: {
                    NormalizeAndPrint(node.Value, false);
                    fOut.Flush();
                    break;
                }
                
                case XmlNodeType.ProcessingInstruction: {
                    fOut.Write("<?");
                    fOut.Write(node.Name);
                    String data = node.Value;
                    if (data != null && data.Length > 0) {
                        fOut.Write(' ');
                        fOut.Write(data);
                    }
                    fOut.Write("?>");
                    fOut.Flush();
                    break;
                }
                
                case XmlNodeType.Comment: {
                    if (!fCanonical) {
                        fOut.Write("<!--");
                        String comment = node.Value;
                        if (comment != null && comment.Length > 0) {
                            fOut.Write(comment);
                        }
                        fOut.Write("-->");
                        fOut.Flush();
                    }
                    break;
                }
            }
            
            if (type == XmlNodeType.Element) {
                fOut.Write("</");
                fOut.Write(node.Name);
                fOut.Write('>');
                fOut.Flush();
            }
            
        }

19 Source : print.cs
with MIT License
from Open3270

bool fprint_screen(StreamWriter f, bool even_if_empty)
		{
			int i;
			byte e;
			byte c;
			int ns = 0;
			int nr = 0;
			bool any = false;
			byte fa = telnet.tnctlr.fake_fa;
			int fa_index = telnet.tnctlr.get_field_attribute(0);
			if (fa_index != -1)
				fa  = telnet.tnctlr.screen_buf[fa_index];

			for (i = 0; i < telnet.tnctlr.ROWS*telnet.tnctlr.COLS; i++) 
			{
				if (i!=0 && (i % telnet.tnctlr.COLS)==0) 
				{
					nr++;
					ns = 0;
				}
				e = telnet.tnctlr.screen_buf[i];
				if (telnet.tnctlr.IS_FA(e)) 
				{
					c = (byte)' ';
					fa = telnet.tnctlr.screen_buf[i];
				}
				if (telnet.tnctlr.FA_IS_ZERO(fa))
					c = (byte)' ';
				else
					c = Tables.cg2asc[e];
				if (c == (byte)' ')
					ns++;
				else 
				{
					any = true;
					while (nr!=0) 
					{
						f.WriteLine();
						nr--;
					}
					while (ns!=0) 
					{
						f.WriteLine(" ");
						ns--;
					}
					f.WriteLine(System.Convert.ToChar(c));
				}
			}
			nr++;
			if (!any && !even_if_empty)
				return false;
			while (nr!=0) 
			{
				f.WriteLine();
				nr--;
			}
			return true;
		}

19 Source : Print.cs
with MIT License
from Open3270

bool PrintFormattedScreen(StreamWriter f, bool even_if_empty)
		{
			int i;
			byte e;
			byte c;
			int ns = 0;
			int nr = 0;
			bool any = false;
			byte fa = telnet.Controller.FakeFA;
			int fa_index = telnet.Controller.GetFieldAttribute(0);
			if (fa_index != -1)
				fa = telnet.Controller.ScreenBuffer[fa_index];

			for (i = 0; i < telnet.Controller.RowCount * telnet.Controller.ColumnCount; i++)
			{
				if (i != 0 && (i % telnet.Controller.ColumnCount) == 0)
				{
					nr++;
					ns = 0;
				}
				e = telnet.Controller.ScreenBuffer[i];
				if (FieldAttribute.IsFA(e))
				{
					c = (byte)' ';
					fa = telnet.Controller.ScreenBuffer[i];
				}
				if (FieldAttribute.IsZero(fa))
					c = (byte)' ';
				else
					c = Tables.Cg2Ascii[e];
				if (c == (byte)' ')
					ns++;
				else
				{
					any = true;
					while (nr != 0)
					{
						f.WriteLine();
						nr--;
					}
					while (ns != 0)
					{
						f.WriteLine(" ");
						ns--;
					}
					f.WriteLine(System.Convert.ToChar(c));
				}
			}
			nr++;
			if (!any && !even_if_empty)
				return false;
			while (nr != 0)
			{
				f.WriteLine();
				nr--;
			}
			return true;
		}

19 Source : GenBase.cs
with GNU General Public License v3.0
from pfusik

protected void WriteLine(char c)
	{
		StartLine();
		this.Writer.WriteLine(c);
		this.AtLineStart = true;
	}

19 Source : FormattedTextWriter.cs
with MIT License
from poppastring

public override void WriteLine(char value) 
        {
            OutputIndent();
            baseWriter.WriteLine(value);
            indentPending = true;
            onNewLine = true;
            currentColumn = 0;
        }

19 Source : IniFile.cs
with Apache License 2.0
from prom3theu5

private void PerformFlush()
        {
            if (!m_CacheModified) return;
            m_CacheModified = false;

            bool OriginalFileExists = File.Exists(m_FileName);

            string TmpFileName = Path.ChangeExtension(m_FileName, "$n$");

            StreamWriter sw = null;

            sw = new StreamWriter(TmpFileName);

            try
            {
                Dictionary<string, string> CurrentSection = null;
                if (OriginalFileExists)
                {
                    StreamReader sr = null;
                    try
                    {
                        sr = new StreamReader(m_FileName);

                        string s;
                        string SectionName;
                        string Key = null;
                        string Value = null;
                        bool Unmodified;
                        bool Reading = true;
                        while (Reading)
                        {
                            s = sr.ReadLine();
                            Reading = (s != null);

                            if (Reading)
                            {
                                Unmodified = true;
                                s = s.Trim();
                                SectionName = ParseSectionName(s);
                            }
                            else
                            {
                                Unmodified = false;
                                SectionName = null;
                            }
                            if ((SectionName != null) || (!Reading))
                            {
                                if (CurrentSection != null)
                                {
                                    if (CurrentSection.Count > 0)
                                    {
                                        foreach (string fkey in CurrentSection.Keys)
                                        {
                                            if (CurrentSection.TryGetValue(fkey, out Value))
                                            {
                                                sw.Write(fkey);
                                                sw.Write('=');
                                                sw.WriteLine(Value);
                                            }
                                        }
                                        sw.WriteLine();
                                        CurrentSection.Clear();
                                    }
                                }

                                if (Reading)
                                {
                                    if (!m_Modified.TryGetValue(SectionName, out CurrentSection))
                                    {
                                        CurrentSection = null;
                                    }
                                }
                            }
                            else if (CurrentSection != null)
                            {
                                if (ParseKeyValuePair(s, ref Key, ref Value))
                                {
                                    if (CurrentSection.TryGetValue(Key, out Value))
                                    {
                                        Unmodified = false;
                                        CurrentSection.Remove(Key);

                                        sw.Write(Key);
                                        sw.Write('=');
                                        sw.WriteLine(Value);
                                    }
                                }
                            }

                            if (Unmodified)
                            {
                                sw.WriteLine(s);
                            }
                        }

                        sr.Close();
                        sr = null;
                    }
                    finally
                    {
                        if (sr != null) sr.Close();
                        sr = null;
                    }
                }

                foreach (KeyValuePair<string, Dictionary<string, string>> SectionPair in m_Modified)
                {
                    CurrentSection = SectionPair.Value;
                    if (CurrentSection.Count > 0)
                    {
                        sw.WriteLine();

                        sw.Write('[');
                        sw.Write(SectionPair.Key);
                        sw.WriteLine(']');

                        foreach (KeyValuePair<string, string> ValuePair in CurrentSection)
                        {
                            sw.Write(ValuePair.Key);
                            sw.Write('=');
                            sw.WriteLine(ValuePair.Value);
                        }
                        CurrentSection.Clear();
                    }
                }
                m_Modified.Clear();

                sw.Close();
                sw = null;

                File.Copy(TmpFileName, m_FileName, true);

                File.Delete(TmpFileName);
            }
            finally
            {
                if (sw != null) sw.Close();
                sw = null;
            }
        }

19 Source : TextWriter.cs
with MIT License
from roozbehid

public override void WriteLine (char value)
		{
			lock (this) {
				writer.WriteLine (value);
			}
		}

19 Source : UnturnedConsoleWriter.cs
with MIT License
from SmartlyDressedGames

public override void WriteLine(char value)
        {
            _consoleOutput.WriteLine(value);
            _streamWriter.WriteLine(value);

        }

19 Source : Console.cs
with MIT License
from spaceflint7

public static void WriteLine(char value) => Out.WriteLine(value);

19 Source : NodeImplementations.cs
with GNU General Public License v3.0
from TASVideos

public void DumpContentDescriptive(TextWriter w, string padding)
		{
			w.Write(padding);
			w.Write('(');
			w.Write(Name);
			foreach (var (k, v) in Parameters.OrderBy(kvp => kvp.Key))
			{
				w.Write('|');
				w.Write(k);
				w.Write('=');
				w.Write(v);
			}

			w.WriteLine(')');
		}

19 Source : IndentedTextWriter.cs
with MIT License
from Team-RTCLI

public override void WriteLine(char value)
        {
            OutputTabs();
            _writer.WriteLine(value);
            _tabsPending = true;
        }

19 Source : StringWriter.cs
with MIT License
from Team-RTCLI

public override Task WriteLineAsync(char value)
        {
            WriteLine(value);
            return Task.CompletedTask;
        }

19 Source : IniFile.cs
with GNU General Public License v3.0
from uholeschak

public void PerformFlush()
        {
            if (_mFileName == null) return;
            // *** If local cache was not modified, exit ***
            if (!_mCacheModified) return;
            _mCacheModified = false;

            // *** Check if original file exists ***
            bool originalFileExists = File.Exists(_mFileName);

            // *** Get temporary file name ***
            string tmpFileName = Path.ChangeExtension(_mFileName, "$n$");
            if (tmpFileName == null) return;

            // *** Copy content of original file to temporary file, replace modified values ***
            StreamWriter sw = null;

            // *** Create the temporary file ***
            sw = new StreamWriter(tmpFileName);

            try
            {
                Dictionary<string, string> currentSection = null;
                if (originalFileExists)
                {
                    StreamReader sr = null;
                    try
                    {
                        // *** Open the original file ***
                        sr = new StreamReader(_mFileName);

                        // *** Read the file original content, replace changes with local cache values ***
                        string s;
                        string sectionName;
                        string key = null;
                        string value = null;
                        bool unmodified;
                        bool reading = true;
                        while (reading)
                        {
                            s = sr.ReadLine();
                            reading = (s != null);

                            // *** Check for end of file ***
                            if (reading)
                            {
                                unmodified = true;
                                s = s.Trim();
                                sectionName = ParseSectionName(s);
                            }
                            else
                            {
                                unmodified = false;
                                sectionName = null;
                            }

                            // *** Check for section names ***
                            if ((sectionName != null) || (!reading))
                            {
                                if (currentSection != null)
                                {
                                    // *** Write all remaining modified values before leaving a section ****
                                    if (currentSection.Count > 0)
                                    {
                                        foreach (string fkey in currentSection.Keys)
                                        {
                                            if (currentSection.TryGetValue(fkey, out value))
                                            {
                                                sw.Write(fkey);
                                                sw.Write('=');
                                                sw.WriteLine(value);
                                            }
                                        }
                                        sw.WriteLine();
                                        currentSection.Clear();
                                    }
                                }

                                if (reading)
                                {
                                    // *** Check if current section is in local modified cache ***
                                    if (!_mModified.TryGetValue(sectionName, out currentSection))
                                    {
                                        currentSection = null;
                                    }
                                }
                            }
                            else if (currentSection != null)
                            {
                                // *** Check for key+value pair ***
                                if (ParseKeyValuePair(s, ref key, ref value))
                                {
                                    if (currentSection.TryGetValue(key, out value))
                                    {
                                        // *** Write modified value to temporary file ***
                                        unmodified = false;
                                        currentSection.Remove(key);

                                        sw.Write(key);
                                        sw.Write('=');
                                        sw.WriteLine(value);
                                    }
                                }
                            }

                            // *** Write unmodified lines from the original file ***
                            if (unmodified)
                            {
                                sw.WriteLine(s);
                            }
                        }

                        // *** Close the original file ***
                        sr.Close();
                        sr = null;
                    }
                    finally
                    {
                        // *** Cleanup: close files ***
                        if (sr != null) sr.Close();
                        sr = null;
                    }
                }

                // *** Cycle on all remaining modified values ***
                foreach (KeyValuePair<string, Dictionary<string, string>> sectionPair in _mModified)
                {
                    currentSection = sectionPair.Value;
                    if (currentSection.Count > 0)
                    {
                        sw.WriteLine();

                        // *** Write the section name ***
                        sw.Write('[');
                        sw.Write(sectionPair.Key);
                        sw.WriteLine(']');

                        // *** Cycle on all key+value pairs in the section ***
                        foreach (KeyValuePair<string, string> valuePair in currentSection)
                        {
                            // *** Write the key+value pair ***
                            sw.Write(valuePair.Key);
                            sw.Write('=');
                            sw.WriteLine(valuePair.Value);
                        }
                        currentSection.Clear();
                    }
                }
                _mModified.Clear();

                // *** Close the temporary file ***
                sw.Close();
                sw = null;

                // *** Rename the temporary file ***
                File.Copy(tmpFileName, _mFileName, true);

                // *** Delete the temporary file ***
                File.Delete(tmpFileName);
            }
            finally
            {
                // *** Cleanup: close files ***
                if (sw != null) sw.Close();
            }
        }

19 Source : INIParser.cs
with Apache License 2.0
from wuhan005

private void PerformFlush()
    {
        // *** If local cache was not modified, exit ***
        if (!m_CacheModified) return;
        m_CacheModified = false;

        // *** Copy content of original iniString to temporary string, replace modified values ***
        StringWriter sw = new StringWriter();

        try
        {
            Dictionary<string, string> CurrentSection = null;
            Dictionary<string, string> CurrentSection2 = null;
            StringReader sr = null;
            try
            {
                // *** Open the original file ***
                sr = new StringReader(m_iniString);

                // *** Read the file original content, replace changes with local cache values ***
                string s;
                string SectionName;
                string Key = null;
                string Value = null;
                bool Unmodified;
                bool Reading = true;

                bool Deleted = false;
                string Key2 = null;
                string Value2 = null;

                StringBuilder sb_temp;

                while (Reading)
                {
                    s = sr.ReadLine();
                    Reading = (s != null);

                    // *** Check for end of iniString ***
                    if (Reading)
                    {
                        Unmodified = true;
                        s = s.Trim();
                        SectionName = ParseSectionName(s);
                    }
                    else
                    {
                        Unmodified = false;
                        SectionName = null;
                    }

                    // *** Check for section names ***
                    if ((SectionName != null) || (!Reading))
                    {
                        if (CurrentSection != null)
                        {
                            // *** Write all remaining modified values before leaving a section ****
                            if (CurrentSection.Count > 0)
                            {
                                // *** Optional: All blank lines before new values and sections are removed ****
                                sb_temp = sw.GetStringBuilder();
                                while ((sb_temp[sb_temp.Length - 1] == '\n') || (sb_temp[sb_temp.Length - 1] == '\r'))
                                {
                                    sb_temp.Length = sb_temp.Length - 1;
                                }
                                sw.WriteLine();

                                foreach (string fkey in CurrentSection.Keys)
                                {
                                    if (CurrentSection.TryGetValue(fkey, out Value))
                                    {
                                        sw.Write(fkey);
                                        sw.Write('=');
                                        sw.WriteLine(Value);
                                    }
                                }
                                sw.WriteLine();
                                CurrentSection.Clear();
                            }
                        }

                        if (Reading)
                        {
                            // *** Check if current section is in local modified cache ***
                            if (!m_Modified.TryGetValue(SectionName, out CurrentSection))
                            {
                                CurrentSection = null;
                            }
                        }
                    }
                    else if (CurrentSection != null)
                    {
                        // *** Check for key+value pair ***
                        if (ParseKeyValuePair(s, ref Key, ref Value))
                        {
                            if (CurrentSection.TryGetValue(Key, out Value))
                            {
                                // *** Write modified value to temporary file ***
                                Unmodified = false;
                                CurrentSection.Remove(Key);

                                sw.Write(Key);
                                sw.Write('=');
                                sw.WriteLine(Value);
                            }
                        }
                    }

                    // ** Check if the section/key in current line has been deleted ***
                    if (Unmodified)
                    {
                        if (SectionName != null)
                        {
                            if (!m_Sections.ContainsKey(SectionName))
                            {
                                Deleted = true;
                                CurrentSection2 = null;
                            }
                            else
                            {
                                Deleted = false;
                                m_Sections.TryGetValue(SectionName, out CurrentSection2);
                            }

                        }
                        else if (CurrentSection2 != null)
                        {
                            if (ParseKeyValuePair(s, ref Key2, ref Value2))
                            {
                                if (!CurrentSection2.ContainsKey(Key2)) Deleted = true;
                                else Deleted = false;
                            }
                        }
                    }


                    // *** Write unmodified lines from the original iniString ***
                    if (Unmodified)
                    {
                        if (isComment(s)) sw.WriteLine(s);
                        else if (!Deleted) sw.WriteLine(s);
                    }
                }

                // *** Close string reader ***
                sr.Close();
                sr = null;
            }
            finally
            {
                // *** Cleanup: close string reader ***                  
                if (sr != null) sr.Close();
                sr = null;
            }

            // *** Cycle on all remaining modified values ***
            foreach (KeyValuePair<string, Dictionary<string, string>> SectionPair in m_Modified)
            {
                CurrentSection = SectionPair.Value;
                if (CurrentSection.Count > 0)
                {
                    sw.WriteLine();

                    // *** Write the section name ***
                    sw.Write('[');
                    sw.Write(SectionPair.Key);
                    sw.WriteLine(']');

                    // *** Cycle on all key+value pairs in the section ***
                    foreach (KeyValuePair<string, string> ValuePair in CurrentSection)
                    {
                        // *** Write the key+value pair ***
                        sw.Write(ValuePair.Key);
                        sw.Write('=');
                        sw.WriteLine(ValuePair.Value);
                    }
                    CurrentSection.Clear();
                }
            }
            m_Modified.Clear();

            // *** Get result to iniString ***
            m_iniString = sw.ToString();
            sw.Close();
            sw = null;

            // ** Write iniString to file ***
            if (m_FileName != null)
            {
                File.WriteAllText(m_FileName, m_iniString);
            }
        }
        finally
        {
            // *** Cleanup: close string writer ***                  
            if (sw != null) sw.Close();
            sw = null;
        }
    }