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
- AttachmentCollection.cs
- Vector3D.cs
- DefaultProfileManager.cs
- Compress.cs
- InertiaTranslationBehavior.cs
- SoapHelper.cs
- PeerReferralPolicy.cs
- DomainConstraint.cs
- FillErrorEventArgs.cs
- XmlByteStreamWriter.cs
- LinqExpressionNormalizer.cs
- KeyToListMap.cs
- DeriveBytes.cs
- RemoteWebConfigurationHostServer.cs
- MetadataItem_Static.cs
- PrimitiveType.cs
- TargetFrameworkAttribute.cs
- GridViewDeletedEventArgs.cs
- ToolbarAUtomationPeer.cs
- ActivityCodeDomSerializer.cs
- KeyPressEvent.cs
- Emitter.cs
- EndpointAddressAugust2004.cs
- SerializationSectionGroup.cs
- XmlUrlResolver.cs
- TextLineBreak.cs
- WinFormsUtils.cs
- InProcStateClientManager.cs
- ComponentSerializationService.cs
- RankException.cs
- WCFBuildProvider.cs
- ClassicBorderDecorator.cs
- SpeakProgressEventArgs.cs
- StylusCaptureWithinProperty.cs
- ThreadPool.cs
- DataGridViewColumnStateChangedEventArgs.cs
- DataGridColumn.cs
- SortExpressionBuilder.cs
- GetRecipientRequest.cs
- ParentQuery.cs
- MetadataItem_Static.cs
- StylusLogic.cs
- HtmlTable.cs
- XmlNavigatorStack.cs
- EventMap.cs
- FileSecurity.cs
- XmlDigitalSignatureProcessor.cs
- ErrorWebPart.cs
- TemplatePropertyEntry.cs
- filewebresponse.cs
- TypeViewSchema.cs
- RequestQueryProcessor.cs
- ExpressionQuoter.cs
- MatrixKeyFrameCollection.cs
- SimpleWebHandlerParser.cs
- RadioButtonRenderer.cs
- Panel.cs
- BitmapEffect.cs
- ImageAutomationPeer.cs
- StringResourceManager.cs
- ErrorReporting.cs
- HttpProcessUtility.cs
- ObjectConverter.cs
- TcpTransportSecurityElement.cs
- RegisteredDisposeScript.cs
- ToolStripGripRenderEventArgs.cs
- ScriptingJsonSerializationSection.cs
- ToolboxBitmapAttribute.cs
- AccessDataSource.cs
- OdbcEnvironment.cs
- ScaleTransform3D.cs
- LateBoundBitmapDecoder.cs
- SimpleMailWebEventProvider.cs
- MediaPlayer.cs
- InheritedPropertyChangedEventArgs.cs
- DoubleAnimation.cs
- DPCustomTypeDescriptor.cs
- StreamInfo.cs
- ResourceSet.cs
- XmlWellformedWriter.cs
- WsdlServiceChannelBuilder.cs
- DivideByZeroException.cs
- DataGridViewRowCollection.cs
- SystemWebSectionGroup.cs
- OuterGlowBitmapEffect.cs
- NoResizeHandleGlyph.cs
- ResXDataNode.cs
- CompilerParameters.cs
- StaticResourceExtension.cs
- LazyLoadBehavior.cs
- Crc32.cs
- SystemWebCachingSectionGroup.cs
- XmlHierarchyData.cs
- SslStreamSecurityBindingElement.cs
- ToggleButtonAutomationPeer.cs
- XmlWriterDelegator.cs
- Identity.cs
- KeyPressEvent.cs
- Label.cs
- GridViewRow.cs