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
- SimpleType.cs
- SmtpAuthenticationManager.cs
- HtmlContainerControl.cs
- GenericEnumerator.cs
- LoginCancelEventArgs.cs
- BrushMappingModeValidation.cs
- KnownColorTable.cs
- BlockCollection.cs
- ComponentDispatcher.cs
- X509SecurityTokenProvider.cs
- SqlDuplicator.cs
- ParseHttpDate.cs
- SqlNode.cs
- OrderedEnumerableRowCollection.cs
- RemoteWebConfigurationHost.cs
- CodeTypeDeclaration.cs
- SignedInfo.cs
- TrackingServices.cs
- ChtmlImageAdapter.cs
- GridLength.cs
- IdentityHolder.cs
- XsdValidatingReader.cs
- Literal.cs
- returneventsaver.cs
- DoubleIndependentAnimationStorage.cs
- ProfessionalColors.cs
- SimpleTextLine.cs
- StickyNoteContentControl.cs
- AttributeCallbackBuilder.cs
- SequentialUshortCollection.cs
- TextDecorationLocationValidation.cs
- CachedResourceDictionaryExtension.cs
- ClassData.cs
- ToolStripContentPanelRenderEventArgs.cs
- UpdateExpressionVisitor.cs
- ColorConverter.cs
- HttpListenerElement.cs
- TextEditorContextMenu.cs
- AccessDataSource.cs
- PointLightBase.cs
- ControlType.cs
- BinaryObjectWriter.cs
- EpmSourceTree.cs
- RoleService.cs
- SplineQuaternionKeyFrame.cs
- MailWebEventProvider.cs
- CompilerTypeWithParams.cs
- Inflater.cs
- HMACSHA512.cs
- WindowsIdentity.cs
- ExpressionPrefixAttribute.cs
- CompilerState.cs
- XmlILConstructAnalyzer.cs
- PackageRelationshipSelector.cs
- DesignTimeValidationFeature.cs
- PathFigureCollectionValueSerializer.cs
- WebPartTransformerCollection.cs
- GenericPrincipal.cs
- WebPartZoneBase.cs
- Image.cs
- ServiceModelSecurityTokenTypes.cs
- ProtectedUri.cs
- EntityDataSourceSelectingEventArgs.cs
- TaskForm.cs
- UIElement3D.cs
- DocumentOrderQuery.cs
- FontUnit.cs
- OleCmdHelper.cs
- dataobject.cs
- TextProviderWrapper.cs
- ComponentCache.cs
- HttpFileCollectionBase.cs
- WSSecurityTokenSerializer.cs
- ACE.cs
- Bezier.cs
- OnOperation.cs
- TraceHandlerErrorFormatter.cs
- FixedStringLookup.cs
- PersonalizableTypeEntry.cs
- QilUnary.cs
- ReaderWriterLock.cs
- XmlSchemaSimpleTypeList.cs
- EncoderExceptionFallback.cs
- ToolStripPanelDesigner.cs
- ClientCultureInfo.cs
- GetParentChain.cs
- InvalidDataException.cs
- SqlAggregateChecker.cs
- SerializationEventsCache.cs
- StatusBarDrawItemEvent.cs
- SqlConnectionFactory.cs
- XmlArrayAttribute.cs
- arabicshape.cs
- ZoneLinkButton.cs
- ColumnMapProcessor.cs
- SearchForVirtualItemEventArgs.cs
- CleanUpVirtualizedItemEventArgs.cs
- ReadOnlyDictionary.cs
- PointAnimationBase.cs
- Trace.cs