Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / Serialization / IndentedWriter.cs / 1305376 / 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
- OuterGlowBitmapEffect.cs
- LocalBuilder.cs
- MetaModel.cs
- ArgumentException.cs
- StackOverflowException.cs
- Panel.cs
- CodeMemberEvent.cs
- AssertFilter.cs
- ScrollBarRenderer.cs
- Tuple.cs
- EmbeddedMailObjectsCollection.cs
- TypeForwardedToAttribute.cs
- MutexSecurity.cs
- TableStyle.cs
- ExpressionConverter.cs
- Configuration.cs
- ChildDocumentBlock.cs
- ServiceAppDomainAssociationProvider.cs
- DataColumnChangeEvent.cs
- ProcessHostServerConfig.cs
- HwndTarget.cs
- QueryOptionExpression.cs
- RealizationDrawingContextWalker.cs
- FontDialog.cs
- FixedSOMPageConstructor.cs
- FormsAuthenticationEventArgs.cs
- NumericPagerField.cs
- FacetChecker.cs
- ConnectionStringSettings.cs
- UInt64Converter.cs
- SelectorItemAutomationPeer.cs
- AlphabetConverter.cs
- DateRangeEvent.cs
- SAPICategories.cs
- XmlChoiceIdentifierAttribute.cs
- Activity.cs
- PhysicalOps.cs
- MILUtilities.cs
- WindowsToolbar.cs
- DoWorkEventArgs.cs
- JsonGlobals.cs
- translator.cs
- XPathPatternBuilder.cs
- UInt16Storage.cs
- ReaderOutput.cs
- JsonReader.cs
- ResolvedKeyFrameEntry.cs
- UserThread.cs
- OleDbDataAdapter.cs
- Pen.cs
- CreateUserWizardStep.cs
- DPTypeDescriptorContext.cs
- SamlSerializer.cs
- MiniCustomAttributeInfo.cs
- CapiNative.cs
- HttpListenerContext.cs
- IssuedTokensHeader.cs
- DataColumnMappingCollection.cs
- EventSetter.cs
- TypeDependencyAttribute.cs
- EventPropertyMap.cs
- DataGridViewCheckBoxCell.cs
- ForEachAction.cs
- EnumValAlphaComparer.cs
- CachedTypeface.cs
- DefaultEventAttribute.cs
- GB18030Encoding.cs
- SessionStateContainer.cs
- SymLanguageVendor.cs
- SpecialFolderEnumConverter.cs
- NameValueCollection.cs
- SelectedDatesCollection.cs
- TextEditorSpelling.cs
- AssemblyBuilder.cs
- MembershipSection.cs
- IntersectQueryOperator.cs
- TableRow.cs
- DetailsViewUpdatedEventArgs.cs
- EventHandlersStore.cs
- BmpBitmapEncoder.cs
- PathSegmentCollection.cs
- DateTimeParse.cs
- ASCIIEncoding.cs
- FileDialog.cs
- XDRSchema.cs
- RadioButton.cs
- TdsRecordBufferSetter.cs
- XmlMemberMapping.cs
- DebuggerAttributes.cs
- ChannelEndpointElement.cs
- PrincipalPermissionMode.cs
- GPPOINTF.cs
- DispatcherHookEventArgs.cs
- RootNamespaceAttribute.cs
- NativeMethods.cs
- XmlSerializerFormatAttribute.cs
- ConfigurationSectionGroup.cs
- DataGridCell.cs
- AuthorizationSection.cs
- Keywords.cs