Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- TemplatePropertyEntry.cs
- Native.cs
- InternalDuplexBindingElement.cs
- CubicEase.cs
- AsymmetricKeyExchangeDeformatter.cs
- CommonDialog.cs
- GenerateScriptTypeAttribute.cs
- PointIndependentAnimationStorage.cs
- XmlWellformedWriterHelpers.cs
- TreeNode.cs
- DataRecordObjectView.cs
- StateItem.cs
- SettingsPropertyCollection.cs
- SatelliteContractVersionAttribute.cs
- SqlConnectionPoolGroupProviderInfo.cs
- StringValueConverter.cs
- FacetEnabledSchemaElement.cs
- ContractMapping.cs
- PerspectiveCamera.cs
- IdentityReference.cs
- PolyBezierSegmentFigureLogic.cs
- RevocationPoint.cs
- CollectionViewGroupInternal.cs
- EditorPartCollection.cs
- EnvelopedPkcs7.cs
- CssStyleCollection.cs
- SupportsEventValidationAttribute.cs
- HeaderCollection.cs
- QueryContinueDragEvent.cs
- InstanceOwnerQueryResult.cs
- ColorMatrix.cs
- State.cs
- InlineCollection.cs
- RectValueSerializer.cs
- ColorTransformHelper.cs
- ObjectViewListener.cs
- Environment.cs
- RegexRunner.cs
- FormatConvertedBitmap.cs
- DataTableMappingCollection.cs
- NotificationContext.cs
- ToolStripScrollButton.cs
- NumberSubstitution.cs
- WebPartUserCapability.cs
- RegexCompiler.cs
- AliasedSlot.cs
- Material.cs
- WebPartEditorApplyVerb.cs
- ClientSettingsStore.cs
- XmlEncodedRawTextWriter.cs
- NotConverter.cs
- ScopedMessagePartSpecification.cs
- PerfCounterSection.cs
- CustomCredentialPolicy.cs
- SoapProtocolImporter.cs
- MULTI_QI.cs
- IISUnsafeMethods.cs
- TextChange.cs
- MethodCallConverter.cs
- IISMapPath.cs
- CategoryValueConverter.cs
- EdmProperty.cs
- StretchValidation.cs
- Size3D.cs
- ProcessingInstructionAction.cs
- TabControlCancelEvent.cs
- SqlConnectionFactory.cs
- DropShadowBitmapEffect.cs
- ComplexTypeEmitter.cs
- StorageEntityContainerMapping.cs
- TextBlock.cs
- diagnosticsswitches.cs
- DataGridViewColumnConverter.cs
- DecoderNLS.cs
- MenuItem.cs
- JsonEncodingStreamWrapper.cs
- FontUnitConverter.cs
- SqlLiftIndependentRowExpressions.cs
- ITextView.cs
- Image.cs
- XmlNavigatorStack.cs
- DataGridLinkButton.cs
- WebPartUserCapability.cs
- mediaeventshelper.cs
- WindowsClaimSet.cs
- X509RawDataKeyIdentifierClause.cs
- NGCPageContentSerializerAsync.cs
- PeerDefaultCustomResolverClient.cs
- Select.cs
- DocumentViewerHelper.cs
- CalendarButton.cs
- ClientSideQueueItem.cs
- Adorner.cs
- AttachedProperty.cs
- CompareValidator.cs
- ColumnClickEvent.cs
- TextElementEnumerator.cs
- OutputCacheModule.cs
- SqlBinder.cs
- LoginCancelEventArgs.cs