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
- RenderingEventArgs.cs
- RuleValidation.cs
- ChannelCacheSettings.cs
- BatchServiceHost.cs
- DataGridPagerStyle.cs
- Types.cs
- Adorner.cs
- LineSegment.cs
- EntitySetBase.cs
- basevalidator.cs
- HtmlButton.cs
- ChangePassword.cs
- BinaryUtilClasses.cs
- RedirectionProxy.cs
- IssuedTokenParametersEndpointAddressElement.cs
- WFItemsToSpacerVisibility.cs
- ADRoleFactoryConfiguration.cs
- PreservationFileReader.cs
- loginstatus.cs
- DataSourceSelectArguments.cs
- DoubleAnimationUsingPath.cs
- XmlProcessingInstruction.cs
- EntityDataReader.cs
- FixedTextSelectionProcessor.cs
- StringExpressionSet.cs
- HandlerElementCollection.cs
- figurelength.cs
- EnumBuilder.cs
- DataFormats.cs
- DataViewManager.cs
- Root.cs
- HTMLTagNameToTypeMapper.cs
- CaseInsensitiveOrdinalStringComparer.cs
- SqlCommandBuilder.cs
- Parser.cs
- ByteAnimationBase.cs
- DbCommandDefinition.cs
- ProcessStartInfo.cs
- ScaleTransform.cs
- PersonalizableTypeEntry.cs
- SizeAnimationUsingKeyFrames.cs
- BindingExpressionUncommonField.cs
- SparseMemoryStream.cs
- ModifierKeysConverter.cs
- XsdSchemaFileEditor.cs
- WeakEventTable.cs
- GridEntryCollection.cs
- FullTextLine.cs
- objectresult_tresulttype.cs
- AutomationElementIdentifiers.cs
- BitStack.cs
- KnownIds.cs
- milexports.cs
- DataTableNewRowEvent.cs
- FileDialogPermission.cs
- ConsoleKeyInfo.cs
- Panel.cs
- X509ClientCertificateAuthentication.cs
- RectangleConverter.cs
- DesignerDataTableBase.cs
- BaseProcessor.cs
- ListChangedEventArgs.cs
- JoinSymbol.cs
- TemplateManager.cs
- Table.cs
- Propagator.cs
- SymmetricKey.cs
- NavigatorOutput.cs
- FtpCachePolicyElement.cs
- SourceItem.cs
- XMLSchema.cs
- WebControl.cs
- RawStylusInputCustomDataList.cs
- BmpBitmapEncoder.cs
- PartialCachingAttribute.cs
- AndCondition.cs
- SHA256CryptoServiceProvider.cs
- XmlQueryCardinality.cs
- IsolatedStorageFilePermission.cs
- FixedHighlight.cs
- ControlTemplate.cs
- SecurityStandardsManager.cs
- x509store.cs
- AttributeData.cs
- XmlCharType.cs
- TrackingExtract.cs
- GradientStop.cs
- Module.cs
- ReadWriteObjectLock.cs
- MediaElementAutomationPeer.cs
- SpeechSeg.cs
- BitmapEffectDrawing.cs
- EventSinkActivity.cs
- XLinq.cs
- EventDescriptor.cs
- CompModSwitches.cs
- EdmScalarPropertyAttribute.cs
- DockPattern.cs
- IndicShape.cs
- LockedBorderGlyph.cs