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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DbExpressionVisitor.cs
- NoClickablePointException.cs
- NativeWindow.cs
- InvokeHandlers.cs
- ThemeableAttribute.cs
- Form.cs
- FlowStep.cs
- ObjectQueryState.cs
- HtmlElementCollection.cs
- ResourceDescriptionAttribute.cs
- FontStretches.cs
- TransferRequestHandler.cs
- ShapeTypeface.cs
- Certificate.cs
- DrawingBrush.cs
- CFGGrammar.cs
- ApplyImportsAction.cs
- WebPartsPersonalizationAuthorization.cs
- RowSpanVector.cs
- XmlSchemaAnyAttribute.cs
- OpenFileDialog.cs
- ArrowControl.xaml.cs
- WinFormsSpinner.cs
- PocoPropertyAccessorStrategy.cs
- ShaperBuffers.cs
- BindToObject.cs
- PolygonHotSpot.cs
- BinaryObjectWriter.cs
- PointAnimationUsingPath.cs
- OperationParameterInfo.cs
- SoapMessage.cs
- XPathScanner.cs
- ValidatingReaderNodeData.cs
- DataContractAttribute.cs
- EpmSyndicationContentSerializer.cs
- SafeBitVector32.cs
- MessageHeaderDescription.cs
- BrowserCapabilitiesCodeGenerator.cs
- RemoteWebConfigurationHostStream.cs
- wgx_sdk_version.cs
- PlanCompilerUtil.cs
- TableDetailsRow.cs
- PropertyRef.cs
- WebExceptionStatus.cs
- TextShapeableCharacters.cs
- ListViewCommandEventArgs.cs
- BufferedGraphicsManager.cs
- SqlDelegatedTransaction.cs
- WindowsListViewItemCheckBox.cs
- BufferedGraphicsManager.cs
- CorruptingExceptionCommon.cs
- MenuItemStyleCollection.cs
- SqlStatistics.cs
- MenuItemCollection.cs
- ListViewInsertionMark.cs
- ResourcePool.cs
- WebPartMenuStyle.cs
- ServiceDefaults.cs
- XmlEntity.cs
- FacetEnabledSchemaElement.cs
- HttpBrowserCapabilitiesWrapper.cs
- wmiprovider.cs
- TextElementEnumerator.cs
- ConditionalBranch.cs
- UrlPropertyAttribute.cs
- _RequestCacheProtocol.cs
- UnsafeNativeMethods.cs
- Block.cs
- AnnotationResourceCollection.cs
- PersonalizationState.cs
- XmlMemberMapping.cs
- ApplicationDirectoryMembershipCondition.cs
- WebServiceMethodData.cs
- X509Utils.cs
- StatusBarPanel.cs
- SQLBinary.cs
- SwitchAttribute.cs
- ColumnWidthChangingEvent.cs
- CacheDependency.cs
- EdmPropertyAttribute.cs
- MessageHeaderInfoTraceRecord.cs
- DataGridSortCommandEventArgs.cs
- PeerCollaboration.cs
- RbTree.cs
- DelayedRegex.cs
- XmlEventCache.cs
- HttpException.cs
- SafeCertificateStore.cs
- SimpleRecyclingCache.cs
- SqlMetaData.cs
- MemberBinding.cs
- HtmlInputButton.cs
- NamespaceEmitter.cs
- SingleKeyFrameCollection.cs
- EventProvider.cs
- Win32.cs
- UnsafeNativeMethods.cs
- PropertyAccessVisitor.cs
- TransformDescriptor.cs
- ImageSourceValueSerializer.cs