Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- WebPartActionVerb.cs
- ConnectionStringsSection.cs
- ItemCheckEvent.cs
- ThreadInterruptedException.cs
- XmlSchemaInferenceException.cs
- columnmapkeybuilder.cs
- OneToOneMappingSerializer.cs
- Handle.cs
- DataSourceHelper.cs
- TimelineGroup.cs
- StaticContext.cs
- FormViewModeEventArgs.cs
- PlatformNotSupportedException.cs
- Expressions.cs
- SecurityImpersonationBehavior.cs
- TreeViewEvent.cs
- CompilationAssemblyInstallComponent.cs
- ConfigXmlReader.cs
- XmlQueryStaticData.cs
- JsonReader.cs
- InvokeProviderWrapper.cs
- XmlIgnoreAttribute.cs
- KeyValuePairs.cs
- OracleConnectionString.cs
- Classification.cs
- FormViewDeleteEventArgs.cs
- OneOf.cs
- PropertyOverridesDialog.cs
- GatewayDefinition.cs
- StyleCollectionEditor.cs
- PeerOutputChannel.cs
- FilterRepeater.cs
- ArgumentException.cs
- CodeDirectiveCollection.cs
- KeyInterop.cs
- FloaterParaClient.cs
- RandomDelaySendsAsyncResult.cs
- PointValueSerializer.cs
- UpdateExpressionVisitor.cs
- DefaultObjectMappingItemCollection.cs
- ErrorActivity.cs
- DescendantOverDescendantQuery.cs
- DataSourceProvider.cs
- PointAnimation.cs
- PolyQuadraticBezierSegment.cs
- DateTimeParse.cs
- XmlText.cs
- BindingOperations.cs
- Internal.cs
- OdbcFactory.cs
- ChameleonKey.cs
- JournalEntryListConverter.cs
- OleDbPermission.cs
- xsdvalidator.cs
- DataTableReader.cs
- InputLanguage.cs
- QilSortKey.cs
- AddressAlreadyInUseException.cs
- NavigationHelper.cs
- KeyMatchBuilder.cs
- ContravarianceAdapter.cs
- XmlEncoding.cs
- SystemFonts.cs
- KeyValueConfigurationCollection.cs
- SharedPersonalizationStateInfo.cs
- ToolboxItemFilterAttribute.cs
- WrappedReader.cs
- PageThemeCodeDomTreeGenerator.cs
- OleDbRowUpdatingEvent.cs
- ImageUrlEditor.cs
- ACL.cs
- ScriptingAuthenticationServiceSection.cs
- CodeSnippetTypeMember.cs
- FunctionDescription.cs
- ApplicationSecurityManager.cs
- Persist.cs
- Collection.cs
- CorePropertiesFilter.cs
- Storyboard.cs
- SolidBrush.cs
- SafeSecurityHelper.cs
- KeyMatchBuilder.cs
- TextParagraphCache.cs
- Zone.cs
- TypographyProperties.cs
- ExpressionBindingCollection.cs
- WorkflowRuntime.cs
- PropertyMapper.cs
- FileDataSourceCache.cs
- ProfilePropertySettings.cs
- ListViewGroupItemCollection.cs
- WebHttpBindingCollectionElement.cs
- DesignerLinkAdapter.cs
- XmlDomTextWriter.cs
- WsdlInspector.cs
- HttpRequestTraceRecord.cs
- SHA256.cs
- DbMetaDataCollectionNames.cs
- SchemaNamespaceManager.cs
- odbcmetadatacollectionnames.cs