Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / Dom / XmlDomTextWriter.cs / 1305376 / XmlDomTextWriter.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace System.Xml {
using System;
using System.IO;
using System.Text;
using System.Runtime.Versioning;
// 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 ) {
}
[ResourceConsumption(ResourceScope.Machine)]
[ResourceExposure(ResourceScope.Machine)]
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;
using System.Runtime.Versioning;
// 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 ) {
}
[ResourceConsumption(ResourceScope.Machine)]
[ResourceExposure(ResourceScope.Machine)]
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
- ConstraintCollection.cs
- TextModifierScope.cs
- FusionWrap.cs
- IncrementalHitTester.cs
- securitycriticaldata.cs
- ErrorInfoXmlDocument.cs
- ConfigurationPermission.cs
- VerticalAlignConverter.cs
- XhtmlTextWriter.cs
- EntitySqlQueryCacheKey.cs
- DataIdProcessor.cs
- ServiceObjectContainer.cs
- FontStretch.cs
- MinimizableAttributeTypeConverter.cs
- XmlComment.cs
- Path.cs
- FixedDSBuilder.cs
- ArgumentException.cs
- HandlerFactoryCache.cs
- CommandHelpers.cs
- CfgArc.cs
- ValidatingReaderNodeData.cs
- WebPartConnection.cs
- DataTable.cs
- BulletedListEventArgs.cs
- AssemblyBuilder.cs
- FilterException.cs
- ExpressionVisitorHelpers.cs
- _HeaderInfoTable.cs
- formatter.cs
- ReflectionPermission.cs
- InternalBufferOverflowException.cs
- PeerObject.cs
- ActiveXHelper.cs
- ProxyWebPartManager.cs
- GridView.cs
- PipeSecurity.cs
- UrlPath.cs
- TCPClient.cs
- SqlProcedureAttribute.cs
- Soap12ServerProtocol.cs
- WinFormsComponentEditor.cs
- CharacterMetricsDictionary.cs
- FormViewPageEventArgs.cs
- DBCommand.cs
- PageCatalogPart.cs
- GradientBrush.cs
- WindowsToolbarAsMenu.cs
- ManualResetEvent.cs
- CheckedPointers.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- DisplayNameAttribute.cs
- CipherData.cs
- MyContact.cs
- FontClient.cs
- BrowserCapabilitiesFactoryBase.cs
- IfAction.cs
- DeclaredTypeElementCollection.cs
- ChannelPoolSettingsElement.cs
- MenuAutoFormat.cs
- DataGridColumnHeaderCollection.cs
- WpfGeneratedKnownProperties.cs
- ColumnMapCopier.cs
- DataGridLengthConverter.cs
- SlotInfo.cs
- DataGridColumnEventArgs.cs
- ProxyAttribute.cs
- _UriTypeConverter.cs
- ListSourceHelper.cs
- ControlType.cs
- odbcmetadatafactory.cs
- InputProcessorProfiles.cs
- CapiSafeHandles.cs
- SelectorItemAutomationPeer.cs
- CrossAppDomainChannel.cs
- ParameterCollection.cs
- CngKeyBlobFormat.cs
- Matrix.cs
- StringInfo.cs
- MenuItemStyleCollection.cs
- DataMemberFieldEditor.cs
- BulletChrome.cs
- HtmlTableRow.cs
- Freezable.cs
- SqlUtils.cs
- ModulesEntry.cs
- StateMachineWorkflowInstance.cs
- JsonEncodingStreamWrapper.cs
- ReflectionServiceProvider.cs
- PolicyException.cs
- DbSource.cs
- CompilationPass2Task.cs
- ProxyWebPart.cs
- LogManagementAsyncResult.cs
- KerberosSecurityTokenProvider.cs
- Funcletizer.cs
- IERequestCache.cs
- GeneralTransform3DTo2DTo3D.cs
- BamlStream.cs
- Debug.cs