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
- XsltLoader.cs
- ConnectionManagementElement.cs
- TextWriterEngine.cs
- TextUtf8RawTextWriter.cs
- SslStream.cs
- CodeSubDirectoriesCollection.cs
- TextBounds.cs
- AggregatePushdown.cs
- DbConnectionPool.cs
- LongValidatorAttribute.cs
- FlowDocumentScrollViewer.cs
- XmlNodeChangedEventManager.cs
- AuthenticationModuleElementCollection.cs
- XPathAncestorQuery.cs
- ImageConverter.cs
- CompModHelpers.cs
- DebuggerAttributes.cs
- CompilationLock.cs
- SrgsElementFactory.cs
- SolidColorBrush.cs
- ClientTargetSection.cs
- MissingSatelliteAssemblyException.cs
- TreeWalker.cs
- MenuAutomationPeer.cs
- GeneralTransform3D.cs
- GenericUriParser.cs
- ObjectDataSourceView.cs
- UnsafeNativeMethodsPenimc.cs
- LineVisual.cs
- IndexedGlyphRun.cs
- BaseHashHelper.cs
- HttpListenerException.cs
- StubHelpers.cs
- TextBoxBase.cs
- LinqTreeNodeEvaluator.cs
- SafeFileMappingHandle.cs
- Rectangle.cs
- MulticastDelegate.cs
- ListViewInsertEventArgs.cs
- TakeOrSkipWhileQueryOperator.cs
- TcpServerChannel.cs
- ConfigXmlAttribute.cs
- NoPersistProperty.cs
- MLangCodePageEncoding.cs
- Table.cs
- CompositeCollectionView.cs
- PersonalizationStateInfo.cs
- WebPartConnectionsCancelVerb.cs
- OnOperation.cs
- EditorZoneBase.cs
- MatrixCamera.cs
- Vector3DConverter.cs
- EntityCommandCompilationException.cs
- CheckedPointers.cs
- EventToken.cs
- MetabaseSettings.cs
- UnsafeNetInfoNativeMethods.cs
- UserMapPath.cs
- XmlSchemaObject.cs
- WrappedIUnknown.cs
- Domain.cs
- ConfigurationConverterBase.cs
- AnnotationObservableCollection.cs
- smtppermission.cs
- SystemIPInterfaceProperties.cs
- ConfigurationLockCollection.cs
- ProgressBarRenderer.cs
- QilName.cs
- DomNameTable.cs
- KnownBoxes.cs
- CustomPopupPlacement.cs
- StructuredTypeEmitter.cs
- TextInfo.cs
- MissingMemberException.cs
- TabletDeviceInfo.cs
- Attribute.cs
- ImageSource.cs
- DiscoveryClientOutputChannel.cs
- ControlBuilder.cs
- Table.cs
- columnmapkeybuilder.cs
- ConnectionInterfaceCollection.cs
- HMACSHA256.cs
- WindowsTokenRoleProvider.cs
- ParseHttpDate.cs
- DCSafeHandle.cs
- ParentUndoUnit.cs
- XmlDocumentViewSchema.cs
- DetailsView.cs
- FormViewPagerRow.cs
- DataGridRow.cs
- UIPermission.cs
- DataGridColumnCollection.cs
- UIElement.cs
- ProcessProtocolHandler.cs
- Menu.cs
- EqualityComparer.cs
- DataControlFieldsEditor.cs
- MailDefinition.cs
- TryExpression.cs