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
- SettingsBindableAttribute.cs
- unsafenativemethodstextservices.cs
- PauseStoryboard.cs
- XmlTextWriter.cs
- CallbackBehaviorAttribute.cs
- RoutedEventHandlerInfo.cs
- UIntPtr.cs
- IdentityHolder.cs
- DockPanel.cs
- SwitchAttribute.cs
- SchemaCollectionCompiler.cs
- StringAttributeCollection.cs
- CodeTypeMember.cs
- DateTimeConverter.cs
- ImageMapEventArgs.cs
- DataGridViewCellStyle.cs
- StrongNameIdentityPermission.cs
- DataColumnPropertyDescriptor.cs
- Marshal.cs
- RegularExpressionValidator.cs
- DataGridViewSelectedRowCollection.cs
- DataObject.cs
- IteratorDescriptor.cs
- SendMailErrorEventArgs.cs
- DummyDataSource.cs
- FtpCachePolicyElement.cs
- SEHException.cs
- SafeLibraryHandle.cs
- ClientFormsIdentity.cs
- HttpNamespaceReservationInstallComponent.cs
- PaintValueEventArgs.cs
- StandardOleMarshalObject.cs
- BamlTreeMap.cs
- StrokeRenderer.cs
- ManipulationDeltaEventArgs.cs
- EntityProxyTypeInfo.cs
- Expression.DebuggerProxy.cs
- OdbcPermission.cs
- Stream.cs
- UnionCodeGroup.cs
- AggregatePushdown.cs
- RootProfilePropertySettingsCollection.cs
- OracleDataAdapter.cs
- Speller.cs
- ReadingWritingEntityEventArgs.cs
- DefaultParameterValueAttribute.cs
- CallbackDebugElement.cs
- ReadOnlyTernaryTree.cs
- ObjectListGeneralPage.cs
- DayRenderEvent.cs
- ComponentEditorPage.cs
- InputGestureCollection.cs
- HitTestResult.cs
- LambdaCompiler.Address.cs
- WebRequestModuleElement.cs
- CallbackValidatorAttribute.cs
- ISFClipboardData.cs
- WindowInteractionStateTracker.cs
- DocumentOrderComparer.cs
- DragDropManager.cs
- ApplicationContext.cs
- HttpChannelHelpers.cs
- PersonalizationEntry.cs
- PolygonHotSpot.cs
- ElementNotAvailableException.cs
- InputElement.cs
- SimpleType.cs
- ButtonStandardAdapter.cs
- Int16Animation.cs
- MouseButtonEventArgs.cs
- EasingQuaternionKeyFrame.cs
- XmlSchemaComplexContent.cs
- SimpleHandlerBuildProvider.cs
- SoapObjectInfo.cs
- WindowsSysHeader.cs
- PeerCollaboration.cs
- TemplateBaseAction.cs
- DataGridViewRowCollection.cs
- IdnElement.cs
- URLAttribute.cs
- PkcsUtils.cs
- AttributeEmitter.cs
- PermissionToken.cs
- GridViewRowPresenterBase.cs
- HMACSHA256.cs
- RequestCachingSection.cs
- _ServiceNameStore.cs
- OleDbDataReader.cs
- EntityCommand.cs
- storagemappingitemcollection.viewdictionary.cs
- FixedTextSelectionProcessor.cs
- RecordConverter.cs
- RenderOptions.cs
- InternalBufferOverflowException.cs
- SystemPens.cs
- DBConcurrencyException.cs
- TraceSection.cs
- AutomationAttributeInfo.cs
- QilIterator.cs
- AudioDeviceOut.cs