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
- ReferencedType.cs
- _DigestClient.cs
- CustomBindingElementCollection.cs
- DateTimeUtil.cs
- MatrixConverter.cs
- SmtpNetworkElement.cs
- SelectorItemAutomationPeer.cs
- MemoryRecordBuffer.cs
- Repeater.cs
- XmlAttributeProperties.cs
- ObjectDataSourceDisposingEventArgs.cs
- EdmComplexPropertyAttribute.cs
- TableRow.cs
- SafeRightsManagementEnvironmentHandle.cs
- IisTraceWebEventProvider.cs
- CommandHelpers.cs
- AppSettingsSection.cs
- DataControlCommands.cs
- SessionStateItemCollection.cs
- IndentedWriter.cs
- XMLSchema.cs
- StyleSheet.cs
- SimpleBitVector32.cs
- ToolStripContentPanel.cs
- _Semaphore.cs
- FilteredXmlReader.cs
- CalendarData.cs
- Codec.cs
- ReadOnlyCollection.cs
- AuthenticationModuleElementCollection.cs
- StdValidatorsAndConverters.cs
- LineMetrics.cs
- Propagator.Evaluator.cs
- TransactedBatchingElement.cs
- FaultException.cs
- SessionSwitchEventArgs.cs
- SafePEFileHandle.cs
- DependencySource.cs
- QilGenerator.cs
- TemplateEditingVerb.cs
- CompositeScriptReference.cs
- CharUnicodeInfo.cs
- GeometryModel3D.cs
- Button.cs
- SelectionManager.cs
- HandledMouseEvent.cs
- DefinitionUpdate.cs
- SchemaNamespaceManager.cs
- BaseHashHelper.cs
- TreeView.cs
- PathNode.cs
- AnimationClockResource.cs
- MenuItemBinding.cs
- Point.cs
- LOSFormatter.cs
- ActivationService.cs
- SimpleBitVector32.cs
- GenericUriParser.cs
- HttpCacheVaryByContentEncodings.cs
- Light.cs
- Token.cs
- TransformerTypeCollection.cs
- DbParameterHelper.cs
- ButtonChrome.cs
- InputLanguage.cs
- Span.cs
- Guid.cs
- Splitter.cs
- QilGeneratorEnv.cs
- DPAPIProtectedConfigurationProvider.cs
- SubMenuStyleCollection.cs
- BaseAutoFormat.cs
- SrgsElementList.cs
- DeclarativeCatalogPartDesigner.cs
- NonVisualControlAttribute.cs
- EndpointReference.cs
- ReadWriteObjectLock.cs
- KnownBoxes.cs
- DSASignatureFormatter.cs
- HttpDebugHandler.cs
- StatusStrip.cs
- PageContentCollection.cs
- GridViewColumnHeaderAutomationPeer.cs
- DBConcurrencyException.cs
- ConditionalAttribute.cs
- DrawingContext.cs
- ServerIdentity.cs
- LogicalCallContext.cs
- Button.cs
- CreateUserErrorEventArgs.cs
- DictionaryMarkupSerializer.cs
- SqlBulkCopyColumnMappingCollection.cs
- HtmlInputReset.cs
- FillErrorEventArgs.cs
- TextBreakpoint.cs
- FlowDocumentFormatter.cs
- UrlRoutingHandler.cs
- ConnectionPoint.cs
- RSAOAEPKeyExchangeDeformatter.cs
- AttributeQuery.cs