Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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. // //[....] //----------------------------------------------------------------------------- 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TraceLevelStore.cs
- PropertyValueChangedEvent.cs
- JsonReaderWriterFactory.cs
- ToolboxItemAttribute.cs
- FullTextBreakpoint.cs
- ConditionalAttribute.cs
- InvalidBodyAccessException.cs
- X500Name.cs
- CapabilitiesRule.cs
- AppManager.cs
- TextPointer.cs
- FontWeightConverter.cs
- WorkflowMarkupSerializerMapping.cs
- SelectionUIHandler.cs
- OSEnvironmentHelper.cs
- SqlGenerator.cs
- EndpointAddressAugust2004.cs
- DefaultHttpHandler.cs
- WebConfigurationHostFileChange.cs
- BitmapDecoder.cs
- SectionXmlInfo.cs
- TypeTypeConverter.cs
- RoutedEventValueSerializer.cs
- latinshape.cs
- DodSequenceMerge.cs
- MediaTimeline.cs
- DiscoveryReference.cs
- TextRunProperties.cs
- Transactions.cs
- ProjectionPath.cs
- StringSource.cs
- ErrorWebPart.cs
- RemoveStoryboard.cs
- RotationValidation.cs
- RecognizedAudio.cs
- TemplateNameScope.cs
- PropertyDescriptorCollection.cs
- RuntimeIdentifierPropertyAttribute.cs
- PropertySourceInfo.cs
- XPathNavigatorException.cs
- SingleTagSectionHandler.cs
- HttpModulesSection.cs
- XmlUrlResolver.cs
- PopupRootAutomationPeer.cs
- EntityContainerRelationshipSet.cs
- XsdDuration.cs
- HandlerMappingMemo.cs
- ArrayWithOffset.cs
- WebPartDisplayModeCollection.cs
- BuildProvider.cs
- TimeoutException.cs
- SessionSymmetricMessageSecurityProtocolFactory.cs
- TextLineResult.cs
- SchemaElementLookUpTable.cs
- UIElement3DAutomationPeer.cs
- FixedDocumentSequencePaginator.cs
- _ContextAwareResult.cs
- File.cs
- DataViewManagerListItemTypeDescriptor.cs
- EntityProviderFactory.cs
- CountAggregationOperator.cs
- FrameworkElementAutomationPeer.cs
- DbParameterCollection.cs
- HostedTransportConfigurationBase.cs
- DataGridViewCellConverter.cs
- DrawingContextWalker.cs
- WebPartMinimizeVerb.cs
- StatusBarItemAutomationPeer.cs
- AuthenticatedStream.cs
- SqlRetyper.cs
- WebControlsSection.cs
- ValidationHelper.cs
- AttributeTableBuilder.cs
- RegularExpressionValidator.cs
- MatrixTransform3D.cs
- CompoundFileIOPermission.cs
- AppDomainFactory.cs
- CriticalFinalizerObject.cs
- WpfPayload.cs
- TypeConverterValueSerializer.cs
- AutoGeneratedField.cs
- CompilerGlobalScopeAttribute.cs
- GiveFeedbackEventArgs.cs
- HtmlTextArea.cs
- DictionaryItemsCollection.cs
- Graphics.cs
- EmptyControlCollection.cs
- SqlResolver.cs
- PresentationSource.cs
- OutputCacheSection.cs
- DefaultObjectMappingItemCollection.cs
- RtfControlWordInfo.cs
- TypeBuilderInstantiation.cs
- EventManager.cs
- HashAlgorithm.cs
- EntityDesignerBuildProvider.cs
- precedingsibling.cs
- PropVariant.cs
- TagPrefixCollection.cs
- StoreContentChangedEventArgs.cs