Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StandardCommands.cs
- ScriptingWebServicesSectionGroup.cs
- MultipleViewPattern.cs
- DrawingCollection.cs
- ResourceDescriptionAttribute.cs
- HttpHandlerActionCollection.cs
- NetworkInterface.cs
- RepeaterItem.cs
- HashHelper.cs
- XPathBuilder.cs
- indexingfiltermarshaler.cs
- SecurityDescriptor.cs
- RoleBoolean.cs
- DesignerTransactionCloseEvent.cs
- XsdDuration.cs
- PriorityChain.cs
- Point4D.cs
- ExistsInCollection.cs
- QilNode.cs
- SQLRoleProvider.cs
- formatter.cs
- TemplateInstanceAttribute.cs
- DataGridCellItemAutomationPeer.cs
- PageAction.cs
- BaseEntityWrapper.cs
- ScriptMethodAttribute.cs
- TextServicesPropertyRanges.cs
- Misc.cs
- BitmapEncoder.cs
- COM2ColorConverter.cs
- TransformPattern.cs
- AttributeQuery.cs
- DisplayMemberTemplateSelector.cs
- PrintDialogDesigner.cs
- Repeater.cs
- SharedStream.cs
- ActivityDesignerResources.cs
- PackagePartCollection.cs
- CancellationToken.cs
- PropertyGridEditorPart.cs
- PrintPreviewGraphics.cs
- XmlStreamStore.cs
- _SslState.cs
- DataGridLinkButton.cs
- PeerPresenceInfo.cs
- WaitForChangedResult.cs
- CatalogPart.cs
- URLAttribute.cs
- XmlSchemas.cs
- ExpandedWrapper.cs
- storepermission.cs
- ToolStripDropDownClosingEventArgs.cs
- XmlValidatingReader.cs
- SerializationFieldInfo.cs
- FlowSwitch.cs
- SqlDataSourceEnumerator.cs
- FormsIdentity.cs
- PrivilegeNotHeldException.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- ResourceDictionary.cs
- PeerNearMe.cs
- RefreshPropertiesAttribute.cs
- XmlDataCollection.cs
- Baml2006KnownTypes.cs
- AppDomainManager.cs
- RelationshipConstraintValidator.cs
- NetNamedPipeBinding.cs
- XmlTextEncoder.cs
- ListViewGroupItemCollection.cs
- JpegBitmapDecoder.cs
- SafeRegistryHandle.cs
- PersonalizationStateInfoCollection.cs
- MimeWriter.cs
- XPathPatternParser.cs
- RenamedEventArgs.cs
- SByteConverter.cs
- RawStylusInputReport.cs
- FixedPageStructure.cs
- XmlDataSourceView.cs
- DCSafeHandle.cs
- AttributeQuery.cs
- NamespaceEmitter.cs
- CellParagraph.cs
- WebPartPersonalization.cs
- DataGridRowDetailsEventArgs.cs
- DateTimeOffsetConverter.cs
- SystemTcpStatistics.cs
- BasicViewGenerator.cs
- StateElement.cs
- CachingHintValidation.cs
- ProcessInfo.cs
- MasterPageCodeDomTreeGenerator.cs
- RouteValueExpressionBuilder.cs
- WebPartDisplayModeEventArgs.cs
- SafeBitVector32.cs
- Soap12FormatExtensions.cs
- EntityProviderServices.cs
- CodeCastExpression.cs
- MethodBuilderInstantiation.cs
- LazyTextWriterCreator.cs