Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- CodeTypeDeclarationCollection.cs
- PasswordTextNavigator.cs
- PropertyMapper.cs
- XmlConvert.cs
- IisTraceWebEventProvider.cs
- WebBrowser.cs
- M3DUtil.cs
- OutputCacheSection.cs
- StorageScalarPropertyMapping.cs
- LinkedList.cs
- ScriptBehaviorDescriptor.cs
- DeflateEmulationStream.cs
- DiscoveryDocumentLinksPattern.cs
- GreenMethods.cs
- FilteredReadOnlyMetadataCollection.cs
- _ConnectStream.cs
- IPEndPoint.cs
- WebRequest.cs
- TextPointer.cs
- BindingValueChangedEventArgs.cs
- PerfCounterSection.cs
- TemplatePropertyEntry.cs
- CompleteWizardStep.cs
- ClaimTypes.cs
- RectangleHotSpot.cs
- HttpRuntimeSection.cs
- SubMenuStyleCollection.cs
- ParserHooks.cs
- NativeMethods.cs
- SqlWriter.cs
- InputProcessorProfilesLoader.cs
- SQLInt16Storage.cs
- DLinqDataModelProvider.cs
- CopyOnWriteList.cs
- DynamicValueConverter.cs
- CacheMode.cs
- Base64Stream.cs
- TerminateDesigner.cs
- FixedSOMSemanticBox.cs
- VectorAnimationUsingKeyFrames.cs
- StringKeyFrameCollection.cs
- KnownBoxes.cs
- DataViewSetting.cs
- Transform3DCollection.cs
- FormView.cs
- StrokeNode.cs
- TargetInvocationException.cs
- HMACMD5.cs
- GAC.cs
- CreateUserWizardStep.cs
- SecurityResources.cs
- TextRangeEditTables.cs
- HtmlInputText.cs
- ResourceIDHelper.cs
- Schedule.cs
- X509ChainElement.cs
- IInstanceTable.cs
- ContextInformation.cs
- NamespaceCollection.cs
- UriParserTemplates.cs
- ThreadStateException.cs
- ExternalException.cs
- NamedPipeActivation.cs
- SelectionRange.cs
- InputLangChangeRequestEvent.cs
- AppDomainAttributes.cs
- Subset.cs
- BuildProvider.cs
- PasswordRecoveryAutoFormat.cs
- AutomationEvent.cs
- Grant.cs
- WindowsListView.cs
- PenCursorManager.cs
- WindowsGraphics2.cs
- WebPartEventArgs.cs
- ActivityExecutor.cs
- NavigationEventArgs.cs
- WebServiceHost.cs
- StylusLogic.cs
- DictionaryKeyPropertyAttribute.cs
- FlowDocument.cs
- CharacterMetricsDictionary.cs
- PropertyGridCommands.cs
- SettingsProviderCollection.cs
- UdpSocket.cs
- ProgressBar.cs
- ServerValidateEventArgs.cs
- MD5.cs
- RolePrincipal.cs
- UnauthorizedWebPart.cs
- DataGridViewAdvancedBorderStyle.cs
- WindowsRichEdit.cs
- SelectedCellsChangedEventArgs.cs
- ServiceOperationListItem.cs
- Walker.cs
- UnionExpr.cs
- StructuredTypeEmitter.cs
- DashStyle.cs
- PkcsMisc.cs
- TableLayoutSettingsTypeConverter.cs