Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Xml / System / Xml / Dom / XmlDomTextWriter.cs / 1 / XmlDomTextWriter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml { using System; using System.IO; using System.Text; // Represents a writer that will make it possible to work with prefixes even // if the namespace is not specified. // This is not possible with XmlTextWriter. But this class inherits XmlTextWriter. internal class XmlDOMTextWriter : XmlTextWriter { public XmlDOMTextWriter( Stream w, Encoding encoding ) : base( w,encoding ) { } public XmlDOMTextWriter( String filename, Encoding encoding ) : base( filename,encoding ){ } public XmlDOMTextWriter( TextWriter w ) : base( w ){ } // Overrides the baseclass implementation so that emptystring prefixes do // do not fail if namespace is not specified. public override void WriteStartElement( string prefix, string localName, string ns ){ if( ( ns.Length == 0 ) && ( prefix.Length != 0 ) ) prefix = "" ; base.WriteStartElement( prefix, localName, ns ); } // Overrides the baseclass implementation so that emptystring prefixes do // do not fail if namespace is not specified. public override void WriteStartAttribute( string prefix, string localName, string ns ){ if( ( ns.Length == 0 ) && ( prefix.Length != 0 ) ) prefix = "" ; base.WriteStartAttribute( prefix, localName, ns ); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml { using System; using System.IO; using System.Text; // Represents a writer that will make it possible to work with prefixes even // if the namespace is not specified. // This is not possible with XmlTextWriter. But this class inherits XmlTextWriter. internal class XmlDOMTextWriter : XmlTextWriter { public XmlDOMTextWriter( Stream w, Encoding encoding ) : base( w,encoding ) { } public XmlDOMTextWriter( String filename, Encoding encoding ) : base( filename,encoding ){ } public XmlDOMTextWriter( TextWriter w ) : base( w ){ } // Overrides the baseclass implementation so that emptystring prefixes do // do not fail if namespace is not specified. public override void WriteStartElement( string prefix, string localName, string ns ){ if( ( ns.Length == 0 ) && ( prefix.Length != 0 ) ) prefix = "" ; base.WriteStartElement( prefix, localName, ns ); } // Overrides the baseclass implementation so that emptystring prefixes do // do not fail if namespace is not specified. public override void WriteStartAttribute( string prefix, string localName, string ns ){ if( ( ns.Length == 0 ) && ( prefix.Length != 0 ) ) prefix = "" ; base.WriteStartAttribute( prefix, localName, ns ); } } } // 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
- MessageSmuggler.cs
- PropertyMap.cs
- XPathSelfQuery.cs
- CodeTypeDelegate.cs
- OverlappedContext.cs
- RepeaterCommandEventArgs.cs
- StructuralComparisons.cs
- VectorAnimationUsingKeyFrames.cs
- HtmlWindowCollection.cs
- CqlLexerHelpers.cs
- ReversePositionQuery.cs
- unsafenativemethodstextservices.cs
- FileInfo.cs
- WebPartUserCapability.cs
- MessageSecurityOverMsmqElement.cs
- DoubleAnimation.cs
- ITreeGenerator.cs
- ThousandthOfEmRealDoubles.cs
- TrustManagerMoreInformation.cs
- KnownTypesHelper.cs
- WpfXamlLoader.cs
- safelinkcollection.cs
- QilTargetType.cs
- FrameworkObject.cs
- ReferentialConstraintRoleElement.cs
- LocalizableAttribute.cs
- RSACryptoServiceProvider.cs
- ToolboxDataAttribute.cs
- EditBehavior.cs
- TypedDataSourceCodeGenerator.cs
- ImplicitInputBrush.cs
- PointF.cs
- SecurityUtils.cs
- StaticFileHandler.cs
- dataSvcMapFileLoader.cs
- PassportPrincipal.cs
- MemoryMappedViewStream.cs
- SectionInput.cs
- ObjectTokenCategory.cs
- NativeMethodsCLR.cs
- JavaScriptSerializer.cs
- TypeDelegator.cs
- CodeNamespaceCollection.cs
- future.cs
- ComponentCache.cs
- ReadOnlyCollection.cs
- CollectionType.cs
- MimeTypeAttribute.cs
- ToolStripDropDownItem.cs
- BrushMappingModeValidation.cs
- IsolatedStorageFilePermission.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- TreeViewAutomationPeer.cs
- InputGestureCollection.cs
- ToolStripDropDownButton.cs
- PrintControllerWithStatusDialog.cs
- TextEndOfParagraph.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- InheritanceContextChangedEventManager.cs
- StreamingContext.cs
- AxHost.cs
- NotifyInputEventArgs.cs
- FileVersion.cs
- FontDriver.cs
- XamlClipboardData.cs
- CompensableActivity.cs
- ProxyHelper.cs
- DeflateEmulationStream.cs
- TextTreeRootNode.cs
- ContentPlaceHolder.cs
- NamespaceTable.cs
- NativeMethods.cs
- XmlBindingWorker.cs
- RegularExpressionValidator.cs
- TagNameToTypeMapper.cs
- WinFormsSecurity.cs
- Lock.cs
- CodeVariableDeclarationStatement.cs
- ProviderSettings.cs
- SqlDataSourceCommandEventArgs.cs
- SHA384CryptoServiceProvider.cs
- Hashtable.cs
- DrawingState.cs
- TrackPoint.cs
- SqlInternalConnectionTds.cs
- Exceptions.cs
- ToolStripContainer.cs
- DynamicFilter.cs
- CallTemplateAction.cs
- GridLength.cs
- CaseInsensitiveComparer.cs
- CompoundFileReference.cs
- FigureParaClient.cs
- IgnoreSection.cs
- ListInitExpression.cs
- ScrollData.cs
- Mappings.cs
- QueryCacheKey.cs
- PageRouteHandler.cs
- WebScriptMetadataFormatter.cs