Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AppDomainProtocolHandler.cs
- FileLogRecordStream.cs
- NavigationFailedEventArgs.cs
- TextSelectionHighlightLayer.cs
- EventManager.cs
- DocumentViewerBaseAutomationPeer.cs
- coordinatorscratchpad.cs
- XamlPointCollectionSerializer.cs
- ModelFactory.cs
- TdsParserStateObject.cs
- FieldTemplateUserControl.cs
- SqlDataSourceEnumerator.cs
- CLRBindingWorker.cs
- OdbcErrorCollection.cs
- OdbcCommand.cs
- returneventsaver.cs
- ConstructorNeedsTagAttribute.cs
- invalidudtexception.cs
- ListControl.cs
- DetailsViewPagerRow.cs
- UserControlDocumentDesigner.cs
- DiscoveryCallbackBehavior.cs
- Viewport2DVisual3D.cs
- HttpModuleCollection.cs
- TreeViewItemAutomationPeer.cs
- DataObjectEventArgs.cs
- SqlBuilder.cs
- SizeF.cs
- BypassElementCollection.cs
- _CommandStream.cs
- SingleStorage.cs
- XmlArrayItemAttribute.cs
- PlainXmlDeserializer.cs
- ADConnectionHelper.cs
- UndoManager.cs
- FormParameter.cs
- AddInActivator.cs
- MenuCommand.cs
- SafeNativeMethods.cs
- PageCatalogPart.cs
- ListViewItemEventArgs.cs
- ActiveDocumentEvent.cs
- CheckedListBox.cs
- InternalPermissions.cs
- DataBoundLiteralControl.cs
- SoapAttributeOverrides.cs
- RadioButtonBaseAdapter.cs
- ToolStripOverflow.cs
- XmlIgnoreAttribute.cs
- OdbcFactory.cs
- XmlMtomWriter.cs
- StylusPointProperty.cs
- OrthographicCamera.cs
- XmlILModule.cs
- XslException.cs
- DataView.cs
- HttpModuleActionCollection.cs
- FunctionDetailsReader.cs
- CustomAttributeFormatException.cs
- MenuItemStyleCollection.cs
- ItemMap.cs
- Currency.cs
- MembershipUser.cs
- ProxyAttribute.cs
- GenericEnumerator.cs
- EndGetFileNameFromUserRequest.cs
- TreeView.cs
- ValidationService.cs
- DataServiceQueryException.cs
- Pair.cs
- HttpVersion.cs
- InternalPolicyElement.cs
- XmlDataCollection.cs
- TreeNode.cs
- COMException.cs
- ApplicationSettingsBase.cs
- PageThemeParser.cs
- QilFactory.cs
- TextServicesDisplayAttributePropertyRanges.cs
- RSAPKCS1KeyExchangeFormatter.cs
- IxmlLineInfo.cs
- XmlAutoDetectWriter.cs
- ExpressionCopier.cs
- DuplexClientBase.cs
- TemplateField.cs
- AffineTransform3D.cs
- DataGridBoolColumn.cs
- AmbientProperties.cs
- RecordManager.cs
- NameValuePermission.cs
- SchemaImporter.cs
- BrowserCapabilitiesFactory.cs
- WrapPanel.cs
- FileRecordSequence.cs
- DataGridCellsPanel.cs
- StringStorage.cs
- ResponseBodyWriter.cs
- Point3DIndependentAnimationStorage.cs
- ThemeableAttribute.cs
- BufferModeSettings.cs