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
- WaitHandle.cs
- PartitionerQueryOperator.cs
- DispatcherEventArgs.cs
- BindingManagerDataErrorEventArgs.cs
- AnnotationMap.cs
- SmtpSection.cs
- SessionPageStatePersister.cs
- GenericAuthenticationEventArgs.cs
- DecoderFallback.cs
- MsmqIntegrationOutputChannel.cs
- BroadcastEventHelper.cs
- ApplicationFileParser.cs
- BaseValidator.cs
- ProcessModule.cs
- StoreConnection.cs
- VirtualDirectoryMappingCollection.cs
- WebPartZone.cs
- Resources.Designer.cs
- NotSupportedException.cs
- InkCanvasSelection.cs
- CollectionView.cs
- ColumnReorderedEventArgs.cs
- FunctionQuery.cs
- XhtmlBasicObjectListAdapter.cs
- SafeArchiveContext.cs
- ConstructorBuilder.cs
- ScrollChangedEventArgs.cs
- ResourcePool.cs
- SnapshotChangeTrackingStrategy.cs
- TypeBuilder.cs
- TripleDES.cs
- ConfigViewGenerator.cs
- LogicalCallContext.cs
- InputScopeConverter.cs
- DataRow.cs
- SqlDelegatedTransaction.cs
- TakeQueryOptionExpression.cs
- WrappedOptions.cs
- EntityParameter.cs
- OdbcInfoMessageEvent.cs
- AliasGenerator.cs
- TypedServiceOperationListItem.cs
- StandardRuntimeEnumValidator.cs
- AdapterSwitches.cs
- ToolStripItemCollection.cs
- _ConnectionGroup.cs
- XmlSchemaInferenceException.cs
- CheckoutException.cs
- smtpconnection.cs
- CustomCategoryAttribute.cs
- XmlSerializerFactory.cs
- XMLSchema.cs
- DataGridViewImageCell.cs
- ListMarkerSourceInfo.cs
- InvalidPropValue.cs
- TrackBarRenderer.cs
- CompiledQueryCacheKey.cs
- QilReplaceVisitor.cs
- PreloadedPackages.cs
- IxmlLineInfo.cs
- ProfileParameter.cs
- Certificate.cs
- Vector3DValueSerializer.cs
- DataGridViewImageCell.cs
- Documentation.cs
- SchemaSetCompiler.cs
- Stacktrace.cs
- TogglePatternIdentifiers.cs
- WhitespaceRule.cs
- FormsAuthenticationCredentials.cs
- SqlGatherConsumedAliases.cs
- WebPartConnectionsDisconnectVerb.cs
- GroupBoxRenderer.cs
- RtfToXamlLexer.cs
- Dispatcher.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- OrderedDictionary.cs
- Debug.cs
- SuppressMessageAttribute.cs
- SecurityHelper.cs
- ReachVisualSerializerAsync.cs
- OleDbException.cs
- MultiTrigger.cs
- ConnectionStringsExpressionBuilder.cs
- StylusPlugInCollection.cs
- XmlArrayItemAttribute.cs
- BoundPropertyEntry.cs
- WindowsToolbarAsMenu.cs
- ScriptResourceHandler.cs
- GenerateHelper.cs
- CatalogPartChrome.cs
- TextRangeEditLists.cs
- HttpServerProtocol.cs
- Vector3DCollectionConverter.cs
- ListViewItemEventArgs.cs
- AttachmentService.cs
- InkCanvasInnerCanvas.cs
- CredentialCache.cs
- ConstraintCollection.cs
- EditorZoneBase.cs