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
- Keyboard.cs
- DataGridViewEditingControlShowingEventArgs.cs
- WindowsTooltip.cs
- CodeLabeledStatement.cs
- WithStatement.cs
- WebPartCloseVerb.cs
- WebContext.cs
- _UriSyntax.cs
- SqlDataRecord.cs
- UndoManager.cs
- XmlnsDefinitionAttribute.cs
- OracleParameterBinding.cs
- X509IssuerSerialKeyIdentifierClause.cs
- SafeCryptoHandles.cs
- DataPagerField.cs
- XmlPreloadedResolver.cs
- ParseChildrenAsPropertiesAttribute.cs
- WebPartTransformerCollection.cs
- ContextStaticAttribute.cs
- WindowsScrollBarBits.cs
- WhitespaceRuleLookup.cs
- DynamicPropertyReader.cs
- DataPagerFieldItem.cs
- XamlSerializationHelper.cs
- MissingFieldException.cs
- WebPartDisplayModeCancelEventArgs.cs
- DocumentViewerConstants.cs
- HMACRIPEMD160.cs
- HttpModuleCollection.cs
- NativeWrapper.cs
- SolidColorBrush.cs
- KeyedCollection.cs
- BindValidator.cs
- UserControl.cs
- KeyManager.cs
- LeaseManager.cs
- AttributeSetAction.cs
- MailHeaderInfo.cs
- Rect3DValueSerializer.cs
- KeyValuePair.cs
- ChtmlCalendarAdapter.cs
- AddressHeader.cs
- ClientCultureInfo.cs
- XsltException.cs
- RootDesignerSerializerAttribute.cs
- AmbientLight.cs
- DynamicRenderer.cs
- Completion.cs
- Primitive.cs
- Rights.cs
- Ops.cs
- AccessDataSourceDesigner.cs
- DbConnectionStringCommon.cs
- RectValueSerializer.cs
- SecurityChannelFaultConverter.cs
- ProvideValueServiceProvider.cs
- XmlStringTable.cs
- ResourceDescriptionAttribute.cs
- IHttpResponseInternal.cs
- DBNull.cs
- ProfileManager.cs
- _NetRes.cs
- OrderedHashRepartitionEnumerator.cs
- Parameter.cs
- MLangCodePageEncoding.cs
- RangeEnumerable.cs
- PathFigureCollectionConverter.cs
- SerialPinChanges.cs
- Message.cs
- Invariant.cs
- DataKeyCollection.cs
- DrawingContextWalker.cs
- XmlDigitalSignatureProcessor.cs
- SchemaReference.cs
- EdmSchemaAttribute.cs
- HtmlToClrEventProxy.cs
- CacheVirtualItemsEvent.cs
- AutomationPropertyInfo.cs
- SiteIdentityPermission.cs
- TargetControlTypeAttribute.cs
- SafeNativeMethods.cs
- ObjectHelper.cs
- Point3DAnimation.cs
- TextView.cs
- RectConverter.cs
- keycontainerpermission.cs
- QilPatternFactory.cs
- SQLDoubleStorage.cs
- BlurBitmapEffect.cs
- HttpApplicationStateBase.cs
- DataGridLinkButton.cs
- HtmlDocument.cs
- SimpleApplicationHost.cs
- GlyphRun.cs
- PathTooLongException.cs
- WebServiceClientProxyGenerator.cs
- CatalogZoneBase.cs
- AppDomainGrammarProxy.cs
- _UriSyntax.cs
- LinqMaximalSubtreeNominator.cs