Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Base / System / Windows / Markup / XmlWrappingReader.cs / 1 / XmlWrappingReader.cs
/****************************************************************************\ * * File: XmlWrappingReader.cs * * Purpose: * * History: * 5/11/05: [....] "Borrowed from Whidbey Beta2 Sources * * Copyright (C) 2005 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ //----------------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //helenak //----------------------------------------------------------------------------- using System; using System.Xml; using System.Xml.Schema; using System.Diagnostics; using System.Collections.Generic; using System.Security.Policy; #if PBTCOMPILER namespace MS.Internal.Markup #else namespace System.Windows.Markup #endif { internal class XmlWrappingReader : XmlReader, IXmlLineInfo, IXmlNamespaceResolver { // // Fields // protected XmlReader _reader; protected IXmlLineInfo _readerAsIXmlLineInfo; protected IXmlNamespaceResolver _readerAsResolver; // // Constructor // internal XmlWrappingReader( XmlReader baseReader ) { Debug.Assert( baseReader != null ); Reader = baseReader; } // // XmlReader implementation // public override XmlReaderSettings Settings { get { return _reader.Settings; } } public override XmlNodeType NodeType { get { return _reader.NodeType; } } public override string Name { get { return _reader.Name; } } public override string LocalName { get { return _reader.LocalName; } } public override string NamespaceURI { get { return _reader.NamespaceURI; } } public override string Prefix { get { return _reader.Prefix; } } public override bool HasValue { get { return _reader.HasValue; } } public override string Value { get { return _reader.Value; } } public override int Depth { get { return _reader.Depth; } } public override string BaseURI { get { return _reader.BaseURI; } } public override bool IsEmptyElement { get { return _reader.IsEmptyElement; } } public override bool IsDefault { get { return _reader.IsDefault; } } public override char QuoteChar { get { return _reader.QuoteChar; } } public override XmlSpace XmlSpace { get { return _reader.XmlSpace; } } public override string XmlLang { get { return _reader.XmlLang; } } public override IXmlSchemaInfo SchemaInfo { get { return _reader.SchemaInfo; } } public override System.Type ValueType { get { return _reader.ValueType; } } public override int AttributeCount { get { return _reader.AttributeCount; } } public override string this [ int i ] { get { return _reader[i]; } } public override string this [ string name ] { get { return _reader[ name ];}} public override string this [ string name, string namespaceURI ] { get { return _reader[ name, namespaceURI ]; } } public override bool CanResolveEntity { get { return _reader.CanResolveEntity; } } public override bool EOF { get { return _reader.EOF; } } public override ReadState ReadState { get { return _reader.ReadState; } } public override bool HasAttributes { get { return _reader.HasAttributes; } } public override XmlNameTable NameTable { get { return _reader.NameTable; } } public override string GetAttribute( string name ) { return _reader.GetAttribute( name ); } public override string GetAttribute( string name, string namespaceURI ) { return _reader.GetAttribute( name, namespaceURI ); } public override string GetAttribute( int i ) { return _reader.GetAttribute( i ); } public override bool MoveToAttribute( string name ) { return _reader.MoveToAttribute( name ); } public override bool MoveToAttribute( string name, string ns ) { return _reader.MoveToAttribute( name, ns ); } public override void MoveToAttribute( int i ) { _reader.MoveToAttribute( i ); } public override bool MoveToFirstAttribute() { return _reader.MoveToFirstAttribute(); } public override bool MoveToNextAttribute() { return _reader.MoveToNextAttribute(); } public override bool MoveToElement() { return _reader.MoveToElement(); } public override bool Read() { return _reader.Read(); } public override void Close() { _reader.Close(); } public override void Skip() { _reader.Skip(); } public override string LookupNamespace( string prefix ) { return _reader.LookupNamespace( prefix ); } string IXmlNamespaceResolver.LookupPrefix( string namespaceName ) { return (_readerAsResolver == null) ? null : _readerAsResolver.LookupPrefix( namespaceName ); } IDictionaryIXmlNamespaceResolver.GetNamespacesInScope ( XmlNamespaceScope scope ) { return (_readerAsResolver == null) ? null : _readerAsResolver.GetNamespacesInScope( scope ); } public override void ResolveEntity() { _reader.ResolveEntity(); } public override bool ReadAttributeValue() { return _reader.ReadAttributeValue(); } // // IDisposable interface // protected override void Dispose(bool disposing) { try { if(disposing) { ((IDisposable)_reader).Dispose(); } } finally { base.Dispose(disposing); } } // // IXmlLineInfo members // public virtual bool HasLineInfo() { return ( _readerAsIXmlLineInfo == null ) ? false : _readerAsIXmlLineInfo.HasLineInfo(); } public virtual int LineNumber { get { return ( _readerAsIXmlLineInfo == null ) ? 0 : _readerAsIXmlLineInfo.LineNumber; } } public virtual int LinePosition { get { return ( _readerAsIXmlLineInfo == null ) ? 0 : _readerAsIXmlLineInfo.LinePosition; } } // // Protected methods // protected XmlReader Reader { get { return _reader; } set { _reader = value; _readerAsIXmlLineInfo = value as IXmlLineInfo; _readerAsResolver = value as IXmlNamespaceResolver; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DBSchemaTable.cs
- DataBindEngine.cs
- TraceHelpers.cs
- ControlDesignerState.cs
- ConfigurationCollectionAttribute.cs
- GenericAuthenticationEventArgs.cs
- OutputScopeManager.cs
- SourceCollection.cs
- XomlCompilerError.cs
- Graph.cs
- CharacterMetrics.cs
- ScalarType.cs
- Matrix3D.cs
- VisemeEventArgs.cs
- PinnedBufferMemoryStream.cs
- SqlDataSourceCache.cs
- EntityTypeEmitter.cs
- ColorTransformHelper.cs
- RuleInfoComparer.cs
- PagesChangedEventArgs.cs
- NumericExpr.cs
- SqlError.cs
- WindowsToolbarAsMenu.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- ProxyHelper.cs
- Tokenizer.cs
- ArrayEditor.cs
- LicenseException.cs
- MsmqIntegrationBinding.cs
- ButtonRenderer.cs
- ListViewItem.cs
- milexports.cs
- SafeNativeMethods.cs
- ProcessProtocolHandler.cs
- AutomationAttributeInfo.cs
- StringFreezingAttribute.cs
- TextEditorThreadLocalStore.cs
- XpsFilter.cs
- ViewCellSlot.cs
- KeyValuePairs.cs
- VisualStyleRenderer.cs
- ObjectCacheHost.cs
- ClientRuntimeConfig.cs
- ThousandthOfEmRealPoints.cs
- ReferencedCategoriesDocument.cs
- GeometryGroup.cs
- RandomNumberGenerator.cs
- TransformerTypeCollection.cs
- DBConnection.cs
- DbRetry.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- DateTimeOffset.cs
- GridViewUpdatedEventArgs.cs
- DataGridItem.cs
- ObjectDataSourceView.cs
- HelpInfo.cs
- SoapCodeExporter.cs
- ToolStripDropDownClosedEventArgs.cs
- RootDesignerSerializerAttribute.cs
- TextServicesDisplayAttribute.cs
- ColumnTypeConverter.cs
- IntegerValidatorAttribute.cs
- DivideByZeroException.cs
- MDIControlStrip.cs
- TreeNodeSelectionProcessor.cs
- ObservableCollection.cs
- MatrixAnimationUsingKeyFrames.cs
- FixedSOMLineRanges.cs
- StylusTouchDevice.cs
- ResourceManager.cs
- TextRangeEditLists.cs
- AuthenticateEventArgs.cs
- MsmqIntegrationReceiveParameters.cs
- QueryCacheEntry.cs
- Formatter.cs
- LicenseException.cs
- ClaimSet.cs
- XmlDesigner.cs
- ConfigXmlText.cs
- DbgCompiler.cs
- ResourceDictionaryCollection.cs
- Matrix3D.cs
- ReaderWriterLock.cs
- NetworkCredential.cs
- UDPClient.cs
- SQLResource.cs
- OraclePermission.cs
- FontFamily.cs
- XmlUtil.cs
- ExpressionBinding.cs
- TaiwanLunisolarCalendar.cs
- ActiveXContainer.cs
- NativeBuffer.cs
- SequenceRangeCollection.cs
- ProcessHost.cs
- HttpRequestTraceRecord.cs
- FileCodeGroup.cs
- OpCodes.cs
- _DomainName.cs
- CacheHelper.cs