Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // //[....] //----------------------------------------------------------------------------- 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
- VBIdentifierNameEditor.cs
- WmlLiteralTextAdapter.cs
- CompilerInfo.cs
- SiteMapHierarchicalDataSourceView.cs
- ParentQuery.cs
- ApplicationProxyInternal.cs
- Int32AnimationBase.cs
- XmlnsCache.cs
- TreeNodeCollection.cs
- ContractReference.cs
- nulltextcontainer.cs
- CapabilitiesPattern.cs
- TopClause.cs
- ComContractElement.cs
- CatalogZoneBase.cs
- DataContractJsonSerializer.cs
- OleCmdHelper.cs
- ByteStreamMessageEncoderFactory.cs
- ZipIOExtraFieldElement.cs
- AssociationTypeEmitter.cs
- Cursor.cs
- ContentPosition.cs
- invalidudtexception.cs
- Scene3D.cs
- validation.cs
- NativeMethods.cs
- Point4D.cs
- ExtendedPropertyCollection.cs
- OleDbParameter.cs
- XmlSchemaGroupRef.cs
- QuotedPrintableStream.cs
- PrintPageEvent.cs
- Soap12ProtocolReflector.cs
- DateTimeValueSerializer.cs
- Matrix3D.cs
- SecurityPolicySection.cs
- OptionUsage.cs
- EntityContainerEmitter.cs
- ZipIOLocalFileDataDescriptor.cs
- SqlCacheDependency.cs
- SymmetricAlgorithm.cs
- ApplySecurityAndSendAsyncResult.cs
- Ops.cs
- IdentityNotMappedException.cs
- UidPropertyAttribute.cs
- ObjectConverter.cs
- RSAOAEPKeyExchangeDeformatter.cs
- XmlSerializerFactory.cs
- ParameterCollection.cs
- BinaryWriter.cs
- DesignerCatalogPartChrome.cs
- OrderByBuilder.cs
- SqlCharStream.cs
- XMLUtil.cs
- RTLAwareMessageBox.cs
- ActivityCodeDomSerializer.cs
- PolicyStatement.cs
- RegexCompiler.cs
- WindowsBrush.cs
- GridViewColumnHeader.cs
- TextTreeUndoUnit.cs
- Converter.cs
- SchemeSettingElement.cs
- ScriptingProfileServiceSection.cs
- IsolatedStorageFilePermission.cs
- ForwardPositionQuery.cs
- GridViewCommandEventArgs.cs
- Visual.cs
- Constants.cs
- ChangesetResponse.cs
- COM2ComponentEditor.cs
- ListViewInsertEventArgs.cs
- XsltQilFactory.cs
- DataKeyCollection.cs
- ExtensionWindowHeader.cs
- LicenseContext.cs
- SafeNativeMethods.cs
- TransportDefaults.cs
- OleDbFactory.cs
- GridItemPattern.cs
- TaskbarItemInfo.cs
- UnsafeNativeMethods.cs
- wmiprovider.cs
- GPRECTF.cs
- CuspData.cs
- MediaPlayerState.cs
- GlyphTypeface.cs
- DrawingCollection.cs
- Rule.cs
- ClientTargetSection.cs
- UriScheme.cs
- SerializationSectionGroup.cs
- FixedSOMPage.cs
- ReflectionHelper.cs
- SetIndexBinder.cs
- CheckBoxBaseAdapter.cs
- XmlCollation.cs
- NameNode.cs
- WebHttpBehavior.cs
- LabelDesigner.cs