Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Sql8ExpressionRewriter.cs
- IIS7WorkerRequest.cs
- ButtonDesigner.cs
- DragCompletedEventArgs.cs
- ReadOnlyNameValueCollection.cs
- CustomCategoryAttribute.cs
- GridLength.cs
- EntityCommandCompilationException.cs
- SourceChangedEventArgs.cs
- MappableObjectManager.cs
- TraceListeners.cs
- _AutoWebProxyScriptHelper.cs
- CurrentChangedEventManager.cs
- HttpCapabilitiesSectionHandler.cs
- Normalizer.cs
- RefExpr.cs
- CssTextWriter.cs
- ScaleTransform.cs
- DesignTimeVisibleAttribute.cs
- AvTraceDetails.cs
- CodeTypeMember.cs
- Crypto.cs
- ClaimComparer.cs
- lengthconverter.cs
- DbConnectionPool.cs
- StateItem.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- SiteMap.cs
- DiscoveryEndpoint.cs
- OracleCommandBuilder.cs
- HealthMonitoringSection.cs
- Form.cs
- GridItemPattern.cs
- DependencyPropertyHelper.cs
- TableLayoutPanelDesigner.cs
- AxisAngleRotation3D.cs
- XmlMembersMapping.cs
- Vector3DAnimation.cs
- OrderedEnumerableRowCollection.cs
- StyleHelper.cs
- DataRowView.cs
- XamlTreeBuilder.cs
- Italic.cs
- MenuItem.cs
- SspiSecurityTokenProvider.cs
- TreeViewItem.cs
- PanningMessageFilter.cs
- FindCriteria.cs
- PartialTrustVisibleAssembly.cs
- MenuBindingsEditorForm.cs
- InstanceKeyCompleteException.cs
- XmlQueryRuntime.cs
- TextControl.cs
- VisualBrush.cs
- AspProxy.cs
- C14NUtil.cs
- CustomWebEventKey.cs
- ExpressionBuilderContext.cs
- UpdateTracker.cs
- basemetadatamappingvisitor.cs
- ControlPaint.cs
- ProfilePropertySettingsCollection.cs
- HandleRef.cs
- GetPageNumberCompletedEventArgs.cs
- SamlAuthenticationClaimResource.cs
- WebPart.cs
- BaseDataList.cs
- IUnknownConstantAttribute.cs
- QueryIntervalOp.cs
- ProcessInfo.cs
- CurrentChangingEventArgs.cs
- ImageList.cs
- EntityRecordInfo.cs
- SqlDataSourceSelectingEventArgs.cs
- XamlToRtfWriter.cs
- SByteStorage.cs
- MemoryRecordBuffer.cs
- EditorPartChrome.cs
- EventPropertyMap.cs
- TypeUtil.cs
- IndentedTextWriter.cs
- AttachedAnnotation.cs
- PointHitTestParameters.cs
- HandleCollector.cs
- DescendentsWalkerBase.cs
- X509IssuerSerialKeyIdentifierClause.cs
- ScopelessEnumAttribute.cs
- TextEditorSpelling.cs
- FullTextState.cs
- FilterableData.cs
- BamlLocalizer.cs
- CodeValidator.cs
- BindingContext.cs
- GetTokenRequest.cs
- FullTextLine.cs
- GridViewSortEventArgs.cs
- SqlDataSourceCache.cs
- RequiredArgumentAttribute.cs
- SqlCacheDependency.cs
- MetafileHeader.cs