Code:
/ DotNET / DotNET / 8.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
- MimeTypeMapper.cs
- Command.cs
- GradientBrush.cs
- PageContentCollection.cs
- ModelTypeConverter.cs
- ButtonBase.cs
- CodeAccessPermission.cs
- Hex.cs
- ListViewDeleteEventArgs.cs
- DeploymentSection.cs
- GenericNameHandler.cs
- mil_sdk_version.cs
- ChangePasswordAutoFormat.cs
- MasterPageCodeDomTreeGenerator.cs
- UIElementParaClient.cs
- Hashtable.cs
- TextEditorSpelling.cs
- PropertyChangedEventManager.cs
- DataGridViewTextBoxEditingControl.cs
- TogglePatternIdentifiers.cs
- TaskExtensions.cs
- SpecularMaterial.cs
- ProcessManager.cs
- arclist.cs
- InProcStateClientManager.cs
- SqlStatistics.cs
- Int32CAMarshaler.cs
- regiisutil.cs
- GeometryHitTestResult.cs
- ListItemConverter.cs
- DashStyles.cs
- ExcludeFromCodeCoverageAttribute.cs
- IPipelineRuntime.cs
- ValueUnavailableException.cs
- FormCollection.cs
- CornerRadiusConverter.cs
- ImmutableAssemblyCacheEntry.cs
- AdPostCacheSubstitution.cs
- GroupBoxRenderer.cs
- Attributes.cs
- EncryptedReference.cs
- IdentifierCollection.cs
- ObjectSet.cs
- WebPartMenu.cs
- WebPartCatalogCloseVerb.cs
- SQLInt32.cs
- ArgIterator.cs
- DataTableNewRowEvent.cs
- ReplacementText.cs
- FieldBuilder.cs
- ServiceOperation.cs
- TreeNodeStyleCollection.cs
- AudioLevelUpdatedEventArgs.cs
- SQLInt32.cs
- OperatorExpressions.cs
- Label.cs
- DbConnectionHelper.cs
- DetailsViewUpdateEventArgs.cs
- WebPartUserCapability.cs
- StringUtil.cs
- DescendentsWalkerBase.cs
- SettingsBindableAttribute.cs
- XamlReaderHelper.cs
- WebServiceResponseDesigner.cs
- ControlParameter.cs
- PhysicalAddress.cs
- InvalidFilterCriteriaException.cs
- CharEnumerator.cs
- NamedPipeChannelFactory.cs
- Int64Animation.cs
- PathFigureCollectionConverter.cs
- XmlSecureResolver.cs
- CodeMemberField.cs
- TypedAsyncResult.cs
- base64Transforms.cs
- WebPartTracker.cs
- ButtonBase.cs
- SettingsPropertyIsReadOnlyException.cs
- BindingMAnagerBase.cs
- SHA1CryptoServiceProvider.cs
- PeerTransportSecuritySettings.cs
- ControlParser.cs
- ArgumentOutOfRangeException.cs
- FrameworkObject.cs
- CodeExporter.cs
- ChangePassword.cs
- UserControl.cs
- DataControlFieldHeaderCell.cs
- TreeViewItem.cs
- XmlMapping.cs
- ReadOnlyPropertyMetadata.cs
- FrameSecurityDescriptor.cs
- SqlUDTStorage.cs
- PersistChildrenAttribute.cs
- HttpsTransportElement.cs
- DataGridPagerStyle.cs
- LineInfo.cs
- UserControlBuildProvider.cs
- ProcessThreadCollection.cs
- ControlCollection.cs