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
- TrackingMemoryStreamFactory.cs
- AttributeQuery.cs
- DataServiceProcessingPipeline.cs
- PageCatalogPartDesigner.cs
- GenericEnumerator.cs
- DropShadowBitmapEffect.cs
- ObjectIDGenerator.cs
- DataListCommandEventArgs.cs
- Point3DKeyFrameCollection.cs
- DesignerAttributeInfo.cs
- BuildProvider.cs
- Baml2006KeyRecord.cs
- PopupRootAutomationPeer.cs
- MenuItemStyle.cs
- XPathChildIterator.cs
- HashAlgorithm.cs
- PointKeyFrameCollection.cs
- EmptyEnumerable.cs
- WorkflowFileItem.cs
- TcpSocketManager.cs
- FileRecordSequenceCompletedAsyncResult.cs
- InstanceNameConverter.cs
- MsmqIntegrationMessagePool.cs
- WebPartVerb.cs
- ExpressionEditorAttribute.cs
- MsmqException.cs
- TraceLog.cs
- URLAttribute.cs
- DocumentViewerBaseAutomationPeer.cs
- Line.cs
- SQLResource.cs
- RangeValueProviderWrapper.cs
- CustomErrorsSectionWrapper.cs
- ColumnHeader.cs
- DiagnosticsConfiguration.cs
- SrgsText.cs
- DataContext.cs
- WebPartAuthorizationEventArgs.cs
- DesignerVerb.cs
- DropShadowEffect.cs
- CompModSwitches.cs
- SiteMap.cs
- WsatServiceCertificate.cs
- RegexCaptureCollection.cs
- SoapAttributeAttribute.cs
- RawAppCommandInputReport.cs
- StatusBarPanel.cs
- MasterPageParser.cs
- CodeSnippetStatement.cs
- DecimalConstantAttribute.cs
- XLinq.cs
- SqlDataSourceQueryEditorForm.cs
- ImageCodecInfoPrivate.cs
- TextEditorSpelling.cs
- ArraySubsetEnumerator.cs
- StrongNameMembershipCondition.cs
- DataProviderNameConverter.cs
- RowType.cs
- NumberFunctions.cs
- GeometryValueSerializer.cs
- SimpleWorkerRequest.cs
- CharacterHit.cs
- CheckBoxRenderer.cs
- EventlogProvider.cs
- Subset.cs
- FontSourceCollection.cs
- FrameAutomationPeer.cs
- tooltip.cs
- ContextMenuService.cs
- SecurityUtils.cs
- DbMetaDataColumnNames.cs
- BitmapEffectDrawingContextState.cs
- EventDrivenDesigner.cs
- ElementHostAutomationPeer.cs
- ChtmlSelectionListAdapter.cs
- XPathChildIterator.cs
- ValidationSummary.cs
- Camera.cs
- Int32CAMarshaler.cs
- ProfileParameter.cs
- SerializableTypeCodeDomSerializer.cs
- InteropTrackingRecord.cs
- DataMisalignedException.cs
- PersonalizationStateInfo.cs
- DeclarativeCatalogPartDesigner.cs
- Calendar.cs
- ImageInfo.cs
- SqlExpander.cs
- XmlEncodedRawTextWriter.cs
- AtomMaterializer.cs
- EndpointIdentityConverter.cs
- BrowserTree.cs
- DataRelation.cs
- DataComponentGenerator.cs
- LocatorPartList.cs
- CollectionMarkupSerializer.cs
- DeferredReference.cs
- DataGridViewDataConnection.cs
- HeaderedItemsControl.cs
- EntitySqlQueryState.cs