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
- ChannelManager.cs
- DataGridViewCheckBoxColumn.cs
- MemoryRecordBuffer.cs
- EntityParameterCollection.cs
- TagPrefixAttribute.cs
- CompilerLocalReference.cs
- MatrixKeyFrameCollection.cs
- XmlValueConverter.cs
- OutputCacheProfile.cs
- WinFormsSecurity.cs
- SiteMapPathDesigner.cs
- IndentedWriter.cs
- DataColumnSelectionConverter.cs
- QueryOperatorEnumerator.cs
- CollectionViewGroup.cs
- Matrix.cs
- VirtualDirectoryMapping.cs
- TextCharacters.cs
- CombinedGeometry.cs
- ProcessHostConfigUtils.cs
- ArgumentOutOfRangeException.cs
- BackgroundWorker.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- MessageQueueAccessControlEntry.cs
- OutputScopeManager.cs
- AssemblyCollection.cs
- Renderer.cs
- TransformFinalBlockRequest.cs
- GridViewRowPresenterBase.cs
- ImageButton.cs
- HashAlgorithm.cs
- LinearKeyFrames.cs
- ConnectionPoolManager.cs
- UnsafeNativeMethods.cs
- TextHintingModeValidation.cs
- ErrorsHelper.cs
- ReplacementText.cs
- AlgoModule.cs
- TreeNode.cs
- IChannel.cs
- BrowsableAttribute.cs
- NativeMethods.cs
- MatrixStack.cs
- StringValidator.cs
- EventDescriptor.cs
- InheritanceAttribute.cs
- BlurEffect.cs
- ZoneIdentityPermission.cs
- TextBox.cs
- ValueTypeFixupInfo.cs
- PersonalizableTypeEntry.cs
- TrustSection.cs
- NetworkInformationException.cs
- Matrix.cs
- EditingCommands.cs
- controlskin.cs
- ImageFormatConverter.cs
- SqlInfoMessageEvent.cs
- webbrowsersite.cs
- ExtenderProvidedPropertyAttribute.cs
- MatrixIndependentAnimationStorage.cs
- Matrix.cs
- QilLoop.cs
- SymmetricKeyWrap.cs
- HandlerBase.cs
- ConstNode.cs
- UrlPath.cs
- Error.cs
- KeyPullup.cs
- AmbiguousMatchException.cs
- MessagePropertyDescription.cs
- OdbcCommandBuilder.cs
- ConversionHelper.cs
- ContainerSelectorBehavior.cs
- DesignerActionPropertyItem.cs
- ContainerVisual.cs
- SQLChars.cs
- Subtree.cs
- SafeSerializationManager.cs
- SaveWorkflowCommand.cs
- LambdaCompiler.Generated.cs
- ExpressionEditorSheet.cs
- Listener.cs
- ToolStripOverflowButton.cs
- DataGridViewMethods.cs
- MouseGestureValueSerializer.cs
- UInt32Storage.cs
- CallbackHandler.cs
- NavigationPropertySingletonExpression.cs
- StatusBar.cs
- TokenCreationParameter.cs
- TypeToStringValueConverter.cs
- BindableTemplateBuilder.cs
- WebPageTraceListener.cs
- CodeCompiler.cs
- Attributes.cs
- httpstaticobjectscollection.cs
- _ShellExpression.cs
- TextChangedEventArgs.cs
- PackUriHelper.cs