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
- ToolStripItemBehavior.cs
- ListBindingHelper.cs
- PackUriHelper.cs
- RichTextBoxContextMenu.cs
- BamlTreeUpdater.cs
- KnownColorTable.cs
- IFormattable.cs
- XmlUtf8RawTextWriter.cs
- NativeMethods.cs
- VScrollProperties.cs
- ClipboardData.cs
- ParameterBuilder.cs
- _SslSessionsCache.cs
- NotConverter.cs
- AttachmentCollection.cs
- XpsStructure.cs
- FormatException.cs
- XPathMessageFilterElementComparer.cs
- CommittableTransaction.cs
- MessageQueue.cs
- DependencyObject.cs
- CellTreeNodeVisitors.cs
- CriticalFinalizerObject.cs
- SignedInfo.cs
- _ListenerRequestStream.cs
- ContextQuery.cs
- PageRouteHandler.cs
- SiteMembershipCondition.cs
- WriteFileContext.cs
- ThreadStateException.cs
- Vector3DAnimation.cs
- AncillaryOps.cs
- GatewayDefinition.cs
- AssociationTypeEmitter.cs
- Application.cs
- AutomationPeer.cs
- SqlServices.cs
- cookie.cs
- dataprotectionpermission.cs
- NonBatchDirectoryCompiler.cs
- NamedElement.cs
- DbConnectionPoolGroupProviderInfo.cs
- PackageStore.cs
- ItemCheckedEvent.cs
- ServiceMetadataBehavior.cs
- SqlConnectionFactory.cs
- SQLInt64.cs
- ResourceBinder.cs
- OleDbDataAdapter.cs
- ToolStripPanelDesigner.cs
- Symbol.cs
- Exceptions.cs
- TextElementEnumerator.cs
- HtmlButton.cs
- SqlClientMetaDataCollectionNames.cs
- MeshGeometry3D.cs
- StatusBar.cs
- CompositeFontParser.cs
- ActiveXHelper.cs
- DesignerHost.cs
- ItemsPanelTemplate.cs
- SingleObjectCollection.cs
- Point3DCollection.cs
- _HeaderInfoTable.cs
- CodeValidator.cs
- OleDbSchemaGuid.cs
- Ipv6Element.cs
- ParseChildrenAsPropertiesAttribute.cs
- XmlSchemaProviderAttribute.cs
- DynamicMethod.cs
- RouteItem.cs
- InstancePersistence.cs
- HtmlImage.cs
- AssemblyBuilder.cs
- ValidationErrorCollection.cs
- SiteOfOriginPart.cs
- StylusPointDescription.cs
- ScalarConstant.cs
- FixedSOMTextRun.cs
- WebPartCancelEventArgs.cs
- StateDesigner.Helpers.cs
- EntityClassGenerator.cs
- ToolStripDropDownClosedEventArgs.cs
- FormView.cs
- PixelFormats.cs
- PasswordRecovery.cs
- SaveFileDialogDesigner.cs
- AttributeEmitter.cs
- SettingsAttributes.cs
- CompiledXpathExpr.cs
- ExtensionWindowHeader.cs
- ManagedIStream.cs
- Stylus.cs
- GlobalProxySelection.cs
- DisableDpiAwarenessAttribute.cs
- ComponentDispatcher.cs
- ThreadExceptionEvent.cs
- XPathDescendantIterator.cs
- Substitution.cs
- FileStream.cs