Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- Preprocessor.cs
- MatrixTransform3D.cs
- SessionStateItemCollection.cs
- EUCJPEncoding.cs
- DocumentPageHost.cs
- InstanceCollisionException.cs
- TreeViewEvent.cs
- TableCell.cs
- Propagator.ExtentPlaceholderCreator.cs
- MailAddressParser.cs
- FakeModelPropertyImpl.cs
- HttpResponseHeader.cs
- EditorPartChrome.cs
- Psha1DerivedKeyGenerator.cs
- NavigationProgressEventArgs.cs
- ResolveMatches11.cs
- HttpModuleCollection.cs
- DbConnectionHelper.cs
- UriSection.cs
- FileRecordSequence.cs
- TraceSource.cs
- ScrollBar.cs
- ResolveCriteriaApril2005.cs
- SortExpressionBuilder.cs
- EmitterCache.cs
- MouseEventArgs.cs
- EventPrivateKey.cs
- GridViewRow.cs
- XmlDeclaration.cs
- SizeF.cs
- StorageComplexPropertyMapping.cs
- UdpSocket.cs
- NativeMethods.cs
- NaturalLanguageHyphenator.cs
- AlgoModule.cs
- RuntimeResourceSet.cs
- SimpleRecyclingCache.cs
- SerializationEventsCache.cs
- COM2AboutBoxPropertyDescriptor.cs
- XmlQualifiedNameTest.cs
- TraceListener.cs
- MarshalByValueComponent.cs
- ImageDrawing.cs
- mansign.cs
- InputManager.cs
- EntityFunctions.cs
- ActivityBindForm.Designer.cs
- StylusLogic.cs
- DataListItemCollection.cs
- SessionEndingCancelEventArgs.cs
- MissingMethodException.cs
- LiteralSubsegment.cs
- basevalidator.cs
- Command.cs
- SecurityTokenTypes.cs
- TempEnvironment.cs
- DbProviderFactoriesConfigurationHandler.cs
- ColorAnimationBase.cs
- XamlBrushSerializer.cs
- MouseBinding.cs
- WebPartMovingEventArgs.cs
- ContextQuery.cs
- DependencyObjectType.cs
- Light.cs
- DrawingContextWalker.cs
- ValidatedControlConverter.cs
- ToolStripItemDataObject.cs
- CompiledRegexRunner.cs
- Empty.cs
- AnonymousIdentificationModule.cs
- PartitionerStatic.cs
- NoneExcludedImageIndexConverter.cs
- webeventbuffer.cs
- PrimitiveXmlSerializers.cs
- ChameleonKey.cs
- UriTemplateDispatchFormatter.cs
- TaskExceptionHolder.cs
- DebuggerAttributes.cs
- ListControlBuilder.cs
- HttpCapabilitiesSectionHandler.cs
- Point4DConverter.cs
- HttpPostProtocolImporter.cs
- HttpWebResponse.cs
- SoapServerMethod.cs
- SerializationTrace.cs
- OletxDependentTransaction.cs
- ThousandthOfEmRealDoubles.cs
- CustomWebEventKey.cs
- DrawListViewSubItemEventArgs.cs
- ResourcePermissionBaseEntry.cs
- AnyReturnReader.cs
- XmlSchemaGroupRef.cs
- ListViewTableCell.cs
- XmlSchemaSimpleTypeList.cs
- SequentialActivityDesigner.cs
- _HelperAsyncResults.cs
- MetadataCache.cs
- ResourcePart.cs
- MemoryPressure.cs
- configsystem.cs