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
- DragSelectionMessageFilter.cs
- StdValidatorsAndConverters.cs
- Certificate.cs
- ObjectHelper.cs
- XPathParser.cs
- StatusCommandUI.cs
- DragEventArgs.cs
- Geometry.cs
- VectorAnimationUsingKeyFrames.cs
- DefaultAuthorizationContext.cs
- EmbossBitmapEffect.cs
- StringBuilder.cs
- ServiceEndpointCollection.cs
- MsmqOutputChannel.cs
- TransactionScope.cs
- ClientCredentialsElement.cs
- PriorityQueue.cs
- TdsParserStaticMethods.cs
- DefaultTypeArgumentAttribute.cs
- ForEachDesigner.xaml.cs
- XmlSchemaSimpleContentRestriction.cs
- PointHitTestResult.cs
- COM2FontConverter.cs
- OperandQuery.cs
- BasicCellRelation.cs
- AlternationConverter.cs
- XmlPreloadedResolver.cs
- ISAPIWorkerRequest.cs
- TextComposition.cs
- DesignOnlyAttribute.cs
- CheckBoxRenderer.cs
- ParameterToken.cs
- GraphicsState.cs
- HtmlTableRow.cs
- IImplicitResourceProvider.cs
- IndependentAnimationStorage.cs
- MessageHeaderInfoTraceRecord.cs
- Message.cs
- SqlLiftWhereClauses.cs
- EntitySetDataBindingList.cs
- WebPartTracker.cs
- ITreeGenerator.cs
- ParamArrayAttribute.cs
- DataGridDetailsPresenterAutomationPeer.cs
- DocumentOrderComparer.cs
- AliasExpr.cs
- MailMessage.cs
- MultipleViewPattern.cs
- TogglePatternIdentifiers.cs
- XPathDocumentBuilder.cs
- HitTestWithGeometryDrawingContextWalker.cs
- DataControlPagerLinkButton.cs
- WebBrowsableAttribute.cs
- FormsAuthenticationEventArgs.cs
- FontFamily.cs
- SafeHandle.cs
- RegexCaptureCollection.cs
- XmlDocumentFragment.cs
- UriTemplate.cs
- AssemblyResourceLoader.cs
- CommandCollectionEditor.cs
- GeneralTransform3DGroup.cs
- ViewCellRelation.cs
- sqlser.cs
- FunctionDetailsReader.cs
- CalendarTable.cs
- DynamicResourceExtensionConverter.cs
- PathTooLongException.cs
- FormViewDeleteEventArgs.cs
- DefaultEventAttribute.cs
- loginstatus.cs
- RequestQueryProcessor.cs
- XPathSelfQuery.cs
- UnsafeNetInfoNativeMethods.cs
- ReferenceEqualityComparer.cs
- Matrix.cs
- ToolStripDropDownClosingEventArgs.cs
- SizeKeyFrameCollection.cs
- WebPartDisplayModeCancelEventArgs.cs
- BoolLiteral.cs
- Debug.cs
- CommonGetThemePartSize.cs
- AssemblyBuilder.cs
- ObjectSet.cs
- CodeDelegateInvokeExpression.cs
- ConfigurationStrings.cs
- TypeAccessException.cs
- WebBaseEventKeyComparer.cs
- DataGridViewUtilities.cs
- MonthChangedEventArgs.cs
- UrlPath.cs
- EventRoute.cs
- StringToken.cs
- FrameworkTextComposition.cs
- IdleTimeoutMonitor.cs
- EnvironmentPermission.cs
- CqlIdentifiers.cs
- StringFunctions.cs
- SqlBulkCopyColumnMapping.cs
- SecurityDocument.cs