Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- WebBrowserBase.cs
- OdbcInfoMessageEvent.cs
- ServiceDesigner.xaml.cs
- ISAPIWorkerRequest.cs
- GeneralTransformCollection.cs
- StorageEndPropertyMapping.cs
- Peer.cs
- PowerModeChangedEventArgs.cs
- sqlnorm.cs
- SafeFileHandle.cs
- WhitespaceSignificantCollectionAttribute.cs
- JsonFormatGeneratorStatics.cs
- validation.cs
- SettingsBase.cs
- DropShadowEffect.cs
- ModelUIElement3D.cs
- DiscardableAttribute.cs
- DataGridViewUtilities.cs
- DbProviderFactoriesConfigurationHandler.cs
- BuildManagerHost.cs
- WebScriptMetadataMessageEncoderFactory.cs
- IisNotInstalledException.cs
- VectorValueSerializer.cs
- PropertyMap.cs
- SiteMapHierarchicalDataSourceView.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- XmlSchemaSimpleTypeRestriction.cs
- HotCommands.cs
- SchemaNames.cs
- PackagePart.cs
- CompiledQuery.cs
- SqlDataAdapter.cs
- WindowsButton.cs
- Point3DCollectionValueSerializer.cs
- WebPartMinimizeVerb.cs
- DocumentSequenceHighlightLayer.cs
- CodeMethodReturnStatement.cs
- ContextMarshalException.cs
- Line.cs
- TableLayoutSettingsTypeConverter.cs
- MemberHolder.cs
- TableRowCollection.cs
- MultipleViewProviderWrapper.cs
- GAC.cs
- TypeElement.cs
- EntityDesignerUtils.cs
- FunctionMappingTranslator.cs
- GridViewRowPresenterBase.cs
- FilePrompt.cs
- MemberCollection.cs
- Walker.cs
- HwndSourceParameters.cs
- DataSourceCache.cs
- XmlSchemaValidator.cs
- XamlStackWriter.cs
- TypeConverterAttribute.cs
- RelatedImageListAttribute.cs
- ColorAnimation.cs
- Vector3DValueSerializer.cs
- DelegateArgument.cs
- DataGrid.cs
- AutoGeneratedField.cs
- Propagator.ExtentPlaceholderCreator.cs
- Message.cs
- SafeCloseHandleCritical.cs
- InstanceDescriptor.cs
- AnimatedTypeHelpers.cs
- SQLDouble.cs
- MainMenu.cs
- SequentialOutput.cs
- KnowledgeBase.cs
- UTF7Encoding.cs
- FormsAuthenticationUserCollection.cs
- EntityCommandDefinition.cs
- FormattedTextSymbols.cs
- GrammarBuilderBase.cs
- EmptyReadOnlyDictionaryInternal.cs
- SmiMetaDataProperty.cs
- DictionaryBase.cs
- BitmapEffectGroup.cs
- Property.cs
- WindowsScrollBarBits.cs
- SchemaElementDecl.cs
- SelectionPattern.cs
- Logging.cs
- ConnectionStringsExpressionBuilder.cs
- LicenseException.cs
- Win32.cs
- AttributeQuery.cs
- GPRECTF.cs
- ServiceNameElementCollection.cs
- XPathQueryGenerator.cs
- DocumentGridContextMenu.cs
- BitmapEffectInput.cs
- OverflowException.cs
- PropertyItemInternal.cs
- DataSourceControl.cs
- SelectionProcessor.cs
- GridProviderWrapper.cs
- XmlFormatReaderGenerator.cs