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
- CodeMemberMethod.cs
- DbProviderServices.cs
- SchemaDeclBase.cs
- Transform3DGroup.cs
- HtmlImage.cs
- TypeUtil.cs
- ListViewSelectEventArgs.cs
- InternalBufferOverflowException.cs
- XamlSerializer.cs
- StorageConditionPropertyMapping.cs
- EntryPointNotFoundException.cs
- CallTemplateAction.cs
- Axis.cs
- TextAction.cs
- WindowsToolbar.cs
- WindowsImpersonationContext.cs
- Attributes.cs
- ComponentSerializationService.cs
- WorkflowTraceTransfer.cs
- XmlSerializerSection.cs
- XsdCachingReader.cs
- PersonalizableAttribute.cs
- CleanUpVirtualizedItemEventArgs.cs
- SecurityVerifiedMessage.cs
- HtmlShimManager.cs
- Filter.cs
- ColorBlend.cs
- JsonEnumDataContract.cs
- GB18030Encoding.cs
- XmlReflectionImporter.cs
- BypassElement.cs
- PrinterSettings.cs
- PackagingUtilities.cs
- AnchoredBlock.cs
- Sql8ExpressionRewriter.cs
- DispatcherHooks.cs
- XmlValueConverter.cs
- IISMapPath.cs
- MetadataCache.cs
- CodeAttributeDeclaration.cs
- IisTraceWebEventProvider.cs
- IItemContainerGenerator.cs
- ControlCollection.cs
- ChildDocumentBlock.cs
- PathSegmentCollection.cs
- Section.cs
- ZipIOLocalFileDataDescriptor.cs
- AdPostCacheSubstitution.cs
- CalendarDataBindingHandler.cs
- AnnotationResource.cs
- KeyBinding.cs
- WebPartMovingEventArgs.cs
- RequestBringIntoViewEventArgs.cs
- TrackingMemoryStreamFactory.cs
- Gdiplus.cs
- DesignerLoader.cs
- FieldAccessException.cs
- WebReferencesBuildProvider.cs
- PointLight.cs
- SoapEnumAttribute.cs
- ClearTypeHintValidation.cs
- TabControlToolboxItem.cs
- PolicyManager.cs
- SHA256.cs
- DeferredTextReference.cs
- TraceHandlerErrorFormatter.cs
- RotateTransform.cs
- EventWaitHandle.cs
- ToolStripItemCollection.cs
- FeatureManager.cs
- XmlObjectSerializerContext.cs
- ObjectListComponentEditor.cs
- AuthenticateEventArgs.cs
- ListView.cs
- TraceContext.cs
- XmlNullResolver.cs
- wpf-etw.cs
- UniqueIdentifierService.cs
- CellParaClient.cs
- mactripleDES.cs
- TrackingServices.cs
- CompilerScope.cs
- ValidateNames.cs
- Size3D.cs
- ProfilePropertyNameValidator.cs
- ErrorInfoXmlDocument.cs
- NetPeerTcpBindingCollectionElement.cs
- BamlVersionHeader.cs
- Deflater.cs
- DbUpdateCommandTree.cs
- FormParameter.cs
- FunctionQuery.cs
- ClassicBorderDecorator.cs
- NumberSubstitution.cs
- ConnectionsZone.cs
- PermissionSetTriple.cs
- MultiTouchSystemGestureLogic.cs
- SizeChangedEventArgs.cs
- Stack.cs
- ButtonBase.cs