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
- ValuePatternIdentifiers.cs
- updateconfighost.cs
- ProxyGenerator.cs
- FixedSOMTableCell.cs
- WmlTextViewAdapter.cs
- ChildChangedEventArgs.cs
- PropertyTabAttribute.cs
- TheQuery.cs
- ObjectSet.cs
- RoleService.cs
- WebPartEditorCancelVerb.cs
- InstancePersistenceCommand.cs
- SQLMembershipProvider.cs
- DocumentApplicationState.cs
- TextElementEditingBehaviorAttribute.cs
- PolyLineSegment.cs
- PageStatePersister.cs
- ReceiveSecurityHeaderEntry.cs
- DataSvcMapFileSerializer.cs
- StylusPlugInCollection.cs
- tooltip.cs
- CodeNamespaceCollection.cs
- PartialCachingAttribute.cs
- ImpersonateTokenRef.cs
- ObjectViewListener.cs
- BaseCollection.cs
- ObjectDataSourceSelectingEventArgs.cs
- BrowserTree.cs
- ExtenderControl.cs
- VisualStateManager.cs
- ReadOnlyDataSourceView.cs
- ContentValidator.cs
- HandleTable.cs
- XmlSchemaAnyAttribute.cs
- AccessDataSourceView.cs
- WebPartHeaderCloseVerb.cs
- DesignTableCollection.cs
- PluralizationServiceUtil.cs
- GeometryDrawing.cs
- XmlHierarchicalEnumerable.cs
- DefaultHttpHandler.cs
- NativeMethods.cs
- UriTemplateVariableQueryValue.cs
- QilXmlWriter.cs
- WorkflowApplication.cs
- XmlIlGenerator.cs
- LocatorGroup.cs
- AssemblyNameProxy.cs
- SQLMoney.cs
- RegexCompilationInfo.cs
- StrongNameIdentityPermission.cs
- DbConnectionFactory.cs
- DigitalSignature.cs
- QilVisitor.cs
- WriteableBitmap.cs
- InternalSafeNativeMethods.cs
- XNodeValidator.cs
- LookupBindingPropertiesAttribute.cs
- ValidationRuleCollection.cs
- LinkTarget.cs
- WebPartCancelEventArgs.cs
- _BaseOverlappedAsyncResult.cs
- CommonDialog.cs
- CompositeCollection.cs
- ProgressiveCrcCalculatingStream.cs
- CacheDependency.cs
- EdmToObjectNamespaceMap.cs
- ColumnBinding.cs
- GenericRootAutomationPeer.cs
- StringFreezingAttribute.cs
- basemetadatamappingvisitor.cs
- FreezableDefaultValueFactory.cs
- CalculatedColumn.cs
- XmlRootAttribute.cs
- CompositeCollectionView.cs
- SelectionWordBreaker.cs
- SizeF.cs
- SchemaSetCompiler.cs
- InstanceDescriptor.cs
- UnmanagedHandle.cs
- Qualifier.cs
- UIntPtr.cs
- Graph.cs
- SplineKeyFrames.cs
- Variable.cs
- safemediahandle.cs
- NamespaceEmitter.cs
- Splitter.cs
- TextTreeUndo.cs
- ExpressionBindingCollection.cs
- ServiceModelSecurityTokenTypes.cs
- PrimitiveDataContract.cs
- PtsHost.cs
- ObjectConverter.cs
- HtmlInputPassword.cs
- XPathCompiler.cs
- RegionIterator.cs
- IdentifierService.cs
- SHA384.cs
- TimelineGroup.cs