Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- EnumerationRangeValidationUtil.cs
- BookmarkScopeManager.cs
- ExpandCollapsePattern.cs
- ImportDesigner.xaml.cs
- DataGridViewAutoSizeModeEventArgs.cs
- SessionStateModule.cs
- DataBindingList.cs
- OleDbConnectionInternal.cs
- Resources.Designer.cs
- DataGridTextBoxColumn.cs
- CapabilitiesPattern.cs
- RegexCompiler.cs
- IsolatedStorageFilePermission.cs
- CurrentChangingEventManager.cs
- AttributeData.cs
- XmlMemberMapping.cs
- WebPartManagerDesigner.cs
- CqlParser.cs
- ElementUtil.cs
- RegexCapture.cs
- PersonalizationProvider.cs
- SamlSecurityTokenAuthenticator.cs
- FixedSOMPage.cs
- TimeSpanValidator.cs
- XmlStreamedByteStreamReader.cs
- Image.cs
- EventEntry.cs
- TableSectionStyle.cs
- BCLDebug.cs
- IFlowDocumentViewer.cs
- RowVisual.cs
- WebPartConnectionCollection.cs
- X509Utils.cs
- ColorInterpolationModeValidation.cs
- SessionEndingEventArgs.cs
- SpinLock.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- ProtocolsConfigurationEntry.cs
- DataKey.cs
- BulletDecorator.cs
- WebPartConnectionsConnectVerb.cs
- RightsManagementProvider.cs
- CultureInfoConverter.cs
- OdbcEnvironment.cs
- QueryNode.cs
- DataTableTypeConverter.cs
- RunInstallerAttribute.cs
- ListView.cs
- BackStopAuthenticationModule.cs
- FocusChangedEventArgs.cs
- GridViewEditEventArgs.cs
- RtfNavigator.cs
- ContentIterators.cs
- HttpListenerException.cs
- SamlAuthorizationDecisionStatement.cs
- Style.cs
- TransformValueSerializer.cs
- PlatformCulture.cs
- WebDisplayNameAttribute.cs
- UIElement3D.cs
- handlecollector.cs
- Speller.cs
- PrimaryKeyTypeConverter.cs
- PropertyDescriptor.cs
- TrackingProfileSerializer.cs
- ItemCollection.cs
- MouseCaptureWithinProperty.cs
- XmlDownloadManager.cs
- HMACSHA384.cs
- CollectionConverter.cs
- ManagedFilter.cs
- DataGridViewColumnCollection.cs
- XPathDocumentNavigator.cs
- ResourceManagerWrapper.cs
- TdsEnums.cs
- TransactionOptions.cs
- GeometryHitTestResult.cs
- DataServiceBehavior.cs
- AttributeUsageAttribute.cs
- RadioButtonRenderer.cs
- Size3D.cs
- SettingsContext.cs
- ToolStrip.cs
- ActionItem.cs
- TransformerInfo.cs
- HotCommands.cs
- BitmapMetadataBlob.cs
- TableStyle.cs
- SqlAggregateChecker.cs
- mactripleDES.cs
- AuthenticationModuleElement.cs
- HMACSHA384.cs
- RightsManagementInformation.cs
- RelationalExpressions.cs
- ElasticEase.cs
- MatrixValueSerializer.cs
- PropertiesTab.cs
- DBCSCodePageEncoding.cs
- EndpointDiscoveryMetadataCD1.cs
- WriteableBitmap.cs