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
- HtmlInputControl.cs
- RelationshipDetailsCollection.cs
- WorkflowRuntimeServiceElement.cs
- PartBasedPackageProperties.cs
- BitmapFrameEncode.cs
- TextBoxAutomationPeer.cs
- ObjectResult.cs
- Exception.cs
- DayRenderEvent.cs
- RsaSecurityToken.cs
- ChannelEndpointElement.cs
- counter.cs
- DrawingState.cs
- ProgressChangedEventArgs.cs
- TypeRestriction.cs
- ExtendedPropertyDescriptor.cs
- SecurityCookieModeValidator.cs
- PopupEventArgs.cs
- InvalidCastException.cs
- LayoutTable.cs
- LogicalTreeHelper.cs
- DataContractSerializerOperationGenerator.cs
- DelegatedStream.cs
- ISCIIEncoding.cs
- ContentFilePart.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- TCPClient.cs
- WebContext.cs
- MdiWindowListStrip.cs
- MetadataElement.cs
- DataGridViewSelectedColumnCollection.cs
- XmlNodeReader.cs
- GenericPrincipal.cs
- MappingMetadataHelper.cs
- LocalBuilder.cs
- EntityProviderFactory.cs
- ValueTypeFixupInfo.cs
- SafeWaitHandle.cs
- Enum.cs
- BamlResourceContent.cs
- OleDbDataReader.cs
- Point.cs
- PolicyLevel.cs
- FixedSOMTable.cs
- HttpCachePolicy.cs
- ReadWriteSpinLock.cs
- InnerItemCollectionView.cs
- DataSvcMapFile.cs
- IssuanceTokenProviderState.cs
- SelectionItemPattern.cs
- XmlValidatingReaderImpl.cs
- ColumnPropertiesGroup.cs
- ByteArrayHelperWithString.cs
- InkCanvasAutomationPeer.cs
- Triplet.cs
- DataGridViewRowsAddedEventArgs.cs
- SchemaElementLookUpTableEnumerator.cs
- FamilyMapCollection.cs
- XmlElementAttributes.cs
- TransformProviderWrapper.cs
- NamespaceCollection.cs
- ParserContext.cs
- EmbeddedMailObjectsCollection.cs
- Padding.cs
- DurableInstanceContextProvider.cs
- ResourceType.cs
- ImageFormat.cs
- SqlRewriteScalarSubqueries.cs
- ElementNotAvailableException.cs
- InstalledFontCollection.cs
- IsolatedStorage.cs
- FormsAuthenticationModule.cs
- ConfigurationStrings.cs
- IChannel.cs
- ErrorTolerantObjectWriter.cs
- ServiceDefaults.cs
- DbConnectionPoolGroupProviderInfo.cs
- HuffmanTree.cs
- DataRecordInternal.cs
- WebPartEditorCancelVerb.cs
- SafePipeHandle.cs
- Stack.cs
- PlainXmlWriter.cs
- InfoCardTrace.cs
- DetailsViewAutoFormat.cs
- MailWebEventProvider.cs
- XmlNamedNodeMap.cs
- ApplicationTrust.cs
- MsmqChannelFactory.cs
- ColorPalette.cs
- LoginNameDesigner.cs
- GridViewSortEventArgs.cs
- ProtectedConfiguration.cs
- SamlNameIdentifierClaimResource.cs
- VBIdentifierDesigner.xaml.cs
- ListenerSessionConnectionReader.cs
- List.cs
- EntityClientCacheKey.cs
- WindowsBrush.cs
- JsonWriter.cs