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
- DataProtection.cs
- LoadGrammarCompletedEventArgs.cs
- XmlException.cs
- DataRecord.cs
- WindowsFont.cs
- TextDecoration.cs
- SystemThemeKey.cs
- TextBounds.cs
- DelegateBodyWriter.cs
- DoubleCollection.cs
- UpdatePanel.cs
- SchemaLookupTable.cs
- WindowsGrip.cs
- InfoCardBinaryReader.cs
- ApplicationProxyInternal.cs
- XmlReaderDelegator.cs
- RayMeshGeometry3DHitTestResult.cs
- BoolExpr.cs
- ServerValidateEventArgs.cs
- AdornerHitTestResult.cs
- MemberAccessException.cs
- Constraint.cs
- OpenFileDialog.cs
- IconBitmapDecoder.cs
- Version.cs
- RequestContextBase.cs
- ModuleBuilderData.cs
- ConvertersCollection.cs
- TextBoxAutoCompleteSourceConverter.cs
- DynamicActivityTypeDescriptor.cs
- _OSSOCK.cs
- Axis.cs
- NamedPipeDuplicateContext.cs
- DrawingCollection.cs
- DateTimeOffset.cs
- XmlSchemaSequence.cs
- SemanticResultValue.cs
- IdleTimeoutMonitor.cs
- SqlReferenceCollection.cs
- EventSetter.cs
- BinaryReader.cs
- DetailsViewPageEventArgs.cs
- filewebrequest.cs
- ChangePasswordAutoFormat.cs
- GetReadStreamResult.cs
- RegexWriter.cs
- ReliabilityContractAttribute.cs
- CompressEmulationStream.cs
- StrokeCollection2.cs
- HtmlDocument.cs
- TreeWalker.cs
- GetBrowserTokenRequest.cs
- Brush.cs
- PointCollection.cs
- _SpnDictionary.cs
- Vector3DConverter.cs
- RsaSecurityTokenParameters.cs
- UserPreferenceChangingEventArgs.cs
- CompilationSection.cs
- InvalidPrinterException.cs
- SqlInternalConnection.cs
- OperationCanceledException.cs
- GACIdentityPermission.cs
- LayoutEngine.cs
- SelectionListDesigner.cs
- ProjectionCamera.cs
- ThicknessAnimationUsingKeyFrames.cs
- ObfuscationAttribute.cs
- AsyncOperation.cs
- AspNetCacheProfileAttribute.cs
- StructuralType.cs
- SecurityContext.cs
- PopupRootAutomationPeer.cs
- PropertyPath.cs
- PropertyGridCommands.cs
- XmlFormatReaderGenerator.cs
- ExpanderAutomationPeer.cs
- BamlTreeMap.cs
- ToolStripComboBox.cs
- SvcMapFileSerializer.cs
- TextRunCacheImp.cs
- Panel.cs
- ButtonFieldBase.cs
- DisplayInformation.cs
- EntitySetBaseCollection.cs
- ListBoxDesigner.cs
- ListArgumentProvider.cs
- DropShadowBitmapEffect.cs
- EventArgs.cs
- DbSetClause.cs
- HandledEventArgs.cs
- DataGridViewHitTestInfo.cs
- FocusManager.cs
- InternalDuplexChannelFactory.cs
- CurrentTimeZone.cs
- CodeMethodReturnStatement.cs
- UiaCoreTypesApi.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- TableLayout.cs
- DeferredRunTextReference.cs