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
- Tool.cs
- BufferModesCollection.cs
- DocumentXmlWriter.cs
- JavaScriptSerializer.cs
- WebDisplayNameAttribute.cs
- ReadOnlyNameValueCollection.cs
- FileDetails.cs
- CaseKeyBox.ViewModel.cs
- GridViewCancelEditEventArgs.cs
- DatagridviewDisplayedBandsData.cs
- BamlRecordWriter.cs
- AnimationException.cs
- XmlUrlResolver.cs
- DataBinding.cs
- DateTimeSerializationSection.cs
- LogAppendAsyncResult.cs
- ComplexTypeEmitter.cs
- IntSecurity.cs
- SiteMapNodeItemEventArgs.cs
- _SslSessionsCache.cs
- UIElement3DAutomationPeer.cs
- autovalidator.cs
- ModelTreeEnumerator.cs
- DataListCommandEventArgs.cs
- HtmlProps.cs
- SecurityManager.cs
- TemplateControlBuildProvider.cs
- CommandBinding.cs
- Simplifier.cs
- util.cs
- Rotation3D.cs
- AddingNewEventArgs.cs
- SoapUnknownHeader.cs
- ViewBase.cs
- ScaleTransform3D.cs
- Opcode.cs
- NgenServicingAttributes.cs
- RoutedCommand.cs
- DataContractFormatAttribute.cs
- TextUtf8RawTextWriter.cs
- ValueProviderWrapper.cs
- MimeTypeAttribute.cs
- ObjectItemConventionAssemblyLoader.cs
- Baml2006SchemaContext.cs
- SqlCacheDependency.cs
- CompatibleIComparer.cs
- BitmapEffectRenderDataResource.cs
- ComplusEndpointConfigContainer.cs
- CultureInfoConverter.cs
- PageRequestManager.cs
- XNodeValidator.cs
- EUCJPEncoding.cs
- XMLSchema.cs
- SeparatorAutomationPeer.cs
- ServiceOperationParameter.cs
- SystemNetHelpers.cs
- TransformerConfigurationWizardBase.cs
- HtmlEmptyTagControlBuilder.cs
- ManagedIStream.cs
- MessageSmuggler.cs
- HotSpotCollection.cs
- DataBinding.cs
- ThreadAttributes.cs
- XmlWellformedWriter.cs
- TaskFormBase.cs
- DetailsViewModeEventArgs.cs
- Interop.cs
- DynamicControl.cs
- TypeLoadException.cs
- TreeNodeStyleCollection.cs
- ContentIterators.cs
- XsltLoader.cs
- PlatformCulture.cs
- ScriptRegistrationManager.cs
- SmtpAuthenticationManager.cs
- DynamicRouteExpression.cs
- RelationshipEndMember.cs
- FileSystemEventArgs.cs
- ImageSourceValueSerializer.cs
- Faults.cs
- MobileListItemCollection.cs
- StatementContext.cs
- EntityStoreSchemaFilterEntry.cs
- ConvertTextFrag.cs
- NavigationProgressEventArgs.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- HttpCacheVaryByContentEncodings.cs
- XmlExpressionDumper.cs
- XmlText.cs
- PolyLineSegment.cs
- SystemIPInterfaceProperties.cs
- SerializationException.cs
- AttachedPropertyBrowsableAttribute.cs
- WebControlsSection.cs
- DataServiceStreamResponse.cs
- FixedPosition.cs
- UIntPtr.cs
- WizardPanelChangingEventArgs.cs
- PropertyGrid.cs
- UncommonField.cs