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
- TextTrailingWordEllipsis.cs
- SafeEventLogWriteHandle.cs
- StorageScalarPropertyMapping.cs
- JoinGraph.cs
- KeyValuePair.cs
- SystemResources.cs
- TraversalRequest.cs
- NamedPermissionSet.cs
- DbConnectionPoolIdentity.cs
- OpCellTreeNode.cs
- WindowsGraphics2.cs
- SecurityElement.cs
- Point3DCollectionConverter.cs
- ApplicationFileParser.cs
- FreezableCollection.cs
- SecurityUtils.cs
- RuntimeArgumentHandle.cs
- DBCommandBuilder.cs
- _RequestCacheProtocol.cs
- StdValidatorsAndConverters.cs
- PropertyPushdownHelper.cs
- UIElementParagraph.cs
- AttributeEmitter.cs
- AssemblyNameProxy.cs
- SettingsAttributes.cs
- PageContentCollection.cs
- PenThread.cs
- MemberMaps.cs
- SqlInternalConnection.cs
- ExpandCollapsePattern.cs
- RadioButtonBaseAdapter.cs
- Buffer.cs
- XmlSerializableReader.cs
- ToolStripSettings.cs
- ToggleButtonAutomationPeer.cs
- UserInitiatedRoutedEventPermission.cs
- WriteStateInfoBase.cs
- FigureParagraph.cs
- Guid.cs
- RepeaterItemEventArgs.cs
- IteratorDescriptor.cs
- MapPathBasedVirtualPathProvider.cs
- ContentHostHelper.cs
- InvalidDataContractException.cs
- ListViewPagedDataSource.cs
- StateChangeEvent.cs
- SafeSystemMetrics.cs
- UserControlParser.cs
- AdRotator.cs
- ConnectionDemuxer.cs
- Filter.cs
- PropertyRecord.cs
- ActionMessageFilter.cs
- SerializerProvider.cs
- DecimalMinMaxAggregationOperator.cs
- BufferBuilder.cs
- WebPartCatalogCloseVerb.cs
- TextTreeNode.cs
- ShortcutKeysEditor.cs
- VisualStyleTypesAndProperties.cs
- CompleteWizardStep.cs
- PKCS1MaskGenerationMethod.cs
- TreeNodeBindingCollection.cs
- MaskDesignerDialog.cs
- WebPartDescription.cs
- RemoveStoryboard.cs
- MultiTrigger.cs
- XmlTypeAttribute.cs
- InfoCardKeyedHashAlgorithm.cs
- CorruptingExceptionCommon.cs
- TriState.cs
- Int32Storage.cs
- SecurityKeyEntropyMode.cs
- FormViewModeEventArgs.cs
- XmlSchemaAppInfo.cs
- StandardToolWindows.cs
- GridViewDeleteEventArgs.cs
- WebPartHeaderCloseVerb.cs
- SiteMapDataSourceView.cs
- bindurihelper.cs
- IdnElement.cs
- HideDisabledControlAdapter.cs
- RightsManagementInformation.cs
- ConfigurationPropertyAttribute.cs
- DataPagerField.cs
- VolatileEnlistmentState.cs
- DataControlCommands.cs
- BamlRecordReader.cs
- Grant.cs
- StorageTypeMapping.cs
- AmbientLight.cs
- DockAndAnchorLayout.cs
- SystemParameters.cs
- ItemChangedEventArgs.cs
- milexports.cs
- IOException.cs
- StrokeNode.cs
- C14NUtil.cs
- SelectionManager.cs