Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / Serialization / IndentedWriter.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UnmanagedMemoryStream.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- IxmlLineInfo.cs
- TypeConstant.cs
- ProtocolElementCollection.cs
- _DisconnectOverlappedAsyncResult.cs
- ApplicationServiceManager.cs
- VirtualizedItemProviderWrapper.cs
- ExtensionSurface.cs
- UndirectedGraph.cs
- TimeSpanMinutesConverter.cs
- IgnoreDataMemberAttribute.cs
- Column.cs
- PolicyException.cs
- XmlSchemaAttribute.cs
- QueryInterceptorAttribute.cs
- MessageEnumerator.cs
- DesignerForm.cs
- SiteMembershipCondition.cs
- RichTextBoxConstants.cs
- ListControlDataBindingHandler.cs
- MetadataCache.cs
- InstancePersistenceCommandException.cs
- BoundsDrawingContextWalker.cs
- BuildProviderCollection.cs
- DataTableCollection.cs
- XmlUrlEditor.cs
- CallbackValidatorAttribute.cs
- ControlUtil.cs
- GAC.cs
- ComponentEvent.cs
- TextWriter.cs
- FieldTemplateUserControl.cs
- OLEDB_Util.cs
- TypeDescriptorContext.cs
- ReplyChannelBinder.cs
- PrinterResolution.cs
- UserControlBuildProvider.cs
- InputScopeAttribute.cs
- TypeResolver.cs
- StrokeNodeEnumerator.cs
- FlowDocumentReaderAutomationPeer.cs
- VariableQuery.cs
- SimpleWorkerRequest.cs
- Synchronization.cs
- GcSettings.cs
- IChannel.cs
- XamlGridLengthSerializer.cs
- DataSysAttribute.cs
- HelloMessage11.cs
- Menu.cs
- OleDbCommandBuilder.cs
- DoubleLinkListEnumerator.cs
- CompilerState.cs
- XmlSchemaComplexContent.cs
- Columns.cs
- AudienceUriMode.cs
- DropShadowEffect.cs
- ZipFileInfo.cs
- keycontainerpermission.cs
- Request.cs
- TaskScheduler.cs
- ExceptionCollection.cs
- RelatedCurrencyManager.cs
- Pen.cs
- ExtenderControl.cs
- NotSupportedException.cs
- PointCollection.cs
- DataSourceView.cs
- SqlProfileProvider.cs
- CheckBoxField.cs
- TextEncodedRawTextWriter.cs
- IdentitySection.cs
- RemotingServices.cs
- ComponentCollection.cs
- _KerberosClient.cs
- MessageDesigner.cs
- PerformanceCounter.cs
- VisualTreeFlattener.cs
- RuleSetReference.cs
- ArglessEventHandlerProxy.cs
- DesignerAdapterUtil.cs
- MailMessageEventArgs.cs
- AnimationClockResource.cs
- ListViewItem.cs
- TreeBuilder.cs
- TreeNodeConverter.cs
- ToolStripDropDown.cs
- Ref.cs
- DistributedTransactionPermission.cs
- MessagePartDescriptionCollection.cs
- ProvidersHelper.cs
- DictionarySectionHandler.cs
- SafeNativeMethods.cs
- SqlRecordBuffer.cs
- CssStyleCollection.cs
- RoleService.cs
- SendingRequestEventArgs.cs
- CriticalFinalizerObject.cs
- SqlDataAdapter.cs