Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Xml / System / Xml / Serialization / IndentedWriter.cs / 1 / IndentedWriter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Serialization { using System.IO; ////// /// This class will write to a stream and manage indentation. /// internal class IndentedWriter { TextWriter writer; bool needIndent; int indentLevel; bool compact; internal IndentedWriter(TextWriter writer, bool compact) { this.writer = writer; this.compact = compact; } internal int Indent { get { return indentLevel; } set { indentLevel = value; } } internal void Write(string s) { if (needIndent) WriteIndent(); writer.Write(s); } internal void Write(char c) { if (needIndent) WriteIndent(); writer.Write(c); } internal void WriteLine(string s) { if (needIndent) WriteIndent(); writer.WriteLine(s); needIndent = true; } internal void WriteLine() { writer.WriteLine(); needIndent = true; } internal void WriteIndent() { needIndent = false; if (!compact) { for (int i = 0; i < indentLevel; i++) { writer.Write(" "); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Serialization { using System.IO; ////// /// This class will write to a stream and manage indentation. /// internal class IndentedWriter { TextWriter writer; bool needIndent; int indentLevel; bool compact; internal IndentedWriter(TextWriter writer, bool compact) { this.writer = writer; this.compact = compact; } internal int Indent { get { return indentLevel; } set { indentLevel = value; } } internal void Write(string s) { if (needIndent) WriteIndent(); writer.Write(s); } internal void Write(char c) { if (needIndent) WriteIndent(); writer.Write(c); } internal void WriteLine(string s) { if (needIndent) WriteIndent(); writer.WriteLine(s); needIndent = true; } internal void WriteLine() { writer.WriteLine(); needIndent = true; } internal void WriteIndent() { needIndent = false; if (!compact) { for (int i = 0; i < indentLevel; i++) { writer.Write(" "); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GACMembershipCondition.cs
- COM2FontConverter.cs
- OleDbException.cs
- AuthenticatedStream.cs
- ConfigurationSection.cs
- DataConnectionHelper.cs
- DispatchWrapper.cs
- ExpressionBuilder.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- PenThread.cs
- List.cs
- StorageComplexTypeMapping.cs
- Splitter.cs
- MessageSmuggler.cs
- LightweightEntityWrapper.cs
- ContentDisposition.cs
- DesignerActionKeyboardBehavior.cs
- DataPagerCommandEventArgs.cs
- EntitySetDataBindingList.cs
- PartitionResolver.cs
- MarkupExtensionSerializer.cs
- ChangeNode.cs
- XmlSchemaAll.cs
- SystemIcmpV4Statistics.cs
- EventLogTraceListener.cs
- ToolStripGripRenderEventArgs.cs
- XmlSchemaCollection.cs
- SignedXml.cs
- recordstatescratchpad.cs
- XmlRawWriter.cs
- SchemaName.cs
- ImageAnimator.cs
- HuffmanTree.cs
- ExpressionEvaluator.cs
- Atom10FormatterFactory.cs
- DataGridViewLayoutData.cs
- IIS7UserPrincipal.cs
- GenericUriParser.cs
- DataGridViewCellStyleConverter.cs
- RegistrySecurity.cs
- XmlChoiceIdentifierAttribute.cs
- HtmlInputRadioButton.cs
- WebExceptionStatus.cs
- MediaCommands.cs
- CompositeFontParser.cs
- TextRangeProviderWrapper.cs
- Int32CAMarshaler.cs
- DataGridViewColumnCollectionEditor.cs
- SafeLocalMemHandle.cs
- InstanceCreationEditor.cs
- AdapterDictionary.cs
- ScrollChrome.cs
- Query.cs
- ClientData.cs
- BufferedWebEventProvider.cs
- OutputCacheSettings.cs
- HttpListenerRequest.cs
- RegexInterpreter.cs
- BlurBitmapEffect.cs
- LayoutTableCell.cs
- SoapFormatter.cs
- ContentPlaceHolder.cs
- cookiecontainer.cs
- SignatureToken.cs
- AgileSafeNativeMemoryHandle.cs
- X509ChainElement.cs
- ProfessionalColorTable.cs
- DataGridViewSelectedColumnCollection.cs
- CleanUpVirtualizedItemEventArgs.cs
- OSFeature.cs
- EDesignUtil.cs
- SAPIEngineTypes.cs
- TimelineCollection.cs
- RepeaterCommandEventArgs.cs
- NavigationPropertyEmitter.cs
- UndoEngine.cs
- TabRenderer.cs
- ExpressionEditorSheet.cs
- ZipIORawDataFileBlock.cs
- DrawingAttributeSerializer.cs
- CngKeyBlobFormat.cs
- DeviceContext.cs
- SrgsRulesCollection.cs
- Timeline.cs
- SqlWebEventProvider.cs
- WsatServiceAddress.cs
- XmlSerializationGeneratedCode.cs
- ResXBuildProvider.cs
- PublishLicense.cs
- PointLightBase.cs
- GradientStop.cs
- XslNumber.cs
- DescendantBaseQuery.cs
- PeerPresenceInfo.cs
- ListItemCollection.cs
- HttpException.cs
- DataGridViewRowPrePaintEventArgs.cs
- EllipseGeometry.cs
- ConfigXmlAttribute.cs
- WebPartVerbCollection.cs