Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewColumnHeaderCell.cs
- SecurityStandardsManager.cs
- KoreanLunisolarCalendar.cs
- AudioSignalProblemOccurredEventArgs.cs
- Vector3DValueSerializer.cs
- Light.cs
- CompileLiteralTextParser.cs
- WebServiceTypeData.cs
- DecoderExceptionFallback.cs
- StandardRuntimeEnumValidatorAttribute.cs
- ComAdminWrapper.cs
- ObjectItemCachedAssemblyLoader.cs
- MetaForeignKeyColumn.cs
- FocusManager.cs
- GetCertificateRequest.cs
- StaticTextPointer.cs
- ProgressPage.cs
- HandleRef.cs
- SamlSerializer.cs
- SiteMapDataSourceView.cs
- SafeArrayTypeMismatchException.cs
- PropertyGridView.cs
- ThreadPool.cs
- DataServiceProviderMethods.cs
- SelectedDatesCollection.cs
- XmlSchemaResource.cs
- StandardCommands.cs
- RtfToXamlLexer.cs
- DbConnectionPoolGroupProviderInfo.cs
- WebBrowserEvent.cs
- SmiContextFactory.cs
- TextBox.cs
- ProviderSettingsCollection.cs
- GlobalEventManager.cs
- PTUtility.cs
- DynamicHyperLink.cs
- PerspectiveCamera.cs
- DataTableClearEvent.cs
- GridViewCancelEditEventArgs.cs
- ListBase.cs
- NamedPermissionSet.cs
- SqlRecordBuffer.cs
- MimeWriter.cs
- DataControlButton.cs
- ParameterReplacerVisitor.cs
- ImplicitInputBrush.cs
- RootBrowserWindow.cs
- handlecollector.cs
- Console.cs
- EnterpriseServicesHelper.cs
- SmiRecordBuffer.cs
- SoapReflector.cs
- FileCodeGroup.cs
- FrugalList.cs
- TreeViewAutomationPeer.cs
- messageonlyhwndwrapper.cs
- SqlXmlStorage.cs
- StringUtil.cs
- QueueProcessor.cs
- CharStorage.cs
- HtmlPanelAdapter.cs
- ButtonBase.cs
- ExpressionBuilderCollection.cs
- HwndTarget.cs
- HttpServerVarsCollection.cs
- AlternateView.cs
- SqlDeflator.cs
- FormClosedEvent.cs
- ListControl.cs
- ObjectTag.cs
- InkPresenter.cs
- HostedTcpTransportManager.cs
- Timeline.cs
- IApplicationTrustManager.cs
- TextSelectionProcessor.cs
- FileSystemEventArgs.cs
- Page.cs
- TextEditorLists.cs
- SystemIPGlobalProperties.cs
- FormDesigner.cs
- TextRunProperties.cs
- __Filters.cs
- Freezable.cs
- Cursor.cs
- IdleTimeoutMonitor.cs
- TypeSource.cs
- LiteralLink.cs
- HwndSubclass.cs
- FrameworkElement.cs
- PerformanceCounterPermissionEntry.cs
- CmsInterop.cs
- OleDbEnumerator.cs
- EnvelopeVersion.cs
- ObservableCollection.cs
- TemplatedWizardStep.cs
- HttpException.cs
- LexicalChunk.cs
- ProxyWebPartManager.cs
- GridViewRow.cs
- EnumerableValidator.cs