Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- LocatorGroup.cs
- PageTheme.cs
- Environment.cs
- PersonalizationEntry.cs
- TileModeValidation.cs
- XamlSerializer.cs
- TextEvent.cs
- SqlDataSourceQueryEditor.cs
- EdmItemCollection.cs
- EndpointAddressProcessor.cs
- ZoneMembershipCondition.cs
- PropertyFilterAttribute.cs
- TdsParserStateObject.cs
- TraceListeners.cs
- DataGridViewRowPostPaintEventArgs.cs
- SynchronizedKeyedCollection.cs
- AllMembershipCondition.cs
- BitmapData.cs
- EditBehavior.cs
- MergeEnumerator.cs
- Identity.cs
- WeakReferenceEnumerator.cs
- XmlDataImplementation.cs
- NetCodeGroup.cs
- ConnectionStringsExpressionBuilder.cs
- DataControlFieldHeaderCell.cs
- DrawingCollection.cs
- WindowsSolidBrush.cs
- StartUpEventArgs.cs
- MediaElement.cs
- _KerberosClient.cs
- ACE.cs
- SystemIPInterfaceStatistics.cs
- WindowsGraphics.cs
- CrossContextChannel.cs
- EmptyQuery.cs
- SQLDateTime.cs
- ItemsControl.cs
- DSASignatureFormatter.cs
- FontWeightConverter.cs
- Color.cs
- RelationshipConverter.cs
- PersonalizableTypeEntry.cs
- Rules.cs
- AlphabetConverter.cs
- PasswordTextContainer.cs
- MatrixKeyFrameCollection.cs
- MouseCaptureWithinProperty.cs
- ServiceHttpHandlerFactory.cs
- XmlAttributes.cs
- DocumentPaginator.cs
- ApplicationTrust.cs
- SessionSwitchEventArgs.cs
- TextServicesPropertyRanges.cs
- XmlDocument.cs
- ToolStripControlHost.cs
- DbDataReader.cs
- BitmapEffectDrawingContextState.cs
- InternalDuplexChannelListener.cs
- HandlerBase.cs
- TextWriter.cs
- TypeElement.cs
- WriterOutput.cs
- PixelShader.cs
- PixelFormatConverter.cs
- KeyMatchBuilder.cs
- NonClientArea.cs
- PersonalizationStateInfoCollection.cs
- HtmlButton.cs
- ZipIOBlockManager.cs
- CodeSubDirectoriesCollection.cs
- FlagsAttribute.cs
- SqlCacheDependencyDatabaseCollection.cs
- OrderingInfo.cs
- ChannelFactoryRefCache.cs
- HttpProfileBase.cs
- IgnoreFlushAndCloseStream.cs
- ObservableCollection.cs
- XmlSerializableServices.cs
- PerformanceCounterLib.cs
- DecimalFormatter.cs
- Win32KeyboardDevice.cs
- Facet.cs
- CompilerErrorCollection.cs
- HelpHtmlBuilder.cs
- DataMemberFieldEditor.cs
- EncryptedPackageFilter.cs
- AutomationPatternInfo.cs
- EntitySet.cs
- OleDbMetaDataFactory.cs
- XmlCDATASection.cs
- SystemResources.cs
- DrawingImage.cs
- Stroke.cs
- DllNotFoundException.cs
- Button.cs
- SecurityKeyType.cs
- MdiWindowListItemConverter.cs
- BaseDataListDesigner.cs
- CommunicationException.cs