Code:
/ DotNET / DotNET / 8.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
- DataGridClipboardHelper.cs
- ArglessEventHandlerProxy.cs
- Helper.cs
- InstanceHandleReference.cs
- input.cs
- SafeCoTaskMem.cs
- WsatExtendedInformation.cs
- FolderBrowserDialog.cs
- WindowsButton.cs
- ButtonChrome.cs
- Translator.cs
- CodeArgumentReferenceExpression.cs
- DoubleUtil.cs
- VirtualizedCellInfoCollection.cs
- AutoScrollHelper.cs
- SerialStream.cs
- WindowsListViewItemStartMenu.cs
- DockEditor.cs
- HashSetDebugView.cs
- MergeExecutor.cs
- ByteStreamMessageEncodingElement.cs
- ExceptionTranslationTable.cs
- RegexMatch.cs
- WorkflowRuntimeSection.cs
- ReadOnlyCollectionBase.cs
- WorkflowDebuggerSteppingAttribute.cs
- TextTreeObjectNode.cs
- LinkedList.cs
- DataGridViewColumn.cs
- __ConsoleStream.cs
- UriTemplateDispatchFormatter.cs
- RSACryptoServiceProvider.cs
- Mutex.cs
- XmlAnyAttributeAttribute.cs
- LinqDataSourceDeleteEventArgs.cs
- _ConnectStream.cs
- formatter.cs
- ReaderWriterLockWrapper.cs
- ShortcutKeysEditor.cs
- PageThemeCodeDomTreeGenerator.cs
- GridViewColumnCollectionChangedEventArgs.cs
- ObjectViewFactory.cs
- PersonalizationProviderHelper.cs
- Point3DCollection.cs
- ViewRendering.cs
- SchemaTableOptionalColumn.cs
- ChtmlSelectionListAdapter.cs
- RenderDataDrawingContext.cs
- ButtonField.cs
- SamlAction.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- TextElementAutomationPeer.cs
- MonitorWrapper.cs
- DataControlPagerLinkButton.cs
- InvokeHandlers.cs
- SortFieldComparer.cs
- Registration.cs
- CatalogPartChrome.cs
- OutKeywords.cs
- HtmlTableCell.cs
- SimpleType.cs
- ReferenceEqualityComparer.cs
- StorageAssociationTypeMapping.cs
- SchemaTypeEmitter.cs
- GeometryCombineModeValidation.cs
- SqlDataSourceRefreshSchemaForm.cs
- Enum.cs
- ProcessHostServerConfig.cs
- ComponentResourceKeyConverter.cs
- ListItem.cs
- ConfigurationManager.cs
- UserNameSecurityTokenAuthenticator.cs
- ComboBoxAutomationPeer.cs
- EventHandlersStore.cs
- RightsManagementEncryptedStream.cs
- DisplayNameAttribute.cs
- XmlSchemaValidator.cs
- SafeWaitHandle.cs
- Select.cs
- CustomSignedXml.cs
- PrinterResolution.cs
- DataGridLinkButton.cs
- OleDbException.cs
- DynamicMethod.cs
- MSAAWinEventWrap.cs
- CellRelation.cs
- QuaternionConverter.cs
- FontResourceCache.cs
- ScriptDescriptor.cs
- GridView.cs
- ExpressionVisitor.cs
- Splitter.cs
- GraphicsPathIterator.cs
- FileDialog_Vista.cs
- XmlCDATASection.cs
- BevelBitmapEffect.cs
- DefaultEvaluationContext.cs
- WorkflowTimerService.cs
- NameSpaceEvent.cs
- UserPersonalizationStateInfo.cs