Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- WCFServiceClientProxyGenerator.cs
- ActivityCodeGenerator.cs
- MimeObjectFactory.cs
- ConfigurationStrings.cs
- PropertySourceInfo.cs
- AutomationIdentifier.cs
- XmlEncoding.cs
- FrameworkReadOnlyPropertyMetadata.cs
- XmlNotation.cs
- DataSourceHelper.cs
- TableLayoutSettingsTypeConverter.cs
- Wizard.cs
- HtmlWindowCollection.cs
- Message.cs
- IEnumerable.cs
- FastEncoder.cs
- UnderstoodHeaders.cs
- DataControlLinkButton.cs
- ProxyAttribute.cs
- UnsafeNativeMethods.cs
- ObjectManager.cs
- MeshGeometry3D.cs
- TableItemStyle.cs
- SortAction.cs
- UpdateProgress.cs
- FormatConvertedBitmap.cs
- SplashScreenNativeMethods.cs
- AnonymousIdentificationSection.cs
- SplitContainer.cs
- CompareInfo.cs
- EmptyQuery.cs
- FormClosedEvent.cs
- WebHttpBinding.cs
- HybridWebProxyFinder.cs
- DoubleCollection.cs
- TreeNodeEventArgs.cs
- SQLMoneyStorage.cs
- TdsRecordBufferSetter.cs
- CharAnimationBase.cs
- ObfuscationAttribute.cs
- GeneralTransformGroup.cs
- BinaryObjectWriter.cs
- DockPattern.cs
- DesignerTransactionCloseEvent.cs
- Helpers.cs
- SubMenuStyle.cs
- HealthMonitoringSection.cs
- Pair.cs
- DataGridViewCellConverter.cs
- webclient.cs
- InvalidDataContractException.cs
- EntityClientCacheKey.cs
- FontStyle.cs
- TypeLoadException.cs
- WSSecurityPolicy.cs
- Repeater.cs
- Pen.cs
- TagMapCollection.cs
- Int32AnimationUsingKeyFrames.cs
- EditorAttribute.cs
- AssemblyContextControlItem.cs
- MyContact.cs
- Privilege.cs
- NavigationCommands.cs
- Constants.cs
- ThreadWorkerController.cs
- DesignerVerbToolStripMenuItem.cs
- XamlTreeBuilder.cs
- TypeDescriptionProviderAttribute.cs
- MemberExpression.cs
- SerializableAttribute.cs
- XmlConvert.cs
- WebBrowserUriTypeConverter.cs
- TTSEngineTypes.cs
- SqlUDTStorage.cs
- Pair.cs
- XmlElementAttributes.cs
- DataServiceKeyAttribute.cs
- DispatcherHooks.cs
- AnimatedTypeHelpers.cs
- DiagnosticStrings.cs
- RegexStringValidatorAttribute.cs
- ColorInterpolationModeValidation.cs
- MouseCaptureWithinProperty.cs
- TemplateControlParser.cs
- XmlSchemaFacet.cs
- BaseCAMarshaler.cs
- ExternalCalls.cs
- SpoolingTask.cs
- TemplateKeyConverter.cs
- XmlMembersMapping.cs
- ObjectResult.cs
- OneOfScalarConst.cs
- RichTextBox.cs
- MouseActionConverter.cs
- ArcSegment.cs
- SrgsItemList.cs
- FixedPageProcessor.cs
- BadImageFormatException.cs
- SocketCache.cs