Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PackageRelationship.cs
- BaseParaClient.cs
- SqlDataSourceCommandEventArgs.cs
- NullRuntimeConfig.cs
- SchemaDeclBase.cs
- SimpleApplicationHost.cs
- XmlDomTextWriter.cs
- SettingsBindableAttribute.cs
- DataGridViewTextBoxColumn.cs
- DataGridSortCommandEventArgs.cs
- SelectionProviderWrapper.cs
- StrokeIntersection.cs
- LinqDataSourceStatusEventArgs.cs
- SqlExpander.cs
- ScriptIgnoreAttribute.cs
- WindowAutomationPeer.cs
- DelegateInArgument.cs
- NavigationPropertyEmitter.cs
- HttpGetClientProtocol.cs
- Rss20ItemFormatter.cs
- DecoderReplacementFallback.cs
- DataSpaceManager.cs
- ReverseComparer.cs
- NativeRecognizer.cs
- PointAnimationUsingKeyFrames.cs
- SettingsPropertyWrongTypeException.cs
- DynamicILGenerator.cs
- ScrollChrome.cs
- RenderTargetBitmap.cs
- TreeBuilderXamlTranslator.cs
- XmlSignificantWhitespace.cs
- BoundPropertyEntry.cs
- ImportCatalogPart.cs
- WebPartDescription.cs
- TableCellCollection.cs
- ConfigXmlComment.cs
- _TLSstream.cs
- FilterElement.cs
- DetailsViewInsertEventArgs.cs
- QuaternionIndependentAnimationStorage.cs
- _WinHttpWebProxyDataBuilder.cs
- UniqueIdentifierService.cs
- TransformGroup.cs
- TransformedBitmap.cs
- AccessibleObject.cs
- FontDialog.cs
- Utils.cs
- LessThan.cs
- PermissionAttributes.cs
- CustomAttributeSerializer.cs
- IgnoreSectionHandler.cs
- ToolStripAdornerWindowService.cs
- PackagingUtilities.cs
- Vector3D.cs
- AttachedAnnotation.cs
- StreamGeometry.cs
- OracleDateTime.cs
- ISAPIWorkerRequest.cs
- LinqDataSource.cs
- HostedTransportConfigurationBase.cs
- X509Utils.cs
- FilterableAttribute.cs
- WebEvents.cs
- EncryptedXml.cs
- NamedPipeConnectionPoolSettings.cs
- DataSourceView.cs
- DesignerDataRelationship.cs
- TextBoxRenderer.cs
- ServicesExceptionNotHandledEventArgs.cs
- XmlWellformedWriter.cs
- WebResourceUtil.cs
- MonthCalendar.cs
- AsyncResult.cs
- InvalidPrinterException.cs
- DataShape.cs
- ResolveCompletedEventArgs.cs
- HttpModulesSection.cs
- MaskedTextBoxDesigner.cs
- XamlTypeWithExplicitNamespace.cs
- ValuePattern.cs
- XmlSchemaCollection.cs
- figurelengthconverter.cs
- HttpRawResponse.cs
- InternalConfigEventArgs.cs
- CodeTypeParameter.cs
- OSFeature.cs
- XsdBuilder.cs
- CriticalFinalizerObject.cs
- ListParagraph.cs
- MetadataItemEmitter.cs
- LedgerEntry.cs
- ArrangedElementCollection.cs
- Array.cs
- querybuilder.cs
- ToolStripTextBox.cs
- QuaternionRotation3D.cs
- Constraint.cs
- SchemaImporterExtension.cs
- User.cs
- DataGridTable.cs